replay
Fetch and re-execute an on-chain transaction with optional overrides and tracing.
Re-execute a historical transaction locally using state and block context fetched from an RPC endpoint.
Usage
mega-evme replay [OPTIONS] <TX_HASH>Arguments
TX_HASH
TX_HASHThe transaction hash to replay (32-byte hex, required).
mega-evme fetches the transaction, its block environment, and the relevant pre-state from the RPC, then re-executes it locally. This gives you a fully reproducible execution without needing a local archive node.
--rpc <URL>
--rpc <URL>Aliases: --rpc-url Environment variable: RPC_URL Default: http://localhost:8545
The RPC endpoint to fetch the transaction and state from. Any standard Ethereum JSON-RPC provider works here.
mega-evme replay --rpc https://mainnet.megaeth.com/rpc <TX_HASH>Spec Auto-Detection
The EVM spec controls which opcodes, gas rules, and MegaETH-specific behaviors are active during execution. replay auto-detects the spec from the chain ID and the block timestamp of the replayed transaction. Hardcoded hardfork configs exist for:
Chain 6343 — MegaETH testnet v2
Chain 4326 — MegaETH mainnet
For any other chain, replay enables all hardforks at genesis (currently equivalent to Rex4).
--override.spec <SPEC>
--override.spec <SPEC>Override the auto-detected spec. Useful when you want to test how the transaction would behave under a different spec, or when replaying against a chain that isn't recognized.
Transaction Overrides
Override flags let you modify the transaction before re-executing it. The original on-chain transaction is unchanged; only the local replay is affected. This is useful for "what-if" testing: what happens with less gas, different calldata, or a different ETH value?
--override.gas-limit <GAS>
--override.gaslimit
Replace the transaction's gas limit
--override.value <VALUE>
Replace the ETH value sent (supports 1ether, 100gwei suffixes)
--override.input <HEX>
--override.data
Replace the calldata with a hex-encoded byte string
--override.input-file <FILE>
--override.data-file
Replace the calldata with the contents of a file
Note that replay does not accept --chain, block environment flags, or pre-state flags. All of that context comes from the RPC.
Options
replay supports the following shared option groups. See the linked pages for full details.
SALT buckets — Configure SALT bucket capacity for dynamic storage gas pricing. See SALT Buckets.
State dump — Dump or load pre/post-state snapshots. See State Management.
Tracing — Emit execution traces (call traces, opcode traces, gas profiles, etc.). See Tracing Overview.
Examples
In all examples below, replace 0xabc123... with a real transaction hash from MegaETH mainnet.
Basic replay
Replay against a custom RPC
Replay with call tracing
Replay with a tighter gas limit
Replay with different calldata
Replay under a specific spec
Full Help Output
See Also
Last updated