Skip to content

perf(sequencer): scan batch boundaries from receipts only - #1387

Closed
mattsse wants to merge 1 commit into
mainfrom
mattsse/perf-monitor-receipts-only-scan
Closed

perf(sequencer): scan batch boundaries from receipts only#1387
mattsse wants to merge 1 commit into
mainfrom
mattsse/perf-monitor-receipts-only-scan

Conversation

@mattsse

@mattsse mattsse commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The zone monitor rescans for BatchFinalized boundaries once per zone block, and the scan read the full body of every block in the range through block_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 the finalizeWithdrawalBatch transaction 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_number calls and from 66 to 65 receipts_by_block calls.

The two per-block monitor lines reporting the scanned range are now debug!.

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

mattsse commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

not worth it

@mattsse mattsse closed this Sep 3, 2026
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.

1 participant