commonwarexyz / commonwarexyz/battleware
[application] Remove Event MMR
- Dominant language
- Rust
- Stars
- 26
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
We should just compute a root over the events at some height (using `bmt`) rather than storing an events root.
This change will cut ~50% off the commit flow at the end of a block (https://github.com/commonwarexyz/battleware/blob/51db184e021755b885463949c391dcf23de0e941/execution/src/state_transition.rs#L82-L105), won't limit our ability to service event proofs (can still prove any subset of block events using this `bmt`), and will simplify recovery logic (don't need to worry about committing event before state).
If we want to retain a global event index for all items, we can store the last index value in the commit metadata (with height) and start event block indexing at that value. This would still allow us to offer an API that walks the event history without any meaningful overhead for the node.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with execution/src/state_transition.rs, especially lines 82-105, and trace how the event root is committed and recovered. Review the bmt-based event-root approach and commit metadata, then verify that event proofs, event-history indexing, and recovery still work without storing an event MMR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100