Skip to content

caplin: fix chain_reorg event#20889

Open
BitWonka wants to merge 2 commits intoerigontech:mainfrom
BitWonka:fix-caplin-chain-reorg-event
Open

caplin: fix chain_reorg event#20889
BitWonka wants to merge 2 commits intoerigontech:mainfrom
BitWonka:fix-caplin-chain-reorg-event

Conversation

@BitWonka
Copy link
Copy Markdown
Contributor

@BitWonka BitWonka commented Apr 28, 2026

Summary

  • Fixes caplin: chain_reorg event has incorrect depth (uint64 underflow) and old_head_block #20885.
  • Caplin's chain_reorg SSE event emitted underflowed depth and the wrong old_head_block / old_head_state because nothing tracked the previous canonical tip.
  • TruncateCanonicalChain now returns the highest slot/root it deleted (captured during the existing iteration). The reorg event uses that as the previous tip; depth becomes oldCanonicalSlot - currentSlot.
  • Adds a regression test for the new return values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

caplin: chain_reorg event has incorrect depth (uint64 underflow) and old_head_block

2 participants