Skip to content

refactor(test-rpc): unify batch request chunking - #3327

Merged
LouisTsai-Csie merged 3 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:refactor-batch-rpc
Aug 7, 2026
Merged

refactor(test-rpc): unify batch request chunking#3327
LouisTsai-Csie merged 3 commits into
ethereum:forks/amsterdamfrom
LouisTsai-Csie:refactor-batch-rpc

Conversation

@LouisTsai-Csie

@LouisTsai-Csie LouisTsai-Csie commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

There are two unrelated batch-size constants:

  • In send_wait_transactions, EthRPC.DEFAULT_MAX_TRANSACTIONS_PER_BATCH is configured to 750. This restricts the number of transactions sent per iteration: send them, wait for them, and then do the next iteration.
  • In get_transaction_receipts, the batch size is configured to 500 (chunk size). The same restriction could be applied to get_balances, get_codes, get_transactions_by_hash, send_transactions,get_account and get_alloc, none of which chunk today.

In this PR, I lift the transport chunking into post_batch_request and collapse both constants into a single BaseRPC.max_batch_size (default 750), so every batched method is chunk-safe. get_transaction_receipts drops its
own chunking loop, and send_wait_transactions keeps its loop but reads the shared limit.

The constructor argument and pytest fixture are renamed from max_transactions_per_batch to max_batch_size; the --max-tx-per-batch lag keeps its name.

Notable behavior change: --max-tx-per-batch now 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

  • 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-->

@LouisTsai-Csie LouisTsai-Csie added C-refactor Category: refactor A-test-rpc Area: execution_testing.rpc labels Aug 6, 2026
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.50%. Comparing base (07424a8) to head (89d9917).
⚠️ Report is 5 commits behind head on forks/amsterdam.

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           
Flag Coverage Δ
unittests 93.50% <ø> (ø)

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.

@spencer-tb spencer-tb 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.

Small nit, otherwise LGTM!

Comment thread packages/testing/src/execution_testing/rpc/rpc.py
Co-authored-by: spencer <spencer.tb@ethereum.org>
@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 7, 2026
@LouisTsai-Csie
LouisTsai-Csie merged commit 4f17c37 into ethereum:forks/amsterdam Aug 7, 2026
31 checks passed
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Successfully created backport PR for benchmarks/amsterdam:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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-refactor Category: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants