Skip to main content

Module fee_shares_watcher

Module fee_shares_watcher 

Source
Expand description

FeeRouter.SharesUpdated watcher (ADR 041 / ADR 016 § Tunable Economics).

The node seeds its live operator fee-share cell (OperatorShares) from an authoritative getShares() read at startup (see runtime::mod). This watcher keeps that cell current: it follows SharesUpdated events off the same shared-head eth_getLogs poller every other chain watcher uses, and — as a safety net against a missed log — periodically re-reads getShares() authoritatively at fee_shares_poll_interval. Both paths store into the shared OperatorShares, so a governance retune of the fee split reaches the running serve-economics margin calculation without a restart.

The sink is read-only and holds no durable cursor, and it scans no history: the tail starts AT head. There is nothing for a lookback to recover — the startup getShares() read is authoritative and already reflects every event ever emitted, so re-scanning blocks below it can only re-derive a value the node already holds. The periodic re-read covers anything the tail drops.

Functions§

route
Build the fee-shares Route for the shared multiplexed poller. poll_interval is the slower authoritative-re-read safety net (fee_shares_poll_interval) that rides the sink’s on_tick_complete; the merged getLogs cadence is the poller’s.