test: compare state roots first in expectEqualBeaconState - #9711
Conversation
Performance Report🚀🚀 Significant benchmark improvement detected
Full benchmark results
|
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
|
@lodekeeper please review this, is it useful? |
|
@nflaig reviewed. My take: the timeout bump is not useful as-is and should not be the path forward. I handled the equivalent change in #9763 / So for this PR, I would drop the fork-specific timeout/import changes and keep the tests skipped for now rather than merging the longer timeout. |
|
@nflaig confirmed, the screenshot is the
CI timed it out at the existing I also rechecked the latest PR diff after refreshing My recommendation: don't treat #9711 as the fix for the spec-test failure. If we want this PR green, keep I did not push to |

Motivation
Port of two outstanding spec-test-harness improvements from the
glamsterdam-devnet-7branch (#9587) that never landed onunstable.expectEqualBeaconStatealways materialized both states withtoValue()even when they matched, which is slow for large gloas states and throws opaquely if a progressive-container view fails to materialize — masking the actual state mismatch. Separately,gloas/sanity/slotscases with the mainnet preset can exceed the 30s vitest timeout.Description
expectEqualBeaconState: comparehashTreeRoot()first and return early on match; on mismatch, fall back to root-based assertion iftoValue()/toJson()throws so the test fails with the root diff instead of a serialization errorsanity.test.ts: 60s timeout for gloas + mainnet preset (other forks/presets keep 30s)Cherry-picked from
glamsterdam-devnet-7(1dc0674, 755cf67, original author @nflaig); applied without conflicts.AI Assistance Disclosure
Cherry-pick selection and verification done with AI assistance (Claude Code); original commits authored by @nflaig on the devnet-7 branch.
🤖 Generated with Claude Code