Repository navigation
fix(rpc): keep omitted-gas calls within the RPC gas cap (v2.5.2 backport) - #46
Merged
haardikk21 merged 1 commit intoNov 25, 2026
Conversation
refcell
approved these changes
Nov 25, 2026
haardikk21
added a commit
to base/base
that referenced
this pull request
Nov 25, 2026
….7 (#6733) * fix(deps): backport reth omitted-gas RPC gas cap fix (#27586) Moves the reth pin on releases/v1.5.7 to base/reth#46, which cherry-picks paradigmxyz/reth#27586 onto backport/v2.5.2/main. Co-authored-by: Toshi <toshi-noreply@coinbase.com> * chore(deps): pin base/reth to base-v2.5.2.12 Co-authored-by: Toshi <toshi-noreply@coinbase.com> --------- Co-authored-by: Toshi <toshi-noreply@coinbase.com>
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.
Why
Backports paradigmxyz#27586 (upstream commit 5b68630) onto
backport/v2.5.2/mainfor the Basereleases/v1.5.xline.When a priced call (
eth_call,trace_call, and related methods) omitsgas, the request gas limit is first set to--rpc.gascap. It is then replaced by the caller's gas allowance (balance / gas price), capped only by the block gas limit. The allowance can be far larger than the RPC gas cap, so callers can get past the cap and drive excessive execution and memory use.releases/v2.8.1, the fork line pinned by base/basemainandreleases/v1.6.0, already contains the upstream fix. Thebase-v2.5.2.*line used byreleases/v1.5.xdoes not.What
Cherry-picked with
-x, upstream authorship kept. The production change incrates/rpc/rpc-eth-api/src/helpers/call.rsapplied cleanly and matches upstream: when an RPC gas cap is set, the allowance is clamped to the gas limit already capped by the RPC gas cap.The only conflict was in the
crates/rpc/rpc/src/eth/core.rstest module. The upstream hunk also carried tests from upstream PRs that are not on v2.5.2 (estimate_gas_*from paradigmxyz#27384, header size from later PRs). Only the newcall_allowance_respects_rpc_gas_captest is kept, unchanged. Two additions support it: thebuild_test_eth_api_with_gas_caphelper (from paradigmxyz#27384) and the imports the test needs.Testing
cargo +1.96.0 test -p reth-rpc --lib -- eth::core::tests: 9 passed, includingcall_allowance_respects_rpc_gas_cap.left: 78998,right: 28998). It catches the bypassed cap.cargo +1.96.0 clippy -p reth-rpc -p reth-rpc-eth-api --lib --tests --locked -- -D warnings: clean.cargo +nightly fmt --check: clean.Notes
Not tagged yet. After merge, the next tag in the series is
base-v2.5.2.12.