fix(cast): replay Nitro transactions - #15729
Open
mattsse wants to merge 4 commits into
Open
Conversation
mattsse
requested review from
0xrusowsky,
DaniPopes,
grandizzy and
mablr
as code owners
July 14, 2026 12:38
mattsse
marked this pull request as draft
July 14, 2026 12:45
Decode full blocks through AnyNetwork so Nitro system transactions do not invalidate otherwise standard blocks. Charge Nitro poster gas before EVM execution, recognize Robinhood's chain IDs, and preserve OP transaction envelopes during conversion.
mattsse
force-pushed
the
mattsse/fix-cast-run-chain-replay
branch
from
July 14, 2026 12:50
109d6ad to
37007b5
Compare
Reconstruct Tempo AA envelopes decoded through AnyNetwork before converting them to TempoTxEnv. Dispatch replay based on the converted transaction kind so batched calls are not mistaken for creates.
Require matching Nitro receipts and reject missing, malformed, or overflowing poster-gas values. Use checked gas accounting so invalid RPC data cannot silently change replay behavior.
mablr
marked this pull request as ready for review
July 15, 2026 14:28
mablr
previously approved these changes
Jul 15, 2026
stevencartavia
approved these changes
Jul 15, 2026
Member
Author
|
yeah @mablr not super happy with this just yet, maybe we can simplify this a bit? |
Member
|
Yeah, this is definitely cursed, we already ended up elsewhere with such hacks (eg. forks). We can defer this to foundry 2.0 (close this PR), alloy network/rpc definitely need a rework. |
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 rundecoded full blocks with the selected Ethereum or OP network type, so Nitro's0x6asystem transaction made otherwise standard Arbitrum and Robinhood blocks fail before replay. This decodes RPC blocks throughAnyNetworkwhile preserving OP envelope bytes during conversion.Nitro charges the L1 poster-gas component before EVM execution and reports it separately in receipts. Local replay previously exposed that gas to the transaction, which could change execution results. The replay now deducts receipt-reported poster gas before execution and adds it back to the displayed total. Robinhood's chain IDs are also recognized for Nitro block-number semantics, and Nitro Cancun blocks may omit the parent beacon root.
Fixes #7514. Closes OSS-556.
This PR was written with Codex, including investigation, code generation, and test generation.