Skip to content

feat: add unknown payload envelope sync flow#9241

Open
wemeetagain wants to merge 6 commits intounstablefrom
cayman/recover-pruned-payload-inputs
Open

feat: add unknown payload envelope sync flow#9241
wemeetagain wants to merge 6 commits intounstablefrom
cayman/recover-pruned-payload-inputs

Conversation

@wemeetagain
Copy link
Copy Markdown
Member

Motivation

  • we need unknown block sync (backwards sync near the head) to now work with payloads after gloas

Description

  • Update BlockInputSync pipeline to incorporate payloads, all different flavors
    • getting a root, needing a corresponding payload
    • getting a block input, needing a corresponding parent payload
    • getting a payload, needing a parent block

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a synchronization and recovery mechanism for execution payload envelopes and data columns, specifically targeting post-Gloas fork requirements. The BlockInputSync service has been expanded to manage a pendingPayloads cache and a state machine that handles dependencies between blocks and their parent payloads. Feedback was provided regarding a potential crash in the dependency check logic when a block body is missing, suggesting a more graceful handling by returning a fetch dependency instead of throwing an error.

Comment thread packages/beacon-node/src/sync/unknownBlock.ts
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 9f1ce8c Previous: 4fb05c5 Ratio
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.6853 ms/op 1.7419 ms/op 3.26
Full benchmark results
Benchmark suite Current: 9f1ce8c Previous: 4fb05c5 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 837.95 us/op 941.62 us/op 0.89
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 38.671 us/op 39.777 us/op 0.97
BLS verify - blst 712.24 us/op 758.97 us/op 0.94
BLS verifyMultipleSignatures 3 - blst 1.2875 ms/op 1.3584 ms/op 0.95
BLS verifyMultipleSignatures 8 - blst 2.0610 ms/op 2.1638 ms/op 0.95
BLS verifyMultipleSignatures 32 - blst 6.8384 ms/op 6.9814 ms/op 0.98
BLS verifyMultipleSignatures 64 - blst 12.774 ms/op 13.432 ms/op 0.95
BLS verifyMultipleSignatures 128 - blst 25.250 ms/op 26.780 ms/op 0.94
BLS deserializing 10000 signatures 630.98 ms/op 648.25 ms/op 0.97
BLS deserializing 100000 signatures 6.2918 s/op 6.5200 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 680.85 us/op 819.90 us/op 0.83
BLS verifyMultipleSignatures - same message - 8 - blst 835.11 us/op 961.70 us/op 0.87
BLS verifyMultipleSignatures - same message - 32 - blst 1.4932 ms/op 1.5496 ms/op 0.96
BLS verifyMultipleSignatures - same message - 64 - blst 2.3096 ms/op 2.4911 ms/op 0.93
BLS verifyMultipleSignatures - same message - 128 - blst 3.9104 ms/op 4.1177 ms/op 0.95
BLS aggregatePubkeys 32 - blst 17.199 us/op 18.294 us/op 0.94
BLS aggregatePubkeys 128 - blst 61.506 us/op 64.008 us/op 0.96
getSlashingsAndExits - default max 47.855 us/op 49.881 us/op 0.96
getSlashingsAndExits - 2k 370.24 us/op 384.36 us/op 0.96
proposeBlockBody type=full, size=empty 969.72 us/op 846.93 us/op 1.14
isKnown best case - 1 super set check 163.00 ns/op 192.00 ns/op 0.85
isKnown normal case - 2 super set checks 161.00 ns/op 167.00 ns/op 0.96
isKnown worse case - 16 super set checks 163.00 ns/op 169.00 ns/op 0.96
validate api signedAggregateAndProof - struct 1.4778 ms/op 1.5373 ms/op 0.96
validate gossip signedAggregateAndProof - struct 1.4755 ms/op 1.5344 ms/op 0.96
batch validate gossip attestation - vc 640000 - chunk 32 103.00 us/op 107.92 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 64 91.275 us/op 93.836 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 128 85.331 us/op 88.392 us/op 0.97
batch validate gossip attestation - vc 640000 - chunk 256 82.187 us/op 84.640 us/op 0.97
bytes32 toHexString 270.00 ns/op 286.00 ns/op 0.94
bytes32 Buffer.toString(hex) 167.00 ns/op 169.00 ns/op 0.99
bytes32 Buffer.toString(hex) from Uint8Array 235.00 ns/op 248.00 ns/op 0.95
bytes32 Buffer.toString(hex) + 0x 167.00 ns/op 175.00 ns/op 0.95
Return object 10000 times 0.20450 ns/op 0.21320 ns/op 0.96
Throw Error 10000 times 3.3015 us/op 3.3209 us/op 0.99
toHex 90.301 ns/op 94.886 ns/op 0.95
Buffer.from 84.350 ns/op 87.461 ns/op 0.96
shared Buffer 55.116 ns/op 59.936 ns/op 0.92
fastMsgIdFn sha256 / 200 bytes 1.4620 us/op 1.4830 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 148.00 ns/op 150.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 207.00 ns/op 205.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 4.6880 us/op 4.7890 us/op 0.98
fastMsgIdFn h32 xxhash / 1000 bytes 235.00 ns/op 245.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 1000 bytes 254.00 ns/op 259.00 ns/op 0.98
fastMsgIdFn sha256 / 10000 bytes 41.013 us/op 42.728 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.2710 us/op 1.3040 us/op 0.97
fastMsgIdFn h64 xxhash / 10000 bytes 832.00 ns/op 845.00 ns/op 0.98
send data - 1000 256B messages 4.2149 ms/op 4.0795 ms/op 1.03
send data - 1000 512B messages 4.3824 ms/op 4.1632 ms/op 1.05
send data - 1000 1024B messages 4.4441 ms/op 4.6066 ms/op 0.96
send data - 1000 1200B messages 4.9273 ms/op 5.0642 ms/op 0.97
send data - 1000 2048B messages 4.9225 ms/op 5.1977 ms/op 0.95
send data - 1000 4096B messages 5.6457 ms/op 6.0346 ms/op 0.94
send data - 1000 16384B messages 17.238 ms/op 38.903 ms/op 0.44
send data - 1000 65536B messages 130.68 ms/op 177.33 ms/op 0.74
enrSubnets - fastDeserialize 64 bits 723.00 ns/op 800.00 ns/op 0.90
enrSubnets - ssz BitVector 64 bits 265.00 ns/op 270.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 102.00 ns/op 105.00 ns/op 0.97
enrSubnets - ssz BitVector 4 bits 269.00 ns/op 272.00 ns/op 0.99
prioritizePeers score -10:0 att 32-0.1 sync 2-0 198.15 us/op 212.24 us/op 0.93
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 229.63 us/op 241.38 us/op 0.95
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 338.92 us/op 353.33 us/op 0.96
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 601.95 us/op 627.92 us/op 0.96
prioritizePeers score 0:0 att 64-1 sync 4-1 703.27 us/op 727.67 us/op 0.97
array of 16000 items push then shift 1.2376 us/op 1.3189 us/op 0.94
LinkedList of 16000 items push then shift 7.5770 ns/op 8.0410 ns/op 0.94
array of 16000 items push then pop 69.102 ns/op 70.545 ns/op 0.98
LinkedList of 16000 items push then pop 6.1350 ns/op 6.2060 ns/op 0.99
array of 24000 items push then shift 1.8480 us/op 2.2642 us/op 0.82
LinkedList of 24000 items push then shift 7.6250 ns/op 7.0000 ns/op 1.09
array of 24000 items push then pop 96.924 ns/op 98.108 ns/op 0.99
LinkedList of 24000 items push then pop 6.1090 ns/op 6.1460 ns/op 0.99
intersect bitArray bitLen 8 4.7380 ns/op 4.8150 ns/op 0.98
intersect array and set length 8 29.431 ns/op 29.637 ns/op 0.99
intersect bitArray bitLen 128 23.809 ns/op 24.775 ns/op 0.96
intersect array and set length 128 494.41 ns/op 502.89 ns/op 0.98
bitArray.getTrueBitIndexes() bitLen 128 1.0390 us/op 1.0510 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 248 1.7590 us/op 1.8490 us/op 0.95
bitArray.getTrueBitIndexes() bitLen 512 3.5960 us/op 3.7010 us/op 0.97
Full columns - reconstruct all 6 blobs 181.74 us/op 115.47 us/op 1.57
Full columns - reconstruct half of the blobs out of 6 91.859 us/op 73.612 us/op 1.25
Full columns - reconstruct single blob out of 6 33.118 us/op 33.750 us/op 0.98
Half columns - reconstruct all 6 blobs 385.42 ms/op 402.68 ms/op 0.96
Half columns - reconstruct half of the blobs out of 6 193.01 ms/op 202.42 ms/op 0.95
Half columns - reconstruct single blob out of 6 68.634 ms/op 72.211 ms/op 0.95
Full columns - reconstruct all 10 blobs 383.63 us/op 199.36 us/op 1.92
Full columns - reconstruct half of the blobs out of 10 292.79 us/op 120.77 us/op 2.42
Full columns - reconstruct single blob out of 10 30.537 us/op 31.103 us/op 0.98
Half columns - reconstruct all 10 blobs 629.79 ms/op 677.00 ms/op 0.93
Half columns - reconstruct half of the blobs out of 10 317.17 ms/op 339.86 ms/op 0.93
Half columns - reconstruct single blob out of 10 68.224 ms/op 72.208 ms/op 0.94
Full columns - reconstruct all 20 blobs 535.03 us/op 2.0636 ms/op 0.26
Full columns - reconstruct half of the blobs out of 20 257.70 us/op 202.48 us/op 1.27
Full columns - reconstruct single blob out of 20 29.822 us/op 32.009 us/op 0.93
Half columns - reconstruct all 20 blobs 1.2962 s/op 1.3097 s/op 0.99
Half columns - reconstruct half of the blobs out of 20 624.96 ms/op 657.44 ms/op 0.95
Half columns - reconstruct single blob out of 20 66.471 ms/op 69.389 ms/op 0.96
Set add up to 64 items then delete first 2.3492 us/op 2.1512 us/op 1.09
OrderedSet add up to 64 items then delete first 3.1361 us/op 3.3671 us/op 0.93
Set add up to 64 items then delete last 2.3129 us/op 2.3671 us/op 0.98
OrderedSet add up to 64 items then delete last 3.3015 us/op 3.2960 us/op 1.00
Set add up to 64 items then delete middle 2.2001 us/op 2.1421 us/op 1.03
OrderedSet add up to 64 items then delete middle 4.8218 us/op 4.7817 us/op 1.01
Set add up to 128 items then delete first 4.2388 us/op 4.2068 us/op 1.01
OrderedSet add up to 128 items then delete first 6.8599 us/op 6.5130 us/op 1.05
Set add up to 128 items then delete last 4.1688 us/op 3.8519 us/op 1.08
OrderedSet add up to 128 items then delete last 6.4212 us/op 5.7321 us/op 1.12
Set add up to 128 items then delete middle 4.1526 us/op 3.8710 us/op 1.07
OrderedSet add up to 128 items then delete middle 12.623 us/op 11.699 us/op 1.08
Set add up to 256 items then delete first 8.6473 us/op 7.8882 us/op 1.10
OrderedSet add up to 256 items then delete first 13.045 us/op 12.221 us/op 1.07
Set add up to 256 items then delete last 9.2271 us/op 7.6511 us/op 1.21
OrderedSet add up to 256 items then delete last 12.610 us/op 11.452 us/op 1.10
Set add up to 256 items then delete middle 8.0428 us/op 7.6254 us/op 1.05
OrderedSet add up to 256 items then delete middle 38.829 us/op 35.061 us/op 1.11
pass gossip attestations to forkchoice per slot 2.6112 ms/op 2.5870 ms/op 1.01
forkChoice updateHead vc 100000 bc 64 eq 0 395.02 us/op 410.33 us/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 0 2.3923 ms/op 2.4441 ms/op 0.98
forkChoice updateHead vc 1000000 bc 64 eq 0 3.8908 ms/op 4.0215 ms/op 0.97
forkChoice updateHead vc 600000 bc 320 eq 0 2.2265 ms/op 2.4341 ms/op 0.91
forkChoice updateHead vc 600000 bc 1200 eq 0 2.2506 ms/op 2.4736 ms/op 0.91
forkChoice updateHead vc 600000 bc 7200 eq 0 2.9711 ms/op 2.8773 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 1000 2.9187 ms/op 3.0018 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 3.0031 ms/op 3.1129 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 300000 7.2565 ms/op 7.4360 ms/op 0.98
computeDeltas 1400000 validators 0% inactive 11.928 ms/op 13.018 ms/op 0.92
computeDeltas 1400000 validators 10% inactive 11.141 ms/op 12.182 ms/op 0.91
computeDeltas 1400000 validators 20% inactive 10.153 ms/op 11.012 ms/op 0.92
computeDeltas 1400000 validators 50% inactive 7.8596 ms/op 8.4797 ms/op 0.93
computeDeltas 2100000 validators 0% inactive 18.057 ms/op 19.410 ms/op 0.93
computeDeltas 2100000 validators 10% inactive 17.057 ms/op 18.053 ms/op 0.94
computeDeltas 2100000 validators 20% inactive 15.945 ms/op 16.432 ms/op 0.97
computeDeltas 2100000 validators 50% inactive 12.305 ms/op 9.6414 ms/op 1.28
altair processAttestation - 250000 vs - 7PWei normalcase 2.0034 ms/op 1.7183 ms/op 1.17
altair processAttestation - 250000 vs - 7PWei worstcase 2.9721 ms/op 2.9808 ms/op 1.00
altair processAttestation - setStatus - 1/6 committees join 98.871 us/op 102.94 us/op 0.96
altair processAttestation - setStatus - 1/3 committees join 188.69 us/op 199.40 us/op 0.95
altair processAttestation - setStatus - 1/2 committees join 280.89 us/op 286.36 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 357.24 us/op 366.44 us/op 0.97
altair processAttestation - setStatus - 4/5 committees join 487.51 us/op 507.07 us/op 0.96
altair processAttestation - setStatus - 100% committees join 578.50 us/op 611.44 us/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase 4.5698 ms/op 4.8307 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 16.557 ms/op 17.120 ms/op 0.97
altair processBlock - 250000 vs - 7PWei worstcase 21.091 ms/op 23.306 ms/op 0.90
altair processBlock - 250000 vs - 7PWei worstcase hashState 46.580 ms/op 45.911 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5108 ms/op 1.5329 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei worstcase 18.527 ms/op 17.607 ms/op 1.05
altair processEth1Data - 250000 vs - 7PWei normalcase 292.00 us/op 292.42 us/op 1.00
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:16 3.7510 us/op 5.4100 us/op 0.69
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:220 19.854 us/op 29.285 us/op 0.68
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:43 5.3160 us/op 6.3790 us/op 0.83
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:19 3.5630 us/op 5.0160 us/op 0.71
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1021 88.110 us/op 92.489 us/op 0.95
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11778 1.3135 ms/op 1.3854 ms/op 0.95
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.7221 ms/op 1.8264 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.7018 ms/op 1.8219 ms/op 0.93
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.9179 ms/op 3.9105 ms/op 1.00
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.9511 ms/op 2.0825 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.1035 ms/op 4.3709 ms/op 0.94
Tree 40 250000 create 360.97 ms/op 306.04 ms/op 1.18
Tree 40 250000 get(125000) 94.009 ns/op 94.925 ns/op 0.99
Tree 40 250000 set(125000) 953.23 ns/op 1.0107 us/op 0.94
Tree 40 250000 toArray() 16.828 ms/op 9.1664 ms/op 1.84
Tree 40 250000 iterate all - toArray() + loop 16.169 ms/op 9.7320 ms/op 1.66
Tree 40 250000 iterate all - get(i) 38.270 ms/op 32.516 ms/op 1.18
Array 250000 create 2.1551 ms/op 2.0625 ms/op 1.04
Array 250000 clone - spread 669.36 us/op 663.46 us/op 1.01
Array 250000 get(125000) 0.28400 ns/op 0.30200 ns/op 0.94
Array 250000 set(125000) 0.28600 ns/op 0.30400 ns/op 0.94
Array 250000 iterate all - loop 55.636 us/op 57.454 us/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 39.840 ms/op 39.544 ms/op 1.01
Array.fill - length 1000000 2.9378 ms/op 1.8475 ms/op 1.59
Array push - length 1000000 11.557 ms/op 7.7715 ms/op 1.49
Array.get 0.20093 ns/op 0.20876 ns/op 0.96
Uint8Array.get 0.23436 ns/op 0.24434 ns/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 16.203 ms/op 15.081 ms/op 1.07
altair processEpoch - mainnet_e81889 274.93 ms/op 237.33 ms/op 1.16
mainnet_e81889 - altair beforeProcessEpoch 17.107 ms/op 15.766 ms/op 1.09
mainnet_e81889 - altair processJustificationAndFinalization 6.1610 us/op 4.7500 us/op 1.30
mainnet_e81889 - altair processInactivityUpdates 7.1782 ms/op 4.0408 ms/op 1.78
mainnet_e81889 - altair processRewardsAndPenalties 20.310 ms/op 18.269 ms/op 1.11
mainnet_e81889 - altair processRegistryUpdates 526.00 ns/op 545.00 ns/op 0.97
mainnet_e81889 - altair processSlashings 128.00 ns/op 137.00 ns/op 0.93
mainnet_e81889 - altair processEth1DataReset 125.00 ns/op 135.00 ns/op 0.93
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.0624 ms/op 1.1611 ms/op 6.08
mainnet_e81889 - altair processSlashingsReset 698.00 ns/op 734.00 ns/op 0.95
mainnet_e81889 - altair processRandaoMixesReset 1.3150 us/op 1.1040 us/op 1.19
mainnet_e81889 - altair processHistoricalRootsUpdate 132.00 ns/op 139.00 ns/op 0.95
mainnet_e81889 - altair processParticipationFlagUpdates 435.00 ns/op 436.00 ns/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 109.00 ns/op 111.00 ns/op 0.98
mainnet_e81889 - altair afterProcessEpoch 41.123 ms/op 41.587 ms/op 0.99
capella processEpoch - mainnet_e217614 948.88 ms/op 835.13 ms/op 1.14
mainnet_e217614 - capella beforeProcessEpoch 95.018 ms/op 69.623 ms/op 1.36
mainnet_e217614 - capella processJustificationAndFinalization 6.5780 us/op 5.7380 us/op 1.15
mainnet_e217614 - capella processInactivityUpdates 20.015 ms/op 13.898 ms/op 1.44
mainnet_e217614 - capella processRewardsAndPenalties 99.317 ms/op 90.390 ms/op 1.10
mainnet_e217614 - capella processRegistryUpdates 4.6190 us/op 4.6480 us/op 0.99
mainnet_e217614 - capella processSlashings 145.00 ns/op 138.00 ns/op 1.05
mainnet_e217614 - capella processEth1DataReset 141.00 ns/op 137.00 ns/op 1.03
mainnet_e217614 - capella processEffectiveBalanceUpdates 18.765 ms/op 4.6483 ms/op 4.04
mainnet_e217614 - capella processSlashingsReset 681.00 ns/op 706.00 ns/op 0.96
mainnet_e217614 - capella processRandaoMixesReset 1.3210 us/op 1.2550 us/op 1.05
mainnet_e217614 - capella processHistoricalRootsUpdate 143.00 ns/op 231.00 ns/op 0.62
mainnet_e217614 - capella processParticipationFlagUpdates 434.00 ns/op 446.00 ns/op 0.97
mainnet_e217614 - capella afterProcessEpoch 106.10 ms/op 110.27 ms/op 0.96
phase0 processEpoch - mainnet_e58758 319.86 ms/op 299.12 ms/op 1.07
mainnet_e58758 - phase0 beforeProcessEpoch 65.273 ms/op 57.074 ms/op 1.14
mainnet_e58758 - phase0 processJustificationAndFinalization 6.6050 us/op 5.3710 us/op 1.23
mainnet_e58758 - phase0 processRewardsAndPenalties 16.360 ms/op 15.692 ms/op 1.04
mainnet_e58758 - phase0 processRegistryUpdates 2.1490 us/op 2.3500 us/op 0.91
mainnet_e58758 - phase0 processSlashings 130.00 ns/op 138.00 ns/op 0.94
mainnet_e58758 - phase0 processEth1DataReset 126.00 ns/op 250.00 ns/op 0.50
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 782.12 us/op 836.14 us/op 0.94
mainnet_e58758 - phase0 processSlashingsReset 1.2240 us/op 940.00 ns/op 1.30
mainnet_e58758 - phase0 processRandaoMixesReset 1.1430 us/op 1.2990 us/op 0.88
mainnet_e58758 - phase0 processHistoricalRootsUpdate 140.00 ns/op 144.00 ns/op 0.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.0250 us/op 1.1130 us/op 0.92
mainnet_e58758 - phase0 afterProcessEpoch 31.992 ms/op 34.965 ms/op 0.91
phase0 processEffectiveBalanceUpdates - 250000 normalcase 987.17 us/op 1.0210 ms/op 0.97
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 5.6853 ms/op 1.7419 ms/op 3.26
altair processInactivityUpdates - 250000 normalcase 14.650 ms/op 11.125 ms/op 1.32
altair processInactivityUpdates - 250000 worstcase 15.313 ms/op 11.065 ms/op 1.38
phase0 processRegistryUpdates - 250000 normalcase 2.2910 us/op 2.5560 us/op 0.90
phase0 processRegistryUpdates - 250000 badcase_full_deposits 218.22 us/op 149.11 us/op 1.46
phase0 processRegistryUpdates - 250000 worstcase 0.5 75.363 ms/op 54.268 ms/op 1.39
altair processRewardsAndPenalties - 250000 normalcase 18.604 ms/op 14.286 ms/op 1.30
altair processRewardsAndPenalties - 250000 worstcase 18.897 ms/op 13.945 ms/op 1.36
phase0 getAttestationDeltas - 250000 normalcase 5.4721 ms/op 5.4604 ms/op 1.00
phase0 getAttestationDeltas - 250000 worstcase 5.2592 ms/op 5.4881 ms/op 0.96
phase0 processSlashings - 250000 worstcase 65.005 us/op 58.958 us/op 1.10
altair processSyncCommitteeUpdates - 250000 12.316 ms/op 10.097 ms/op 1.22
BeaconState.hashTreeRoot - No change 183.00 ns/op 191.00 ns/op 0.96
BeaconState.hashTreeRoot - 1 full validator 78.606 us/op 59.074 us/op 1.33
BeaconState.hashTreeRoot - 32 full validator 811.04 us/op 669.08 us/op 1.21
BeaconState.hashTreeRoot - 512 full validator 9.4389 ms/op 6.3095 ms/op 1.50
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 121.40 us/op 74.254 us/op 1.63
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.6096 ms/op 1.0649 ms/op 1.51
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 20.804 ms/op 13.327 ms/op 1.56
BeaconState.hashTreeRoot - 1 balances 89.572 us/op 58.267 us/op 1.54
BeaconState.hashTreeRoot - 32 balances 712.04 us/op 546.28 us/op 1.30
BeaconState.hashTreeRoot - 512 balances 6.8295 ms/op 4.9233 ms/op 1.39
BeaconState.hashTreeRoot - 250000 balances 128.34 ms/op 106.86 ms/op 1.20
aggregationBits - 2048 els - zipIndexesInBitList 20.021 us/op 18.939 us/op 1.06
regular array get 100000 times 22.124 us/op 22.638 us/op 0.98
wrappedArray get 100000 times 22.262 us/op 22.720 us/op 0.98
arrayWithProxy get 100000 times 9.1964 ms/op 12.993 ms/op 0.71
ssz.Root.equals 20.740 ns/op 21.421 ns/op 0.97
byteArrayEquals 20.436 ns/op 21.192 ns/op 0.96
Buffer.compare 8.4160 ns/op 8.8320 ns/op 0.95
processSlot - 1 slots 8.0710 us/op 8.4270 us/op 0.96
processSlot - 32 slots 2.2012 ms/op 1.9866 ms/op 1.11
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 4.4377 ms/op 2.8689 ms/op 1.55
getCommitteeAssignments - req 1 vs - 250000 vc 1.6564 ms/op 1.6727 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 3.4143 ms/op 3.4095 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6975 ms/op 3.6994 ms/op 1.00
findModifiedValidators - 10000 modified validators 825.19 ms/op 552.88 ms/op 1.49
findModifiedValidators - 1000 modified validators 679.40 ms/op 451.87 ms/op 1.50
findModifiedValidators - 100 modified validators 325.73 ms/op 254.43 ms/op 1.28
findModifiedValidators - 10 modified validators 159.72 ms/op 209.69 ms/op 0.76
findModifiedValidators - 1 modified validators 157.53 ms/op 146.87 ms/op 1.07
findModifiedValidators - no difference 176.03 ms/op 144.92 ms/op 1.21
migrate state 1500000 validators, 3400 modified, 2000 new 3.8654 s/op 2.8982 s/op 1.33
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 3.5600 ns/op 3.8600 ns/op 0.92
state getBlockRootAtSlot - 250000 vs - 7PWei 470.39 ns/op 282.81 ns/op 1.66
computeProposerIndex 100000 validators 1.3308 ms/op 1.3445 ms/op 0.99
getNextSyncCommitteeIndices 1000 validators 2.8169 ms/op 2.8855 ms/op 0.98
getNextSyncCommitteeIndices 10000 validators 24.527 ms/op 25.150 ms/op 0.98
getNextSyncCommitteeIndices 100000 validators 80.275 ms/op 87.659 ms/op 0.92
computeProposers - vc 250000 531.03 us/op 545.03 us/op 0.97
computeEpochShuffling - vc 250000 37.634 ms/op 39.394 ms/op 0.96
getNextSyncCommittee - vc 250000 9.1504 ms/op 9.4310 ms/op 0.97
nodejs block root to RootHex using toHex 93.934 ns/op 98.587 ns/op 0.95
nodejs block root to RootHex using toRootHex 54.855 ns/op 61.369 ns/op 0.89
nodejs fromHex(blob) 777.60 us/op 832.50 us/op 0.93
nodejs fromHexInto(blob) 615.78 us/op 632.53 us/op 0.97
nodejs block root to RootHex using the deprecated toHexString 466.85 ns/op 478.96 ns/op 0.97
nodejs byteArrayEquals 32 bytes (block root) 25.693 ns/op 26.125 ns/op 0.98
nodejs byteArrayEquals 48 bytes (pubkey) 37.001 ns/op 37.764 ns/op 0.98
nodejs byteArrayEquals 96 bytes (signature) 32.977 ns/op 35.933 ns/op 0.92
nodejs byteArrayEquals 1024 bytes 40.896 ns/op 43.721 ns/op 0.94
nodejs byteArrayEquals 131072 bytes (blob) 1.7461 us/op 1.7548 us/op 1.00
browser block root to RootHex using toHex 143.62 ns/op 145.55 ns/op 0.99
browser block root to RootHex using toRootHex 127.99 ns/op 136.63 ns/op 0.94
browser fromHex(blob) 1.6401 ms/op 1.5564 ms/op 1.05
browser fromHexInto(blob) 617.74 us/op 636.42 us/op 0.97
browser block root to RootHex using the deprecated toHexString 452.98 ns/op 332.17 ns/op 1.36
browser byteArrayEquals 32 bytes (block root) 27.515 ns/op 28.073 ns/op 0.98
browser byteArrayEquals 48 bytes (pubkey) 39.088 ns/op 39.624 ns/op 0.99
browser byteArrayEquals 96 bytes (signature) 74.087 ns/op 74.169 ns/op 1.00
browser byteArrayEquals 1024 bytes 751.24 ns/op 754.73 ns/op 1.00
browser byteArrayEquals 131072 bytes (blob) 94.782 us/op 95.450 us/op 0.99

