refactor: Replace operation log with event log for transaction history#433
Draft
joschisan wants to merge 1 commit intofedimint:masterfrom
Draft
refactor: Replace operation log with event log for transaction history#433joschisan wants to merge 1 commit intofedimint:masterfrom
joschisan wants to merge 1 commit intofedimint:masterfrom
Conversation
42bff60 to
969106f
Compare
Replace the on-demand operation log scanning in transactions() with fedimint's event log system (same approach as conduit). A background listener persists all payment events to a local DB, and transactions() reads from there with operation log enrichment for detail fields. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
969106f to
d6a04ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The ecash-app reconstructs transaction history on-demand from Fedimint's operation log — a ~340-line function that parses operation metadata and outcomes. The conduit app uses Fedimint's event log (
fedimint-eventlog) to persist payment events to a local DB and read them back. We want the same system here, keeping the existing Flutter interface (sameTransactiontype, sametransactions()function, sameMultimintEventvariants) completely unchanged.Architecture
Event log as primary source, operation log for enrichment.
transactions()reads from local event log DB instead of scanning the operation logMultimintEvent::Lightning/::Ecashstill published for Flutter toast triggersWhat's in the event log vs what needs the operation log
Available from event log:
Needs operation log enrichment (detail view only):
Changes
events.rs— Ports conduit's event log parsing (ParsedPayment,ParsedEvent,parse_event_log_entry,apply_update). Handles LNv2, mint, and wallet events. LNv1 events structure-ready for next fedimint release.db.rs— AddsEventLogEntryKey/EventLogEntryPrefixDB schema (prefix0x15)multimint.rs— Replacesspawn_lnv2_event_listenerwithspawn_event_log_listener(persists all events, publishes MultimintEvent for toasts). Rewritestransactions()to read from event log DB with operation log enrichment for detail fields.lib.rs— Addsmod events;🤖 Generated with Claude Code