perf(test-rpc, test-fill): fetch a block's receipts with single eth_getBlockReceipts - #3345
Conversation
c86ef9e to
1cb5c7a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
marioevz
left a comment
There was a problem hiding this comment.
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.
1cb5c7a to
7068441
Compare
LouisTsai-Csie
left a comment
There was a problem hiding this comment.
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.
eth_getBlockReceipts
7068441 to
9f11ae4
Compare
|
Successfully created backport PR for |
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:
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_getBlockReceiptsinstead of batch-query of each receipt in the block.Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture