Skip to content

test: compare state roots first in expectEqualBeaconState - #9711

Open
ensi321 wants to merge 5 commits into
unstablefrom
nc/spec-test-harness-fixes
Open

test: compare state roots first in expectEqualBeaconState#9711
ensi321 wants to merge 5 commits into
unstablefrom
nc/spec-test-harness-fixes

Conversation

@ensi321

@ensi321 ensi321 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Motivation

Port of two outstanding spec-test-harness improvements from the glamsterdam-devnet-7 branch (#9587) that never landed on unstable.

expectEqualBeaconState always materialized both states with toValue() 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/slots cases with the mainnet preset can exceed the 30s vitest timeout.

Description

  • expectEqualBeaconState: compare hashTreeRoot() first and return early on match; on mismatch, fall back to root-based assertion if toValue()/toJson() throws so the test fails with the root diff instead of a serialization error
  • sanity.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

nflaig added 2 commits July 24, 2026 18:34
(cherry picked from commit 1dc0674)
(cherry picked from commit 755cf67)
@ensi321
ensi321 requested a review from a team as a code owner July 25, 2026 02:15
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Performance Report

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 09732f3 Previous: d9bad17 Ratio
proposeBlockBody type=full, size=empty 585.87 us/op 3.3363 ms/op 0.18
Full benchmark results
Benchmark suite Current: 09732f3 Previous: d9bad17 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 912.25 us/op 1.5357 ms/op 0.59
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 40.675 us/op 42.430 us/op 0.96
BLS verify - blst 666.36 us/op 778.80 us/op 0.86
BLS verifyMultipleSignatures 3 - blst 1.3841 ms/op 1.3870 ms/op 1.00
BLS verifyMultipleSignatures 8 - blst 2.2051 ms/op 2.2070 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst 7.0311 ms/op 6.8859 ms/op 1.02
BLS verifyMultipleSignatures 64 - blst 14.133 ms/op 14.018 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 26.025 ms/op 25.775 ms/op 1.01
BLS deserializing 10000 signatures 654.52 ms/op 656.99 ms/op 1.00
BLS deserializing 100000 signatures 6.5042 s/op 6.4365 s/op 1.01
BLS verifyMultipleSignatures - same message - 3 - blst 818.23 us/op 771.49 us/op 1.06
BLS verifyMultipleSignatures - same message - 8 - blst 925.48 us/op 977.53 us/op 0.95
BLS verifyMultipleSignatures - same message - 32 - blst 1.5804 ms/op 1.5284 ms/op 1.03
BLS verifyMultipleSignatures - same message - 64 - blst 2.3903 ms/op 2.4103 ms/op 0.99
BLS verifyMultipleSignatures - same message - 128 - blst 4.0155 ms/op 4.0177 ms/op 1.00
BLS aggregatePubkeys 32 - blst 17.659 us/op 18.046 us/op 0.98
BLS aggregatePubkeys 128 - blst 63.178 us/op 63.964 us/op 0.99
getSlashingsAndExits - default max 47.982 us/op 61.685 us/op 0.78
getSlashingsAndExits - 2k 324.04 us/op 403.22 us/op 0.80
proposeBlockBody type=full, size=empty 585.87 us/op 3.3363 ms/op 0.18
isKnown best case - 1 super set check 161.00 ns/op 168.00 ns/op 0.96
isKnown normal case - 2 super set checks 158.00 ns/op 166.00 ns/op 0.95
isKnown worse case - 16 super set checks 157.00 ns/op 171.00 ns/op 0.92
validate api signedAggregateAndProof - struct 1.5225 ms/op 1.5741 ms/op 0.97
validate gossip signedAggregateAndProof - struct 1.5344 ms/op 1.5677 ms/op 0.98
batch validate gossip attestation - vc 640000 - chunk 32 110.18 us/op 117.70 us/op 0.94
batch validate gossip attestation - vc 640000 - chunk 64 97.476 us/op 107.27 us/op 0.91
batch validate gossip attestation - vc 640000 - chunk 128 88.745 us/op 99.510 us/op 0.89
batch validate gossip attestation - vc 640000 - chunk 256 82.056 us/op 102.86 us/op 0.80
bytes32 toHexString 287.00 ns/op 329.00 ns/op 0.87
bytes32 Buffer.toString(hex) 166.00 ns/op 184.00 ns/op 0.90
bytes32 Buffer.toString(hex) from Uint8Array 254.00 ns/op 251.00 ns/op 1.01
bytes32 Buffer.toString(hex) + 0x 167.00 ns/op 183.00 ns/op 0.91
Return object 10000 times 0.21370 ns/op 0.21650 ns/op 0.99
Throw Error 10000 times 3.2885 us/op 3.5494 us/op 0.93
toHex 104.10 ns/op 102.64 ns/op 1.01
Buffer.from 89.875 ns/op 92.488 ns/op 0.97
shared Buffer 62.835 ns/op 64.609 ns/op 0.97
fastMsgIdFn sha256 / 200 bytes 1.4870 us/op 1.5110 us/op 0.98
fastMsgIdFn h32 xxhash / 200 bytes 171.00 ns/op 163.00 ns/op 1.05
fastMsgIdFn h64 xxhash / 200 bytes 216.00 ns/op 214.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 4.7650 us/op 4.8210 us/op 0.99
fastMsgIdFn h32 xxhash / 1000 bytes 256.00 ns/op 254.00 ns/op 1.01
fastMsgIdFn h64 xxhash / 1000 bytes 266.00 ns/op 263.00 ns/op 1.01
fastMsgIdFn sha256 / 10000 bytes 41.951 us/op 42.631 us/op 0.98
fastMsgIdFn h32 xxhash / 10000 bytes 1.2670 us/op 1.3140 us/op 0.96
fastMsgIdFn h64 xxhash / 10000 bytes 816.00 ns/op 850.00 ns/op 0.96
send data - 1000 256B messages 4.0205 ms/op 5.3168 ms/op 0.76
send data - 1000 512B messages 5.1860 ms/op 6.0152 ms/op 0.86
send data - 1000 1024B messages 5.6196 ms/op 6.4298 ms/op 0.87
send data - 1000 1200B messages 6.4636 ms/op 7.5666 ms/op 0.85
send data - 1000 2048B messages 13.921 ms/op 15.105 ms/op 0.92
send data - 1000 4096B messages 95.976 ms/op 72.079 ms/op 1.33
send data - 1000 16384B messages 257.30 ms/op 429.87 ms/op 0.60
send data - 1000 65536B messages 1.1267 s/op 1.8742 s/op 0.60
enrSubnets - fastDeserialize 64 bits 712.00 ns/op 784.00 ns/op 0.91
enrSubnets - ssz BitVector 64 bits 271.00 ns/op 275.00 ns/op 0.99
enrSubnets - fastDeserialize 4 bits 102.00 ns/op 107.00 ns/op 0.95
enrSubnets - ssz BitVector 4 bits 280.00 ns/op 279.00 ns/op 1.00
prioritizePeers score -10:0 att 32-0.1 sync 2-0 199.82 us/op 209.27 us/op 0.95
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 228.15 us/op 238.84 us/op 0.96
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 333.42 us/op 363.27 us/op 0.92
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 596.88 us/op 614.01 us/op 0.97
prioritizePeers score 0:0 att 64-1 sync 4-1 697.07 us/op 721.40 us/op 0.97
array of 16000 items push then shift 1.3121 us/op 1.3356 us/op 0.98
LinkedList of 16000 items push then shift 7.0270 ns/op 7.2770 ns/op 0.97
array of 16000 items push then pop 64.071 ns/op 86.969 ns/op 0.74
LinkedList of 16000 items push then pop 6.0290 ns/op 6.0900 ns/op 0.99
array of 24000 items push then shift 1.9331 us/op 1.9544 us/op 0.99
LinkedList of 24000 items push then shift 6.6760 ns/op 6.8880 ns/op 0.97
array of 24000 items push then pop 91.344 ns/op 118.89 ns/op 0.77
LinkedList of 24000 items push then pop 5.9150 ns/op 6.0760 ns/op 0.97
intersect bitArray bitLen 8 3.8940 ns/op 3.9620 ns/op 0.98
intersect array and set length 8 29.671 ns/op 31.394 ns/op 0.95
intersect bitArray bitLen 128 23.306 ns/op 23.478 ns/op 0.99
intersect array and set length 128 496.76 ns/op 514.63 ns/op 0.97
bitArray.getTrueBitIndexes() bitLen 128 922.00 ns/op 960.00 ns/op 0.96
bitArray.getTrueBitIndexes() bitLen 248 1.6760 us/op 1.7070 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 512 3.4940 us/op 3.5480 us/op 0.98
Full columns - reconstruct all 6 blobs 339.20 us/op 176.10 us/op 1.93
Full columns - reconstruct half of the blobs out of 6 176.94 us/op 75.266 us/op 2.35
Full columns - reconstruct single blob out of 6 34.476 us/op 37.801 us/op 0.91
Half columns - reconstruct all 6 blobs 382.57 ms/op 406.78 ms/op 0.94
Half columns - reconstruct half of the blobs out of 6 191.52 ms/op 204.66 ms/op 0.94
Half columns - reconstruct single blob out of 6 66.558 ms/op 72.816 ms/op 0.91
Set add up to 64 items then delete first 1.6621 us/op 1.6873 us/op 0.99
OrderedSet add up to 64 items then delete first 2.5109 us/op 2.5416 us/op 0.99
Set add up to 64 items then delete last 1.8903 us/op 1.8832 us/op 1.00
OrderedSet add up to 64 items then delete last 2.7738 us/op 2.9766 us/op 0.93
Set add up to 64 items then delete middle 1.8793 us/op 1.9585 us/op 0.96
OrderedSet add up to 64 items then delete middle 4.2416 us/op 4.5005 us/op 0.94
Set add up to 128 items then delete first 3.7432 us/op 3.7319 us/op 1.00
OrderedSet add up to 128 items then delete first 5.7341 us/op 6.0253 us/op 0.95
Set add up to 128 items then delete last 3.5902 us/op 3.7051 us/op 0.97
OrderedSet add up to 128 items then delete last 5.3595 us/op 5.6765 us/op 0.94
Set add up to 128 items then delete middle 3.6182 us/op 3.6986 us/op 0.98
OrderedSet add up to 128 items then delete middle 11.193 us/op 11.884 us/op 0.94
Set add up to 256 items then delete first 7.3783 us/op 7.7746 us/op 0.95
OrderedSet add up to 256 items then delete first 11.508 us/op 12.002 us/op 0.96
Set add up to 256 items then delete last 7.1659 us/op 7.8427 us/op 0.91
OrderedSet add up to 256 items then delete last 10.999 us/op 12.380 us/op 0.89
Set add up to 256 items then delete middle 7.0954 us/op 7.3774 us/op 0.96
OrderedSet add up to 256 items then delete middle 34.380 us/op 36.513 us/op 0.94
runFastConfirmationRules vc:100000 bc:96 eq:0 4.5627 ms/op 4.8997 ms/op 0.93
runFastConfirmationRules vc:600000 bc:96 eq:0 35.246 ms/op 38.376 ms/op 0.92
runFastConfirmationRules vc:1000000 bc:96 eq:0 56.888 ms/op 62.476 ms/op 0.91
runFastConfirmationRules vc:600000 bc:320 eq:0 34.062 ms/op 38.176 ms/op 0.89
runFastConfirmationRules vc:100000 bc:96 eq:1000 1.1053 s/op 1.1503 s/op 0.96
pass gossip attestations to forkchoice per slot 2.6003 ms/op 2.6056 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 431.12 us/op 476.16 us/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 0 2.5830 ms/op 2.8066 ms/op 0.92
forkChoice updateHead vc 1000000 bc 64 eq 0 4.1948 ms/op 4.6650 ms/op 0.90
forkChoice updateHead vc 600000 bc 320 eq 0 2.5668 ms/op 2.9155 ms/op 0.88
forkChoice updateHead vc 600000 bc 1200 eq 0 2.6483 ms/op 2.9452 ms/op 0.90
forkChoice updateHead vc 600000 bc 7200 eq 0 2.8785 ms/op 3.2614 ms/op 0.88
forkChoice updateHead vc 600000 bc 64 eq 1000 2.5923 ms/op 2.9707 ms/op 0.87
forkChoice updateHead vc 600000 bc 64 eq 10000 2.8002 ms/op 3.0749 ms/op 0.91
forkChoice updateHead vc 600000 bc 64 eq 300000 6.5757 ms/op 7.2617 ms/op 0.91
computeDeltas 1400000 validators 0% inactive 12.372 ms/op 13.419 ms/op 0.92
computeDeltas 1400000 validators 10% inactive 11.728 ms/op 12.755 ms/op 0.92
computeDeltas 1400000 validators 20% inactive 11.114 ms/op 11.946 ms/op 0.93
computeDeltas 1400000 validators 50% inactive 8.9778 ms/op 9.7606 ms/op 0.92
computeDeltas 2100000 validators 0% inactive 18.933 ms/op 20.099 ms/op 0.94
computeDeltas 2100000 validators 10% inactive 17.682 ms/op 19.098 ms/op 0.93
computeDeltas 2100000 validators 20% inactive 16.829 ms/op 18.066 ms/op 0.93
computeDeltas 2100000 validators 50% inactive 11.078 ms/op 14.610 ms/op 0.76
altair processAttestation - 250000 vs - 7PWei normalcase 1.7555 ms/op 1.7436 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei worstcase 2.4852 ms/op 2.4694 ms/op 1.01
altair processAttestation - setStatus - 1/6 committees join 103.79 us/op 113.79 us/op 0.91
altair processAttestation - setStatus - 1/3 committees join 195.93 us/op 211.41 us/op 0.93
altair processAttestation - setStatus - 1/2 committees join 278.23 us/op 308.81 us/op 0.90
altair processAttestation - setStatus - 2/3 committees join 382.67 us/op 390.45 us/op 0.98
altair processAttestation - setStatus - 4/5 committees join 506.71 us/op 580.54 us/op 0.87
altair processAttestation - setStatus - 100% committees join 601.23 us/op 648.27 us/op 0.93
altair processBlock - 250000 vs - 7PWei normalcase 2.7894 ms/op 3.1519 ms/op 0.88
altair processBlock - 250000 vs - 7PWei normalcase hashState 14.112 ms/op 15.192 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase 19.955 ms/op 21.053 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 38.552 ms/op 40.199 ms/op 0.96
phase0 processBlock - 250000 vs - 7PWei normalcase 1.2717 ms/op 1.3784 ms/op 0.92
phase0 processBlock - 250000 vs - 7PWei worstcase 16.415 ms/op 17.862 ms/op 0.92
altair processEth1Data - 250000 vs - 7PWei normalcase 296.29 us/op 308.23 us/op 0.96
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 4.3670 us/op 3.5680 us/op 1.22
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 21.813 us/op 22.690 us/op 0.96
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 6.8800 us/op 6.5520 us/op 1.05
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 4.9590 us/op 4.0390 us/op 1.23
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 98.869 us/op 93.196 us/op 1.06
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3843 ms/op 1.4735 ms/op 0.94
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.9008 ms/op 1.9621 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8622 ms/op 1.9362 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7480 ms/op 3.8276 ms/op 0.98
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.0733 ms/op 2.1683 ms/op 0.96
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0021 ms/op 4.0745 ms/op 0.98
Tree 40 250000 create 312.48 ms/op 333.61 ms/op 0.94
Tree 40 250000 get(125000) 117.49 ns/op 107.13 ns/op 1.10
Tree 40 250000 set(125000) 1.0500 us/op 1.0982 us/op 0.96
Tree 40 250000 toArray() 9.0070 ms/op 10.714 ms/op 0.84
Tree 40 250000 iterate all - toArray() + loop 9.0520 ms/op 11.978 ms/op 0.76
Tree 40 250000 iterate all - get(i) 34.985 ms/op 39.718 ms/op 0.88
Array 250000 create 1.9912 ms/op 2.6373 ms/op 0.76
Array 250000 clone - spread 648.72 us/op 698.77 us/op 0.93
Array 250000 get(125000) 0.29300 ns/op 0.29500 ns/op 0.99
Array 250000 set(125000) 0.29700 ns/op 0.30200 ns/op 0.98
Array 250000 iterate all - loop 57.112 us/op 57.119 us/op 1.00
phase0 afterProcessEpoch - 250000 vs - 7PWei 49.286 ms/op 41.745 ms/op 1.18
Array.fill - length 1000000 2.2208 ms/op 2.6801 ms/op 0.83
Array push - length 1000000 7.5215 ms/op 9.2017 ms/op 0.82
Array.get 0.20683 ns/op 0.20539 ns/op 1.01
Uint8Array.get 0.24638 ns/op 0.27283 ns/op 0.90
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.386 ms/op 14.434 ms/op 1.00
altair processEpoch - mainnet_e81889 237.21 ms/op 273.09 ms/op 0.87
mainnet_e81889 - altair beforeProcessEpoch 18.875 ms/op 14.091 ms/op 1.34
mainnet_e81889 - altair processJustificationAndFinalization 4.9990 us/op 5.3880 us/op 0.93
mainnet_e81889 - altair processInactivityUpdates 3.4640 ms/op 3.6902 ms/op 0.94
mainnet_e81889 - altair processRewardsAndPenalties 17.191 ms/op 17.772 ms/op 0.97
mainnet_e81889 - altair processRegistryUpdates 571.00 ns/op 550.00 ns/op 1.04
mainnet_e81889 - altair processSlashings 151.00 ns/op 144.00 ns/op 1.05
mainnet_e81889 - altair processEth1DataReset 153.00 ns/op 137.00 ns/op 1.12
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.6586 ms/op 1.8072 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 705.00 ns/op 694.00 ns/op 1.02
mainnet_e81889 - altair processRandaoMixesReset 1.2520 us/op 1.0950 us/op 1.14
mainnet_e81889 - altair processHistoricalRootsUpdate 144.00 ns/op 142.00 ns/op 1.01
mainnet_e81889 - altair processParticipationFlagUpdates 451.00 ns/op 448.00 ns/op 1.01
mainnet_e81889 - altair processSyncCommitteeUpdates 117.00 ns/op 117.00 ns/op 1.00
mainnet_e81889 - altair afterProcessEpoch 41.100 ms/op 41.980 ms/op 0.98
capella processEpoch - mainnet_e217614 734.97 ms/op 750.11 ms/op 0.98
mainnet_e217614 - capella beforeProcessEpoch 55.773 ms/op 57.925 ms/op 0.96
mainnet_e217614 - capella processJustificationAndFinalization 5.5140 us/op 5.8830 us/op 0.94
mainnet_e217614 - capella processInactivityUpdates 11.490 ms/op 12.110 ms/op 0.95
mainnet_e217614 - capella processRewardsAndPenalties 87.250 ms/op 94.865 ms/op 0.92
mainnet_e217614 - capella processRegistryUpdates 4.4630 us/op 4.4710 us/op 1.00
mainnet_e217614 - capella processSlashings 140.00 ns/op 145.00 ns/op 0.97
mainnet_e217614 - capella processEth1DataReset 137.00 ns/op 142.00 ns/op 0.96
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.9681 ms/op 5.5361 ms/op 1.08
mainnet_e217614 - capella processSlashingsReset 692.00 ns/op 678.00 ns/op 1.02
mainnet_e217614 - capella processRandaoMixesReset 1.0580 us/op 1.1800 us/op 0.90
mainnet_e217614 - capella processHistoricalRootsUpdate 135.00 ns/op 143.00 ns/op 0.94
mainnet_e217614 - capella processParticipationFlagUpdates 449.00 ns/op 437.00 ns/op 1.03
mainnet_e217614 - capella afterProcessEpoch 109.62 ms/op 106.16 ms/op 1.03
phase0 processEpoch - mainnet_e58758 257.94 ms/op 265.36 ms/op 0.97
mainnet_e58758 - phase0 beforeProcessEpoch 49.704 ms/op 51.006 ms/op 0.97
mainnet_e58758 - phase0 processJustificationAndFinalization 5.3850 us/op 5.1520 us/op 1.05
mainnet_e58758 - phase0 processRewardsAndPenalties 15.324 ms/op 16.358 ms/op 0.94
mainnet_e58758 - phase0 processRegistryUpdates 2.3110 us/op 2.2680 us/op 1.02
mainnet_e58758 - phase0 processSlashings 141.00 ns/op 143.00 ns/op 0.99
mainnet_e58758 - phase0 processEth1DataReset 143.00 ns/op 137.00 ns/op 1.04
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 833.05 us/op 1.0499 ms/op 0.79
mainnet_e58758 - phase0 processSlashingsReset 822.00 ns/op 808.00 ns/op 1.02
mainnet_e58758 - phase0 processRandaoMixesReset 1.1800 us/op 1.1200 us/op 1.05
mainnet_e58758 - phase0 processHistoricalRootsUpdate 148.00 ns/op 139.00 ns/op 1.06
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.0300 us/op 1.0220 us/op 1.99
mainnet_e58758 - phase0 afterProcessEpoch 33.765 ms/op 32.061 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.1067 ms/op 1.1143 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.6587 ms/op 1.6510 ms/op 1.00
altair processInactivityUpdates - 250000 normalcase 10.536 ms/op 10.697 ms/op 0.98
altair processInactivityUpdates - 250000 worstcase 10.603 ms/op 10.713 ms/op 0.99
phase0 processRegistryUpdates - 250000 normalcase 2.4980 us/op 2.4620 us/op 1.01
phase0 processRegistryUpdates - 250000 badcase_full_deposits 151.38 us/op 150.01 us/op 1.01
phase0 processRegistryUpdates - 250000 worstcase 0.5 56.915 ms/op 54.297 ms/op 1.05
altair processRewardsAndPenalties - 250000 normalcase 13.252 ms/op 14.477 ms/op 0.92
altair processRewardsAndPenalties - 250000 worstcase 13.143 ms/op 14.428 ms/op 0.91
phase0 getAttestationDeltas - 250000 normalcase 5.3817 ms/op 5.6428 ms/op 0.95
phase0 getAttestationDeltas - 250000 worstcase 5.4244 ms/op 8.6636 ms/op 0.63
phase0 processSlashings - 250000 worstcase 62.092 us/op 62.258 us/op 1.00
altair processSyncCommitteeUpdates - 250000 10.138 ms/op 10.315 ms/op 0.98
BeaconState.hashTreeRoot - No change 174.00 ns/op 176.00 ns/op 0.99
BeaconState.hashTreeRoot - 1 full validator 56.182 us/op 75.568 us/op 0.74
BeaconState.hashTreeRoot - 32 full validator 623.98 us/op 741.69 us/op 0.84
BeaconState.hashTreeRoot - 512 full validator 5.8826 ms/op 7.9766 ms/op 0.74
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 69.968 us/op 96.308 us/op 0.73
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.0137 ms/op 1.4466 ms/op 0.70
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.203 ms/op 15.101 ms/op 0.81
BeaconState.hashTreeRoot - 1 balances 52.407 us/op 87.776 us/op 0.60
BeaconState.hashTreeRoot - 32 balances 530.08 us/op 761.51 us/op 0.70
BeaconState.hashTreeRoot - 512 balances 4.5880 ms/op 6.9732 ms/op 0.66
BeaconState.hashTreeRoot - 250000 balances 86.610 ms/op 124.53 ms/op 0.70
aggregationBits - 2048 els - zipIndexesInBitList 18.896 us/op 21.314 us/op 0.89
regular array get 100000 times 23.022 us/op 22.997 us/op 1.00
wrappedArray get 100000 times 22.974 us/op 23.075 us/op 1.00
arrayWithProxy get 100000 times 10.324 ms/op 14.376 ms/op 0.72
ssz.Root.equals 21.723 ns/op 21.461 ns/op 1.01
byteArrayEquals 21.511 ns/op 21.328 ns/op 1.01
Buffer.compare 8.9330 ns/op 9.3300 ns/op 0.96
processSlot - 1 slots 7.9350 us/op 9.3820 us/op 0.85
processSlot - 32 slots 1.5138 ms/op 1.6525 ms/op 0.92
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 3.2828 ms/op 2.7091 ms/op 1.21
getCommitteeAssignments - req 1 vs - 250000 vc 1.6774 ms/op 1.6921 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.4413 ms/op 3.4419 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7041 ms/op 3.7025 ms/op 1.00
findModifiedValidators - 10000 modified validators 655.67 ms/op 771.36 ms/op 0.85
findModifiedValidators - 1000 modified validators 494.51 ms/op 606.08 ms/op 0.82
findModifiedValidators - 100 modified validators 299.64 ms/op 304.67 ms/op 0.98
findModifiedValidators - 10 modified validators 235.56 ms/op 246.72 ms/op 0.95
findModifiedValidators - 1 modified validators 165.24 ms/op 187.27 ms/op 0.88
findModifiedValidators - no difference 142.62 ms/op 195.64 ms/op 0.73
migrate state 1500000 validators, 3400 modified, 2000 new 2.6000 s/op 3.3940 s/op 0.77
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.7600 ns/op 3.7400 ns/op 1.01
state getBlockRootAtSlot - 250000 vs - 7PWei 395.67 ns/op 386.45 ns/op 1.02
computeProposerIndex 100000 validators 1.3381 ms/op 1.3539 ms/op 0.99
getNextSyncCommitteeIndices 1000 validators 2.9003 ms/op 2.8960 ms/op 1.00
getNextSyncCommitteeIndices 10000 validators 25.344 ms/op 25.632 ms/op 0.99
getNextSyncCommitteeIndices 100000 validators 87.460 ms/op 90.896 ms/op 0.96
computeProposers - vc 250000 549.54 us/op 553.34 us/op 0.99
computeEpochShuffling - vc 250000 39.570 ms/op 39.997 ms/op 0.99
getNextSyncCommittee - vc 250000 9.3772 ms/op 10.350 ms/op 0.91
nodejs block root to RootHex using toHex 101.99 ns/op 104.68 ns/op 0.97
nodejs block root to RootHex using toRootHex 67.278 ns/op 66.650 ns/op 1.01
nodejs fromHex(blob) 729.44 us/op 778.37 us/op 0.94
nodejs fromHexInto(blob) 637.21 us/op 662.32 us/op 0.96
nodejs block root to RootHex using the deprecated toHexString 472.89 ns/op 552.46 ns/op 0.86
nodejs byteArrayEquals 32 bytes (block root) 26.013 ns/op 25.505 ns/op 1.02
nodejs byteArrayEquals 48 bytes (pubkey) 37.644 ns/op 36.861 ns/op 1.02
nodejs byteArrayEquals 96 bytes (signature) 37.957 ns/op 40.496 ns/op 0.94
nodejs byteArrayEquals 1024 bytes 45.848 ns/op 43.135 ns/op 1.06
nodejs byteArrayEquals 131072 bytes (blob) 1.7655 us/op 1.7458 us/op 1.01
browser block root to RootHex using toHex 145.51 ns/op 146.70 ns/op 0.99
browser block root to RootHex using toRootHex 130.50 ns/op 130.65 ns/op 1.00
browser fromHex(blob) 1.5451 ms/op 1.6145 ms/op 0.96
browser fromHexInto(blob) 638.80 us/op 689.93 us/op 0.93
browser block root to RootHex using the deprecated toHexString 330.25 ns/op 404.23 ns/op 0.82
browser byteArrayEquals 32 bytes (block root) 27.969 ns/op 28.258 ns/op 0.99
browser byteArrayEquals 48 bytes (pubkey) 39.437 ns/op 40.122 ns/op 0.98
browser byteArrayEquals 96 bytes (signature) 73.903 ns/op 78.974 ns/op 0.94
browser byteArrayEquals 1024 bytes 750.57 ns/op 795.96 ns/op 0.94
browser byteArrayEquals 131072 bytes (blob) 94.822 us/op 100.76 us/op 0.94

by benchmarkbot/action

Comment thread packages/beacon-node/test/spec/presets/sanity.test.ts Outdated
twoeths
twoeths previously approved these changes Jul 30, 2026
Comment thread packages/beacon-node/test/spec/presets/sanity.test.ts Outdated
Comment thread packages/beacon-node/test/spec/presets/sanity.test.ts Outdated
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Comment thread packages/beacon-node/test/spec/presets/sanity.test.ts Outdated
Comment thread packages/beacon-node/test/spec/presets/sanity.test.ts Outdated
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
@nflaig

nflaig commented Aug 4, 2026

Copy link
Copy Markdown
Member

@lodekeeper please review this, is it useful?

@nflaig nflaig changed the title test: compare state roots first in expectEqualBeaconState and bump gloas sanity timeout test: compare state roots first in expectEqualBeaconState Aug 4, 2026
@lodekeeper

Copy link
Copy Markdown
Contributor

@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 / a6bf1cadac by restoring timeout: 30000 and keeping the slow post-Gloas historical_accumulator sanity slot cases skipped while the runtime issue is investigated separately.

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 nflaig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

this needs to be revisited, something here is not right

@lodekeeper

Copy link
Copy Markdown
Contributor

@nflaig confirmed, the screenshot is the Spec tests (24) failure. The current failing case is still:

spec-mainnet test/spec/presets/sanity.test.ts > gloas/sanity/slots/pyspec_tests > gloas/sanity/slots/pyspec_tests/historical_accumulator

CI timed it out at the existing 30000ms limit, with Vitest reporting that case at 36915ms and the job ending as 1 failed | 7237 passed | 23 skipped.

I also rechecked the latest PR diff after refreshing unstable: the net diff is only packages/beacon-node/test/spec/utils/expectEqualBeaconState.ts. The earlier fork-specific timeout/import changes are gone. So this root precheck may still be useful as a harness optimization/diagnostic fallback for equal states, but it does not fix the failing mainnet Gloas sanity case as-is. The failure is still the slow post-Gloas historical_accumulator path hitting the normal timeout.

My recommendation: don't treat #9711 as the fix for the spec-test failure. If we want this PR green, keep timeout: 30000 and re-skip that slow mainnet Gloas historical_accumulator sanity slot case while we investigate the actual runtime issue separately. If the expectEqualBeaconState root precheck is worth keeping, I would frame/merge it separately from the timeout failure.

I did not push to ChainSafe:nc/spec-test-harness-fixes since this is not my branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants