Summary
Forest's eth_subscribe("logs") subscription does not emit reorg-removed logs. On a chain reorg, geth, reth, and Lotus all re-emit the logs of reverted tipsets/blocks with removed: true so subscribers can roll back state. Forest currently drops reverted tipsets entirely and only emits logs for applied tipsets.
The root cause is that Forest has no reverted-event tracking. EthEventHandler::collect_events recomputes events from tipset state on every query and hardcodes reverted: false. CollectedEvent.reverted is therefore always false, and EthLog.removed (src/rpc/methods/eth.rs, removed: event.reverted) is consequently always false.
How Lotus does it (reference design)
Lotus maintains reverted as a first-class property, two converging paths both feeding CollectedEvent.Reverted → EthLog.Removed (Removed: ev.Reverted, node/impl/eth/events.go):
- Persisted index (ChainIndexer / SQLite).
- Live subscription push. An in-memory
eventFilter registered as a head-change observer builds CollectedEvent{ Reverted: revert } from whether the head-change was an apply (false) or revert (true)
Completion Criteria
Summary
Forest's
eth_subscribe("logs")subscription does not emit reorg-removed logs. On a chain reorg, geth, reth, and Lotus all re-emit the logs of reverted tipsets/blocks withremoved: trueso subscribers can roll back state. Forest currently drops reverted tipsets entirely and only emits logs for applied tipsets.The root cause is that Forest has no reverted-event tracking. EthEventHandler::collect_events recomputes events from tipset state on every query and hardcodes
reverted: false.CollectedEvent.revertedis therefore alwaysfalse, andEthLog.removed(src/rpc/methods/eth.rs,removed: event.reverted) is consequently alwaysfalse.How Lotus does it (reference design)
Lotus maintains
revertedas a first-class property, two converging paths both feedingCollectedEvent.Reverted→EthLog.Removed(Removed: ev.Reverted,node/impl/eth/events.go):eventFilterregistered as a head-change observer buildsCollectedEvent{ Reverted: revert }from whether the head-change was an apply (false) or revert (true)Completion Criteria
eth_subscribe("logs")re-emits the logs of reverted tipsets withremoved: trueon reorg (reverts emitted before applies).