perf(sequencer): scan batch boundaries from receipts only - #1387
Closed
mattsse wants to merge 1 commit into
Closed
Conversation
The monitor rescans for BatchFinalized boundaries on every canonical-state notification, that is once per zone block, and the scan read the full body of every block in the range through block_by_number. Reth serves that from the in-memory canonical state as a deep clone of the body, or decodes the whole body from the database, while the scan used it only for a transaction hash and a transaction/receipt count check. The scan now reads receipts alone and keeps the transaction index that FinalizedBatchLog already records, so the finalizeWithdrawalBatch transaction is resolved by index once the boundary block is read. That block is read exactly once per batch and shared between batch reconstruction and the commitment snapshot, which each re-read it before, and the count check moved to that single read. Counting provider calls against the mock provider for a 64-block scan plus one batch: block_by_number 66 -> 1, receipts_by_block 66 -> 65. The two per-block monitor log lines that report the scanned range are now debug! rather than info!.
mattsse
requested review from
0xKitsune,
adityapk00,
klkvr and
rkrasiuk
as code owners
September 3, 2026 20:52
Contributor
Author
|
not worth it |
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.
The zone monitor rescans for
BatchFinalizedboundaries once per zone block, and the scan read the full body of every block in the range throughblock_by_number, which reth serves as a deep clone of the body. The body was only used for a transaction hash and a count check; the events live in the receipts and the recorded transaction index is enough to find thefinalizeWithdrawalBatchtransaction later.The scan now reads receipts only and resolves that transaction by index. The boundary block is read once per batch and shared between batch reconstruction and the commitment snapshot, which previously each re-read it, and the count check moved to that single read. Against the mock provider, a 64-block scan plus one batch drops from 66 to 1
block_by_numbercalls and from 66 to 65receipts_by_blockcalls.The two per-block monitor lines reporting the scanned range are now
debug!.