feat(cli): pair mainnet replay bench with revm - #384
Open
RealiCZ wants to merge 1 commit into
Open
Conversation
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.
Summary
mainnet_25347446_25347455/replaybenchmark with revm. It was the only workload without a revm comparison:BenchCaseKind::BlockchainReplaynever entered theEVM2_BENCH_REVM=1path, so the one bench that resembles real-world load had no paired number.evm2_cli::replay_benchmodule drives the same corpus through both engines:blob_params_for_timestamp, pre/post-block system calls (EIP-2935/4788/7002/7251), withdrawals, and commit cadence (journal accumulation per tx, one commit per block ontoCacheDB<EmptyDB>).tests/replay_parity.rsplus a bench-time sanity check compare every transaction's gas used, success flag and log count, and independently anchor both engines to each header'sgasUsed. The paired numbers only exist while this passes. Current corpus (10 blocks / 2279 txs / 276,625,341 gas): zero mismatches on both dispatch backends.…/replay/setupand…/replay/revm/setupbenches measuring the engine-neutral harness work (pre-state + tx decoding, ~31 ms per iteration on the corpus) so the EVM-only ratio can be read separately.EVM2_BENCH_REPLAY_MEASUREMENT_SECS/EVM2_BENCH_REPLAY_SAMPLES). All other benches keep the existing budget and code paths.Sample numbers on an Apple M5 Pro (nightly): evm2 109.18 ms vs revm 124.71 ms — 1.14x raw, 1.19x after subtracting the shared setup; with
EVM2_DISPATCH_BACKEND=packed: 115.02 ms vs 125.96 ms (1.10x / 1.13x). All CI widths < 2.5%.Test plan
cargo test -p evm2-cli --test replay_parity— zero mismatches across 2279 transactions; also run withEVM2_DISPATCH_BACKEND=packedEVM2_BENCH_REVM=1 cargo bench -p evm2-cli --bench evm -- mainnetcargo fmt --all --check;cargo clippy -p evm2-cli -p evm2 --all-targetsandcargo doc -p evm2-cli --no-deps --document-private-itemswith zero warnings;cargo test -p evm2-cli