feat: seal verification + Heimdall span cache in BorConsensus#85
Merged
VAIBHAVJINDAL3012 merged 1 commit intomainfrom Mar 11, 2026
Merged
feat: seal verification + Heimdall span cache in BorConsensus#85VAIBHAVJINDAL3012 merged 1 commit intomainfrom
VAIBHAVJINDAL3012 merged 1 commit intomainfrom
Conversation
- Add compute_seal_hash() to compute keccak256(RLP(header)) with the 65-byte seal stripped from extra data, matching Go Bor's SealHash - Enhance BorConsensus with Mutex<SpanCache> and Mutex<Recents> for thread-safe validator set lookups and anti-double-sign tracking - In validate_block_pre_execution: ecrecover signer from seal, verify against authorized validator set from cached spans, enforce anti-double-sign window - Expose insert_span() for eager span cache population from Heimdall - Add Debug derive to SpanCache - Add seal hash determinism and round-trip ecrecover tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
compute_seal_hash()function that computes keccak256(RLP(header)) with the 65-byte seal stripped from extra data, matching Go Bor'sSealHashbehaviorBorConsensuswithMutex<SpanCache>andMutex<Recents>for thread-safe validator set lookups and anti-double-sign tracking during block validationvalidate_block_pre_execution: ecrecover signer from seal, verify against authorized validator set from cached Heimdall spans, enforce anti-double-sign windowinsert_span()for eager span cache population from Heimdall before block validationDebugderive toSpanCacheArchitecture
validate_header): structural checks only (sync-safe, no external state needed)validate_block_pre_execution): full seal verification using cached spansTest plan
compute_seal_hashdeterminism testcargo checkpasses🤖 Generated with Claude Code