Skip to content

test(seismic): re-enable E2E testsuite module#339

Merged
ameya-deshmukh merged 17 commits intoseismicfrom
ameya/re-enable-e2e-testsuite
Mar 23, 2026
Merged

test(seismic): re-enable E2E testsuite module#339
ameya-deshmukh merged 17 commits intoseismicfrom
ameya/re-enable-e2e-testsuite

Conversation

@ameya-deshmukh
Copy link
Copy Markdown
Contributor

@ameya-deshmukh ameya-deshmukh commented Mar 18, 2026

Summary

Re-enables the commented-out mod testsuite in seismic E2E tests and fixes compilation errors that accumulated since it was disabled.

Changes

crates/seismic/node/tests/e2e/main.rs:

  • Uncomments mod testsuite;
  • Adds clippy::unwrap_used, clippy::expect_used allows (standard for test files)

crates/seismic/node/tests/e2e/testsuite.rs:

  • Fix import paths: SeismicEngineTypes/SeismicNode moved to engine/node submodules
  • Use SEISMIC_MAINNET.clone() directly instead of ChainSpecBuilder + missing genesis.json asset
  • Flatten PayloadAttributes to match current SeismicEngineTypes (was using old nested Optimism-style wrapper)
  • Set post-Cancun required fields: withdrawals: Some(vec![]), parent_beacon_block_root: Some(B256::ZERO)
  • Rename test_testsuite_op_assert_mine_blocktest_testsuite_seismic_assert_mine_block
  • Change expected hash from Some(B256::ZERO)None (block hash can't be predicted)
  • Extract SEISMIC_TIMESTAMP_MULTIPLIER constant to replace magic number 1000

Test plan

  • cargo clippy -p reth-seismic-node --tests --no-deps passes
  • cargo +nightly fmt --all clean
  • CI passes

🤖 Generated with Claude Code

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
@ameya-deshmukh ameya-deshmukh requested a review from cdrappi as a code owner March 18, 2026 17:42
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

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 ameya-deshmukh merged commit 7990607 into seismic Mar 23, 2026
14 of 15 checks passed
@ameya-deshmukh ameya-deshmukh deleted the ameya/re-enable-e2e-testsuite branch March 23, 2026 15:53
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant