You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bridge-event and peg indexes are not crash-safe across a branch switch #377
sync/src/service/beside.rs:54,939-1005 and storage/src/position.rs:273-450.
The head switch itself is one atomic batch. The Bridge-event index and the legacy
peg-event store are then updated afterwards, from an in-memory log.
A crash in the window between leaves:
the old branch's events still indexed, and
peg records from blocks run beside the chain lost for good
Nothing repairs either on restart.
Scope
This does not affect consensus. The state root and the chain are unaffected.
It affects anything that reads those indexes — eth_getLogs over Bridge events,
peg-in/peg-out reporting, and the peg accounting work tracked separately.
Worth stating plainly because "crash-unsafe index" sounds worse than it is: a
resync or an index rebuild fixes it, if we have one. The problem is that today we
have neither a rebuild path nor detection.
What would settle it
Either fold the index updates into the same atomic batch as the head switch, or
add a repair-on-restart that detects the inconsistency and rebuilds from the
canonical chain.
Reported by the external reviewer; the file:line anchors are theirs and have not
been re-derived here.
Activity