refactor(test-rpc): unify batch request chunking - #3327
Merged
LouisTsai-Csie merged 3 commits intoAug 7, 2026
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3327 +/- ##
================================================
Coverage 93.50% 93.50%
================================================
Files 624 624
Lines 37070 37070
Branches 3394 3394
================================================
Hits 34661 34661
Misses 1653 1653
Partials 756 756
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:
|
spencer-tb
approved these changes
Aug 6, 2026
spencer-tb
left a comment
Contributor
There was a problem hiding this comment.
Small nit, otherwise LGTM!
Co-authored-by: spencer <spencer.tb@ethereum.org>
|
Successfully created backport PR for |
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.
Description
There are two unrelated batch-size constants:
send_wait_transactions,EthRPC.DEFAULT_MAX_TRANSACTIONS_PER_BATCHis configured to 750. This restricts the number of transactions sent per iteration: send them, wait for them, and then do the next iteration.get_transaction_receipts, the batch size is configured to 500 (chunk size). The same restriction could be applied toget_balances,get_codes,get_transactions_by_hash,send_transactions,get_accountandget_alloc, none of which chunk today.In this PR, I lift the transport chunking into
post_batch_requestand collapse both constants into a singleBaseRPC.max_batch_size(default 750), so every batched method is chunk-safe.get_transaction_receiptsdrops itsown chunking loop, and
send_wait_transactionskeeps its loop but reads the shared limit.The constructor argument and pytest fixture are renamed from
max_transactions_per_batchtomax_batch_size; the--max-tx-per-batchlag keeps its name.Notable behavior change:
--max-tx-per-batchnow also caps receipts, balances, code and account state batches, and receipt batches grow from 500 to 750.Related Issues or PRs
Follow up on PR #3298 , comment #3298 (review)
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