Skip to content

perf(test-rpc, test-fill): fetch a block's receipts with single eth_getBlockReceipts - #3345

Merged
LouisTsai-Csie merged 2 commits into
ethereum:forks/amsterdamfrom
jochem-brouwer:getblockreceipts
Aug 14, 2026
Merged

perf(test-rpc, test-fill): fetch a block's receipts with single eth_getBlockReceipts#3345
LouisTsai-Csie merged 2 commits into
ethereum:forks/amsterdamfrom
jochem-brouwer:getblockreceipts

Conversation

@jochem-brouwer

@jochem-brouwer jochem-brouwer commented Aug 10, 2026

Copy link
Copy Markdown
Member

Note: written with LLM

Per-transaction receipt lookup is quadratic in a block's transaction count. A client resolves a single receipt by loading the block's whole receipt list and returning one entry from it, so N lookups do N x O(N) work. Batching the requests removes the round trips but not that cost -- the batch is one request, and the client still does the work N times.

Measured against ethpandaops/geth:glamsterdam-devnet-7 on a block of plain transfers, timing each phase separately:

transactions   per-tx batch   getBlockReceipts
       1,000          0.47s              0.02s
       2,000          1.66s              0.05s
       4,000          5.43s              0.08s
       8,000         19.94s              0.17s

The per-tx path scales at ~n^1.7 (8x the transactions costs 42x the time) while this one is linear. Everything else in the fill -- building the block, executing it, forkchoice -- is linear and fast by comparison (0.82s, 0.34s, 0.03s at N=8,000).

At the 16,000-transaction blocks the stateful benchmarks build, that extrapolates to ~80s of receipt fetching per fixture against well under a second, roughly half the wall clock of a fill run. Observed on a real fill: 16,000-tx fixtures took ~170s each while geth logged elapsed=423ms for the block import.

eth_getBlockReceipts returns receipts in transaction order, but the previous path matched them to transactions by hash; keep that guarantee explicitly rather than trusting ordering silently, and check the count.

Drops the now-unused batched get_transaction_receipts helper, which this branch had added for this call site and nothing else uses.

Description

Switches to eth_getBlockReceipts instead of batch-query of each receipt in the block.

Related Issues or PRs

N/A.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.53%. Comparing base (343274c) to head (9f11ae4).
⚠️ Report is 15 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3345   +/-   ##
================================================
  Coverage            93.53%   93.53%           
================================================
  Files                  624      624           
  Lines                37070    37074    +4     
  Branches              3394     3394           
================================================
+ Hits                 34675    34679    +4     
  Misses                1645     1645           
  Partials               750      750           
Flag Coverage Δ
unittests 93.53% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marioevz marioevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Really nice improvement! My only comment is on the docstrings, they are a bit too verbose in my opinion, and contain statistics which are client-derived (external) and will become stale at some point.

Comment thread packages/testing/src/execution_testing/client_clis/client_backend.py Outdated

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Drops the now-unused batched get_transaction_receipts helper, which this branch had added for this call site and nothing else uses.

Could you please update the PR description? The helper is not removed.

Comment thread packages/testing/src/execution_testing/rpc/rpc.py Outdated
Comment thread packages/testing/src/execution_testing/client_clis/client_backend.py Outdated
Comment thread packages/testing/src/execution_testing/client_clis/client_backend.py Outdated
Comment thread packages/testing/src/execution_testing/client_clis/client_backend.py Outdated
@LouisTsai-Csie LouisTsai-Csie added A-test-rpc Area: execution_testing.rpc A-test-fill Area: execution_testing.cli.pytest_commands.plugins.filler C-perf Scope: Performance - an optimization or speed-up. labels Aug 11, 2026
@LouisTsai-Csie LouisTsai-Csie changed the title perf(fill): fetch a block's receipts with one eth_getBlockReceipts perf(test-rpc, test-fill): fetch a block's receipts with single eth_getBlockReceipts Aug 11, 2026
@LouisTsai-Csie
LouisTsai-Csie marked this pull request as ready for review August 11, 2026 05:41
@LouisTsai-Csie LouisTsai-Csie added the backport benchmarks/amsterdam On merge, bot cherry-picks the squash commit to `benchmarks/amsterdam` and opens a PR. Squash only. label Aug 14, 2026

@LouisTsai-Csie LouisTsai-Csie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@LouisTsai-Csie
LouisTsai-Csie merged commit 253a463 into ethereum:forks/amsterdam Aug 14, 2026
31 checks passed
@github-actions

Copy link
Copy Markdown

LouisTsai-Csie added a commit that referenced this pull request Aug 14, 2026
…getBlockReceipts` (#3345) (#3376)

* perf(fill): fetch a block's receipts with one eth_getBlockReceipts

* refactor: block receipt fetching logic

---------


(cherry picked from commit 253a463)

Co-authored-by: Jochem Brouwer <jochembrouwer96@gmail.com>
Co-authored-by: LouisTsai <q1030176@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-test-fill Area: execution_testing.cli.pytest_commands.plugins.filler A-test-rpc Area: execution_testing.rpc backport benchmarks/amsterdam On merge, bot cherry-picks the squash commit to `benchmarks/amsterdam` and opens a PR. Squash only. C-perf Scope: Performance - an optimization or speed-up.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants