fix(cast): stop re-validating mined transactions on replay - #16457
Merged
Conversation
`cast run` re-applied two checks that a mined transaction has already passed, and both made whole chains unreplayable. The block gas limit check rejects transactions some chains admit anyway: BSC validator transactions carry a gas limit of `i64::MAX`, so replaying any transaction in such a block failed with "caller gas limit exceeds the block gas limit". Replay now always skips the check, matching what `cast call --trace` already does. Requiring a parent beacon block root for Cancun assumes Ethereum's beacon chain. Polygon and Scroll run a Cancun or later EVM without one and never deploy the EIP-4788 contract, so every transaction on them failed with `MissingParentBeaconBlockRoot` at any `--evm-version` at or above Cancun. The root is now applied when the header carries one and skipped when it does not. Verified against live nodes: Scroll and Polygon transactions replay, Scroll matches receipt gas exactly, and Ethereum, Avalanche and Optimism are unchanged.
mattsse
requested review from
0xrusowsky,
DaniPopes,
figtracer,
grandizzy,
mablr and
stevencartavia
as code owners
August 29, 2026 01:37
Contributor
✅ Changelog foundThe deterministic check will validate the changed entry. |
The helper can no longer fail, so it drops the `Result` and becomes a `const fn`, which clippy's `missing_const_for_fn` required. `run_disable_block_gas_limit_check` asserted that replay fails without `--disable-block-gas-limit`. Replay no longer applies that check, so both invocations now expect success and the test is renamed for what it covers.
This was referenced Aug 29, 2026
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.
cast runre-applied two checks that a mined transaction has already passed on-chain, and each one made whole chains unreplayable.The block gas limit check rejects transactions that some chains admit anyway. BSC validator transactions carry a gas limit of
i64::MAX, well past the 55M block limit, so replaying one failed withtransaction validation error: caller gas limit exceeds the block gas limit. Replay now always skips the check, which is whatcast call --tracealready does;--disable-block-gas-limitstays accepted and is now implied.Requiring a parent beacon block root for Cancun bakes in Ethereum's beacon chain. Polygon and Scroll run a Cancun or later EVM without one and never deploy the EIP-4788 contract, so every transaction on them failed with
MissingParentBeaconBlockRoot, at every--evm-versionfrom Cancun up — there was no flag that got past it. The root is applied when the header carries one and skipped when it does not, so Ethereum replay is unaffected and chains without a beacon chain simply have no root to apply.Found by replaying recent blocks on twelve chains and diffing against
eth_getBlockReceipts. After the change, Scroll transactions replay and match receipt gas exactly, Polygon transactions replay, and Ethereum, Avalanche and Optimism are unchanged.This PR was written by Claude Code, including the survey behind it and this description. Verified against live nodes for each chain named above.