Expand description
Client Event Log
The goal here is to maintain a single, ordered, append only log of all important client-side events: low or high level, and move as much of coordination between different parts of the system in a natural and decomposed way.
Any event log “follower” can just keep going through all events and react to ones it is interested in (and understands), potentially emitting events of its own, and atomically updating persisted event log position (“cursor”) of events that were already processed.
Structs§
- Ordered, contiguous ID space, which is easy for event log followers to track.
- A self-allocated ID that is mostly ordered
Constants§
- DB prefixes hardcoded for use of the event log
fedimint-eventlog
was extracted fromfedimint-client
to help include/re-use in other part of the code. But fundamentally its role is to implement event log in the client. There is currently no way to inject the prefixes to use for db records, so we use these constants to keep them in sync. Any other app that will want to store its own even log, will need to use the exact same prefixes, which in practice should not be a problem.
Statics§
- An counter that resets on every restart, that guarantees that
UnordedEventLogId
s don’t conflict with each other.
Traits§
Functions§
- The code that handles new unordered events and rewriters them fully ordered into the final event log.