Skip to content

feat(flashblocks): add validation module for sequence ordering and reorg detection (1)#18993

Merged
einar-oplabs merged 1 commit intodevelopfrom
teddyknox/flashblock-sequencing
Feb 4, 2026
Merged

feat(flashblocks): add validation module for sequence ordering and reorg detection (1)#18993
einar-oplabs merged 1 commit intodevelopfrom
teddyknox/flashblock-sequencing

Conversation

@teddyknox
Copy link
Copy Markdown
Contributor

@teddyknox teddyknox commented Jan 29, 2026

Summary

Adds stateless validation infrastructure for flashblock sequencing:

  • FlashblockSequenceValidator - Validates flashblock ordering (consecutive indices within a block, proper block transitions)
  • ReorgDetector - Detects chain reorgs by comparing transaction hash sets between pending and canonical state
  • CanonicalBlockReconciler - Determines reconciliation strategy (CatchUp/HandleReorg/DepthLimitExceeded/Continue) when canonical blocks arrive

Details

All validation logic is stateless and const fn where possible, with comprehensive test coverage for edge cases.

Test plan

  • Unit tests for FlashblockSequenceValidator (NextInSequence, FirstOfNextBlock, Duplicate, NonSequentialGap, InvalidNewBlockIndex)
  • Unit tests for ReorgDetector (identical sequences, different order, different counts, different hashes)
  • Unit tests for CanonicalBlockReconciler (NoPendingState, CatchUp, HandleReorg, DepthLimitExceeded, Continue)

@teddyknox teddyknox requested a review from a team as a code owner January 29, 2026 22:02
@teddyknox teddyknox changed the title feat(flashblocks): add validation module for sequence ordering and reorg detection feat(flashblocks): add validation module for sequence ordering and reorg detection (1) Jan 29, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.8%. Comparing base (32ace93) to head (466c2b1).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #18993     +/-   ##
==========================================
+ Coverage     76.3%    79.8%   +3.4%     
==========================================
  Files          188      133     -55     
  Lines        10939     6909   -4030     
==========================================
- Hits          8357     5519   -2838     
+ Misses        2436     1390   -1046     
+ Partials       146        0    -146     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests 79.8% <ø> (-1.9%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 57 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@einar-oplabs einar-oplabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

…d reconciliation

Add stateless validators for flashblock processing:
- FlashblockSequenceValidator: validates consecutive indices within blocks
- ReorgDetector: detects chain reorgs via transaction hash comparison
- CanonicalBlockReconciler: determines strategy when canonical blocks arrive
@teddyknox teddyknox force-pushed the teddyknox/flashblock-sequencing branch from d600a9c to 259fb6b Compare February 4, 2026 01:01
@wiz-inc-a178a98b5d
Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 2 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 2 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@einar-oplabs einar-oplabs added this pull request to the merge queue Feb 4, 2026
Merged via the queue into develop with commit 24112cf Feb 4, 2026
95 checks passed
@einar-oplabs einar-oplabs deleted the teddyknox/flashblock-sequencing branch February 4, 2026 01:55
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.

2 participants