test(seismic): re-enable E2E testsuite module#339
Merged
ameya-deshmukh merged 17 commits intoseismicfrom Mar 23, 2026
Merged
Conversation
Uncomment mod testsuite in seismic E2E tests and fix compilation: - Fix import path: SeismicEngineTypes/SeismicNode from submodules - Use SEISMIC_MAINNET directly instead of ChainSpecBuilder - Flatten PayloadAttributes to match current SeismicEngineTypes - Set post-Cancun fields (withdrawals, parent_beacon_block_root) - Rename test to test_testsuite_seismic_assert_mine_block
Contributor
|
Refactors testsuite test from old framework to setup_engine with proper Seismic timestamp handling and mock purpose keys. LGTM |
The Seismic node requires purpose keys to be initialized before startup. The testsuite framework runs the node in-process (unlike integration tests which spawn a binary), so init_purpose_keys must be called explicitly with mock keys.
Replace catch_unwind with Once::call_once to ensure mock purpose keys are initialized exactly once per test binary. This is cleaner and matches the OnceLock pattern used in the purpose_keys module itself.
Uncomment mod testsuite in seismic E2E tests and fix compilation: - Fix import path: SeismicEngineTypes/SeismicNode from submodules - Use SEISMIC_MAINNET directly instead of ChainSpecBuilder - Flatten PayloadAttributes to match current SeismicEngineTypes - Set post-Cancun fields (withdrawals, parent_beacon_block_root) - Rename test to test_testsuite_seismic_assert_mine_block
The Seismic node requires purpose keys to be initialized before startup. The testsuite framework runs the node in-process (unlike integration tests which spawn a binary), so init_purpose_keys must be called explicitly with mock keys.
Replace catch_unwind with Once::call_once to ensure mock purpose keys are initialized exactly once per test binary. This is cleaner and matches the OnceLock pattern used in the purpose_keys module itself.
AssertMineBlock uses forkchoiceUpdatedV2 which rejects parent_beacon_block_root. Set it to None to match the V2 API.
AssertMineBlock uses forkchoiceUpdatedV2 which returns "Unsupported fork" on Cancun-active chain specs. Switch to ProduceBlocks which uses V3 engine API and is compatible with SEISMIC_MAINNET.
Block hash mismatch in new_payload_v3 — same node builds and validates but hashes differ. Added detailed debug codepath comments tracing: 1. Payload build (seismic builder, flagged storage state root) 2. Payload broadcast (engine API v3) 3. Engine tree validation (re-execution and hash comparison) 4. Likely mismatch point (ExecutionPayload round-trip) Run with RUST_LOG=engine::tree=debug,rpc::engine=debug to investigate.
Root cause identified: Prague is active at genesis in SEISMIC_MAINNET (line 53 of hardforks/src/lib.rs), which adds requests_hash to block headers. ProduceBlocks uses V3 engine API which doesn't carry requests_hash, causing block_hash mismatch on round-trip. Fix: use V4 engine API (supports Prague) or update testsuite framework. Added debug tracing to: - SeismicPayloadTypes::block_to_payload (header fields before/after conversion) - SeismicEngineValidator::ensure_well_formed_payload (incoming vs reconstructed)
…locks Root cause of block hash mismatch: Prague is active at genesis in SEISMIC_MAINNET, adding requests_hash to headers. ProduceBlocks uses V3 engine API which strips requests_hash, causing hash mismatch. Rewrote test to use setup + advance_block pattern. Currently ignored because wait_for_built_payload hangs — needs further investigation.
Use setup_engine (like PR4 p2p test) instead of setup. Rewrite test to use advance_block with proper nonce tracking instead of ProduceBlocks (V3 engine API incompatible with Prague).
SEISMIC_DEV stores timestamps in milliseconds (genesis.timestamp *= 1000) but the test framework passes seconds. The payload builder was creating blocks with second-precision timestamps that were in the past relative to the millisecond-precision genesis timestamp.
Remove debug tracing from engine.rs and simplify testsuite.rs to a clean block production test using setup_engine + advance_block.
Replace magic number 1000 with a named constant to clarify that Seismic uses millisecond timestamps.
ameya-deshmukh
added a commit
that referenced
this pull request
Mar 23, 2026
Enable both p2p and testsuite modules after merging latest seismic which includes the testsuite re-enablement from #339.
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
Re-enables the commented-out
mod testsuitein seismic E2E tests and fixes compilation errors that accumulated since it was disabled.Changes
crates/seismic/node/tests/e2e/main.rs:mod testsuite;clippy::unwrap_used,clippy::expect_usedallows (standard for test files)crates/seismic/node/tests/e2e/testsuite.rs:SeismicEngineTypes/SeismicNodemoved toengine/nodesubmodulesSEISMIC_MAINNET.clone()directly instead ofChainSpecBuilder+ missing genesis.json assetPayloadAttributesto match currentSeismicEngineTypes(was using old nested Optimism-style wrapper)withdrawals: Some(vec![]),parent_beacon_block_root: Some(B256::ZERO)test_testsuite_op_assert_mine_block→test_testsuite_seismic_assert_mine_blockSome(B256::ZERO)→None(block hash can't be predicted)SEISMIC_TIMESTAMP_MULTIPLIERconstant to replace magic number 1000Test plan
cargo clippy -p reth-seismic-node --tests --no-depspassescargo +nightly fmt --allclean🤖 Generated with Claude Code