by benchmarkbot/action

Copy link
Copy Markdown
Contributor

@twoeths twoeths left a comment

Choose a reason for hiding this comment

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

need to make sure we pass unknownBlockSync.test.ts with this PR
may need to enhance test cases over there

@wemeetagain wemeetagain added the spec-gloas Issues targeting the Glamsterdam spec version label Apr 21, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.56%. Comparing base (e341cdc) to head (bb509e7).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #9241      +/-   ##
============================================
+ Coverage     52.53%   52.56%   +0.03%     
============================================
  Files           848      848              
  Lines         61408    61364      -44     
  Branches       4525     4525              
============================================
- Hits          32262    32258       -4     
+ Misses        29081    29041      -40     
  Partials         65       65              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wemeetagain wemeetagain marked this pull request as ready for review April 21, 2026 15:58
@wemeetagain wemeetagain requested a review from a team as a code owner April 21, 2026 15:58
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06e9a8a69c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/beacon-node/src/sync/unknownBlock.ts Outdated
* This keeps the seen cache disposable: callers can recover the bid metadata needed for
* late payload envelopes / data columns after the cache entry was pruned.
*/
export async function getOrRecoverPayloadEnvelopeInput(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this function is not safe to be called in parallel:

  • block load from db could be called multiple times at the same time
  • chain.seenPayloadEnvelopeInputCache.add() will throw error

consider this scenario:

  • gossip block does not come yet
  • DataColumnSidecars comes and are queued inside network processor
  • PayloadEnvelope comes and queued inside UnknownBlockInput sync

once gossip block is downloaded and processed, this function is called at the same time by multiple DataColumnSidecars gossip validation + UnknownBlockSync.fetchPayloadInput()

}

const payloadInput = chain.seenPayloadEnvelopeInputCache.get(blockRootHex);
const payloadInput = await getOrRecoverPayloadEnvelopeInput(chain, blockRootHex);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I prefer the old way, there is good context below in the comment
we can just simply get payloadInput from the cache, if we don't have it, throw error
it should not happen because we already queued gloas DataColumnSidecar in our network processor if there is no block

});
}

const payloadInput = await getOrRecoverPayloadEnvelopeInput(chain, blockRootHex);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this function is so heavy to use here
we can just count on forkchoice to check if we already received an envelope payload

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

Labels

spec-gloas Issues targeting the Glamsterdam spec version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants