Skip to content

Conversation

@ensi321
Copy link
Contributor

@ensi321 ensi321 commented Jun 11, 2025

  • Mix blob schedule into fork digest calculation
  • Introduce concept of subscribe boundary. It is a combination of fork boundary and blob schedule boundary that we do subscribe/unsubscribe when crossing a boundary
  • Add blob schedule to ResponseOutgoing to calculate context bytes
  • Context bytes calculation is now based on fork and blob schedule from Protocol instead of from chunk
  • Cache fork digests by epoch in genesis config cache
  • Precompute fork digests at blob schedule boundary in addition to fork boundary in genesis config cache

Spec: ethereum/consensus-specs#4354

@ensi321 ensi321 marked this pull request as ready for review June 12, 2025 13:07
@ensi321 ensi321 requested a review from a team as a code owner June 12, 2025 13:07
@ensi321 ensi321 added the status-do-not-merge Merging this issue will break the build. Do not merge! label Jun 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jun 12, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e485cc4 Previous: db77aaa Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 963.39 us/op 945.45 us/op 1.02
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 35.498 us/op 34.572 us/op 1.03
BLS verify - blst 1.4368 ms/op 832.51 us/op 1.73
BLS verifyMultipleSignatures 3 - blst 2.2455 ms/op 1.1891 ms/op 1.89
BLS verifyMultipleSignatures 8 - blst 2.5000 ms/op 1.6492 ms/op 1.52
BLS verifyMultipleSignatures 32 - blst 7.4092 ms/op 4.8553 ms/op 1.53
BLS verifyMultipleSignatures 64 - blst 10.911 ms/op 9.0072 ms/op 1.21
BLS verifyMultipleSignatures 128 - blst 17.137 ms/op 17.269 ms/op 0.99
BLS deserializing 10000 signatures 681.80 ms/op 680.81 ms/op 1.00
BLS deserializing 100000 signatures 6.8725 s/op 6.9822 s/op 0.98
BLS verifyMultipleSignatures - same message - 3 - blst 1.2929 ms/op 902.35 us/op 1.43
BLS verifyMultipleSignatures - same message - 8 - blst 1.4981 ms/op 1.0474 ms/op 1.43
BLS verifyMultipleSignatures - same message - 32 - blst 1.9069 ms/op 1.7137 ms/op 1.11
BLS verifyMultipleSignatures - same message - 64 - blst 2.7595 ms/op 2.6063 ms/op 1.06
BLS verifyMultipleSignatures - same message - 128 - blst 4.4691 ms/op 4.3364 ms/op 1.03
BLS aggregatePubkeys 32 - blst 19.818 us/op 19.871 us/op 1.00
BLS aggregatePubkeys 128 - blst 71.106 us/op 71.081 us/op 1.00
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 60.977 ms/op 52.680 ms/op 1.16
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 55.308 ms/op 47.500 ms/op 1.16
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 42.792 ms/op 34.497 ms/op 1.24
getSlashingsAndExits - default max 72.101 us/op 74.177 us/op 0.97
getSlashingsAndExits - 2k 345.15 us/op 293.62 us/op 1.18
proposeBlockBody type=full, size=empty 5.4627 ms/op 5.6177 ms/op 0.97
isKnown best case - 1 super set check 204.00 ns/op 217.00 ns/op 0.94
isKnown normal case - 2 super set checks 200.00 ns/op 213.00 ns/op 0.94
isKnown worse case - 16 super set checks 202.00 ns/op 214.00 ns/op 0.94
InMemoryCheckpointStateCache - add get delete 2.4040 us/op 2.4560 us/op 0.98
validate api signedAggregateAndProof - struct 1.5710 ms/op 1.4211 ms/op 1.11
validate gossip signedAggregateAndProof - struct 1.7424 ms/op 1.5822 ms/op 1.10
batch validate gossip attestation - vc 640000 - chunk 32 116.69 us/op 117.01 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 64 103.21 us/op 102.13 us/op 1.01
batch validate gossip attestation - vc 640000 - chunk 128 97.582 us/op 94.591 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 256 96.187 us/op 97.555 us/op 0.99
pickEth1Vote - no votes 970.48 us/op 948.08 us/op 1.02
pickEth1Vote - max votes 5.4620 ms/op 5.8682 ms/op 0.93
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.463 ms/op 11.467 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 20.935 ms/op 15.712 ms/op 1.33
pickEth1Vote - Eth1Data fastSerialize value x2048 455.29 us/op 447.18 us/op 1.02
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.1381 ms/op 2.1419 ms/op 1.00
bytes32 toHexString 411.00 ns/op 372.00 ns/op 1.10
bytes32 Buffer.toString(hex) 286.00 ns/op 256.00 ns/op 1.12
bytes32 Buffer.toString(hex) from Uint8Array 372.00 ns/op 340.00 ns/op 1.09
bytes32 Buffer.toString(hex) + 0x 249.00 ns/op 253.00 ns/op 0.98
Object access 1 prop 0.15000 ns/op 0.12400 ns/op 1.21
Map access 1 prop 0.14700 ns/op 0.13000 ns/op 1.13
Object get x1000 6.0620 ns/op 5.8660 ns/op 1.03
Map get x1000 6.5350 ns/op 6.5830 ns/op 0.99
Object set x1000 31.910 ns/op 28.212 ns/op 1.13
Map set x1000 21.290 ns/op 19.559 ns/op 1.09
Return object 10000 times 0.29450 ns/op 0.28980 ns/op 1.02
Throw Error 10000 times 4.5007 us/op 4.3566 us/op 1.03
toHex 138.66 ns/op 141.64 ns/op 0.98
Buffer.from 133.36 ns/op 116.46 ns/op 1.15
shared Buffer 84.599 ns/op 81.044 ns/op 1.04
fastMsgIdFn sha256 / 200 bytes 2.3590 us/op 2.1880 us/op 1.08
fastMsgIdFn h32 xxhash / 200 bytes 260.00 ns/op 220.00 ns/op 1.18
fastMsgIdFn h64 xxhash / 200 bytes 319.00 ns/op 271.00 ns/op 1.18
fastMsgIdFn sha256 / 1000 bytes 7.3700 us/op 7.2790 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 380.00 ns/op 347.00 ns/op 1.10
fastMsgIdFn h64 xxhash / 1000 bytes 341.00 ns/op 344.00 ns/op 0.99
fastMsgIdFn sha256 / 10000 bytes 64.788 us/op 65.587 us/op 0.99
fastMsgIdFn h32 xxhash / 10000 bytes 1.8220 us/op 1.8530 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2100 us/op 1.2300 us/op 0.98
send data - 1000 256B messages 14.264 ms/op 10.813 ms/op 1.32
send data - 1000 512B messages 16.073 ms/op 16.358 ms/op 0.98
send data - 1000 1024B messages 25.066 ms/op 26.630 ms/op 0.94
send data - 1000 1200B messages 19.785 ms/op 21.162 ms/op 0.93
send data - 1000 2048B messages 20.132 ms/op 23.316 ms/op 0.86
send data - 1000 4096B messages 24.375 ms/op 23.503 ms/op 1.04
send data - 1000 16384B messages 79.207 ms/op 69.086 ms/op 1.15
send data - 1000 65536B messages 223.48 ms/op 208.04 ms/op 1.07
enrSubnets - fastDeserialize 64 bits 899.00 ns/op 918.00 ns/op 0.98
enrSubnets - ssz BitVector 64 bits 326.00 ns/op 331.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 132.00 ns/op 140.00 ns/op 0.94
enrSubnets - ssz BitVector 4 bits 327.00 ns/op 573.00 ns/op 0.57
prioritizePeers score -10:0 att 32-0.1 sync 2-0 116.67 us/op 120.94 us/op 0.96
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 138.42 us/op 139.53 us/op 0.99
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 197.22 us/op 205.39 us/op 0.96
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 365.89 us/op 385.11 us/op 0.95
prioritizePeers score 0:0 att 64-1 sync 4-1 444.24 us/op 468.70 us/op 0.95
array of 16000 items push then shift 1.5681 us/op 1.6160 us/op 0.97
LinkedList of 16000 items push then shift 6.8570 ns/op 7.1470 ns/op 0.96
array of 16000 items push then pop 73.481 ns/op 76.403 ns/op 0.96
LinkedList of 16000 items push then pop 6.7820 ns/op 7.4110 ns/op 0.92
array of 24000 items push then shift 2.3253 us/op 2.4091 us/op 0.97
LinkedList of 24000 items push then shift 6.8580 ns/op 7.2350 ns/op 0.95
array of 24000 items push then pop 96.742 ns/op 107.08 ns/op 0.90
LinkedList of 24000 items push then pop 6.7600 ns/op 6.9870 ns/op 0.97
intersect bitArray bitLen 8 6.2680 ns/op 6.3870 ns/op 0.98
intersect array and set length 8 37.198 ns/op 37.938 ns/op 0.98
intersect bitArray bitLen 128 29.343 ns/op 29.903 ns/op 0.98
intersect array and set length 128 608.50 ns/op 621.19 ns/op 0.98
bitArray.getTrueBitIndexes() bitLen 128 998.00 ns/op 1.0210 us/op 0.98
bitArray.getTrueBitIndexes() bitLen 248 1.7350 us/op 1.7960 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 512 3.5130 us/op 3.6310 us/op 0.97
Buffer.concat 32 items 626.00 ns/op 617.00 ns/op 1.01
Uint8Array.set 32 items 1.0310 us/op 934.00 ns/op 1.10
Buffer.copy 1.9640 us/op 2.0340 us/op 0.97
Uint8Array.set - with subarray 1.5090 us/op 1.5620 us/op 0.97
Uint8Array.set - without subarray 979.00 ns/op 873.00 ns/op 1.12
getUint32 - dataview 202.00 ns/op 206.00 ns/op 0.98
getUint32 - manual 122.00 ns/op 135.00 ns/op 0.90
Set add up to 64 items then delete first 2.1198 us/op 2.1212 us/op 1.00
OrderedSet add up to 64 items then delete first 3.1610 us/op 3.3748 us/op 0.94
Set add up to 64 items then delete last 2.3025 us/op 2.5246 us/op 0.91
OrderedSet add up to 64 items then delete last 3.8127 us/op 3.6330 us/op 1.05
Set add up to 64 items then delete middle 2.4917 us/op 2.4890 us/op 1.00
OrderedSet add up to 64 items then delete middle 5.2006 us/op 6.7052 us/op 0.78
Set add up to 128 items then delete first 5.1342 us/op 5.5030 us/op 0.93
OrderedSet add up to 128 items then delete first 7.3337 us/op 7.9482 us/op 0.92
Set add up to 128 items then delete last 4.9648 us/op 5.0522 us/op 0.98
OrderedSet add up to 128 items then delete last 7.5945 us/op 7.6930 us/op 0.99
Set add up to 128 items then delete middle 4.8314 us/op 5.3290 us/op 0.91
OrderedSet add up to 128 items then delete middle 13.864 us/op 13.985 us/op 0.99
Set add up to 256 items then delete first 9.7723 us/op 10.183 us/op 0.96
OrderedSet add up to 256 items then delete first 15.065 us/op 16.470 us/op 0.91
Set add up to 256 items then delete last 10.033 us/op 10.692 us/op 0.94
OrderedSet add up to 256 items then delete last 15.281 us/op 14.519 us/op 1.05
Set add up to 256 items then delete middle 9.6815 us/op 9.8221 us/op 0.99
OrderedSet add up to 256 items then delete middle 39.860 us/op 43.133 us/op 0.92
transfer serialized Status (84 B) 2.2230 us/op 2.2740 us/op 0.98
copy serialized Status (84 B) 1.1750 us/op 1.4390 us/op 0.82
transfer serialized SignedVoluntaryExit (112 B) 2.2340 us/op 2.3150 us/op 0.97
copy serialized SignedVoluntaryExit (112 B) 1.3050 us/op 1.2290 us/op 1.06
transfer serialized ProposerSlashing (416 B) 2.3030 us/op 2.3740 us/op 0.97
copy serialized ProposerSlashing (416 B) 1.4620 us/op 1.2990 us/op 1.13
transfer serialized Attestation (485 B) 2.3020 us/op 2.3940 us/op 0.96
copy serialized Attestation (485 B) 1.6340 us/op 1.3190 us/op 1.24
transfer serialized AttesterSlashing (33232 B) 2.4330 us/op 2.4750 us/op 0.98
copy serialized AttesterSlashing (33232 B) 4.1980 us/op 3.5150 us/op 1.19
transfer serialized Small SignedBeaconBlock (128000 B) 3.1290 us/op 3.1930 us/op 0.98
copy serialized Small SignedBeaconBlock (128000 B) 9.1160 us/op 9.7450 us/op 0.94
transfer serialized Avg SignedBeaconBlock (200000 B) 3.5670 us/op 3.5600 us/op 1.00
copy serialized Avg SignedBeaconBlock (200000 B) 12.570 us/op 14.497 us/op 0.87
transfer serialized BlobsSidecar (524380 B) 3.3500 us/op 3.4760 us/op 0.96
copy serialized BlobsSidecar (524380 B) 57.745 us/op 75.668 us/op 0.76
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3940 us/op 4.1130 us/op 0.83
copy serialized Big SignedBeaconBlock (1000000 B) 110.83 us/op 244.26 us/op 0.45
pass gossip attestations to forkchoice per slot 2.7448 ms/op 2.7972 ms/op 0.98
forkChoice updateHead vc 100000 bc 64 eq 0 448.54 us/op 462.45 us/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 0 2.7469 ms/op 2.8892 ms/op 0.95
forkChoice updateHead vc 1000000 bc 64 eq 0 4.7122 ms/op 4.9495 ms/op 0.95
forkChoice updateHead vc 600000 bc 320 eq 0 2.7792 ms/op 2.8926 ms/op 0.96
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7778 ms/op 3.4760 ms/op 0.80
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0123 ms/op 3.1535 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 10.278 ms/op 10.731 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 10000 10.296 ms/op 10.736 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 300000 13.903 ms/op 14.117 ms/op 0.98
computeDeltas 500000 validators 300 proto nodes 3.7451 ms/op 4.1119 ms/op 0.91
computeDeltas 500000 validators 1200 proto nodes 3.7730 ms/op 4.2923 ms/op 0.88
computeDeltas 500000 validators 7200 proto nodes 3.8069 ms/op 4.3883 ms/op 0.87
computeDeltas 750000 validators 300 proto nodes 5.7016 ms/op 6.2728 ms/op 0.91
computeDeltas 750000 validators 1200 proto nodes 5.6669 ms/op 7.0376 ms/op 0.81
computeDeltas 750000 validators 7200 proto nodes 5.7215 ms/op 6.4823 ms/op 0.88
computeDeltas 1400000 validators 300 proto nodes 10.885 ms/op 11.593 ms/op 0.94
computeDeltas 1400000 validators 1200 proto nodes 11.010 ms/op 11.760 ms/op 0.94
computeDeltas 1400000 validators 7200 proto nodes 10.802 ms/op 12.205 ms/op 0.89
computeDeltas 2100000 validators 300 proto nodes 16.459 ms/op 18.760 ms/op 0.88
computeDeltas 2100000 validators 1200 proto nodes 16.137 ms/op 21.773 ms/op 0.74
computeDeltas 2100000 validators 7200 proto nodes 16.099 ms/op 18.815 ms/op 0.86
altair processAttestation - 250000 vs - 7PWei normalcase 1.9812 ms/op 4.3822 ms/op 0.45
altair processAttestation - 250000 vs - 7PWei worstcase 2.9911 ms/op 6.0429 ms/op 0.49
altair processAttestation - setStatus - 1/6 committees join 121.04 us/op 189.81 us/op 0.64
altair processAttestation - setStatus - 1/3 committees join 236.75 us/op 335.07 us/op 0.71
altair processAttestation - setStatus - 1/2 committees join 330.28 us/op 447.08 us/op 0.74
altair processAttestation - setStatus - 2/3 committees join 423.52 us/op 506.70 us/op 0.84
altair processAttestation - setStatus - 4/5 committees join 587.30 us/op 675.58 us/op 0.87
altair processAttestation - setStatus - 100% committees join 697.38 us/op 785.33 us/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase 6.3612 ms/op 5.3419 ms/op 1.19
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.792 ms/op 32.972 ms/op 0.96
altair processBlock - 250000 vs - 7PWei worstcase 47.964 ms/op 39.704 ms/op 1.21
altair processBlock - 250000 vs - 7PWei worstcase hashState 106.04 ms/op 83.770 ms/op 1.27
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2694 ms/op 1.7431 ms/op 1.30
phase0 processBlock - 250000 vs - 7PWei worstcase 24.481 ms/op 25.850 ms/op 0.95
altair processEth1Data - 250000 vs - 7PWei normalcase 336.65 us/op 376.57 us/op 0.89
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.2870 us/op 6.8410 us/op 1.36
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 58.020 us/op 43.283 us/op 1.34
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 16.127 us/op 11.383 us/op 1.42
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 6.1530 us/op 7.6510 us/op 0.80
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 255.06 us/op 178.97 us/op 1.43
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.9484 ms/op 1.9184 ms/op 1.02
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.3641 ms/op 2.4805 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2992 ms/op 2.4331 ms/op 0.94
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.4502 ms/op 5.5990 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3413 ms/op 2.6204 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4570 ms/op 5.7670 ms/op 0.77
Tree 40 250000 create 425.39 ms/op 567.51 ms/op 0.75
Tree 40 250000 get(125000) 145.10 ns/op 153.25 ns/op 0.95
Tree 40 250000 set(125000) 1.4522 us/op 1.5595 us/op 0.93
Tree 40 250000 toArray() 15.375 ms/op 17.074 ms/op 0.90
Tree 40 250000 iterate all - toArray() + loop 15.600 ms/op 17.118 ms/op 0.91
Tree 40 250000 iterate all - get(i) 50.390 ms/op 54.273 ms/op 0.93
Array 250000 create 2.8350 ms/op 3.4532 ms/op 0.82
Array 250000 clone - spread 807.28 us/op 1.4023 ms/op 0.58
Array 250000 get(125000) 0.41200 ns/op 0.41800 ns/op 0.99
Array 250000 set(125000) 0.43200 ns/op 0.44200 ns/op 0.98
Array 250000 iterate all - loop 80.942 us/op 83.887 us/op 0.96
phase0 afterProcessEpoch - 250000 vs - 7PWei 40.063 ms/op 43.557 ms/op 0.92
Array.fill - length 1000000 3.2402 ms/op 4.1120 ms/op 0.79
Array push - length 1000000 13.674 ms/op 13.583 ms/op 1.01
Array.get 0.26760 ns/op 0.27669 ns/op 0.97
Uint8Array.get 0.43118 ns/op 0.44845 ns/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.902 ms/op 18.419 ms/op 0.81
altair processEpoch - mainnet_e81889 300.42 ms/op 246.29 ms/op 1.22
mainnet_e81889 - altair beforeProcessEpoch 17.654 ms/op 19.237 ms/op 0.92
mainnet_e81889 - altair processJustificationAndFinalization 5.5560 us/op 5.5540 us/op 1.00
mainnet_e81889 - altair processInactivityUpdates 4.0610 ms/op 4.2528 ms/op 0.95
mainnet_e81889 - altair processRewardsAndPenalties 45.784 ms/op 40.296 ms/op 1.14
mainnet_e81889 - altair processRegistryUpdates 719.00 ns/op 729.00 ns/op 0.99
mainnet_e81889 - altair processSlashings 206.00 ns/op 186.00 ns/op 1.11
mainnet_e81889 - altair processEth1DataReset 179.00 ns/op 184.00 ns/op 0.97
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2328 ms/op 1.2658 ms/op 0.97
mainnet_e81889 - altair processSlashingsReset 1.0960 us/op 899.00 ns/op 1.22
mainnet_e81889 - altair processRandaoMixesReset 1.6170 us/op 1.1460 us/op 1.41
mainnet_e81889 - altair processHistoricalRootsUpdate 180.00 ns/op 182.00 ns/op 0.99
mainnet_e81889 - altair processParticipationFlagUpdates 514.00 ns/op 534.00 ns/op 0.96
mainnet_e81889 - altair processSyncCommitteeUpdates 141.00 ns/op 143.00 ns/op 0.99
mainnet_e81889 - altair afterProcessEpoch 43.916 ms/op 45.486 ms/op 0.97
capella processEpoch - mainnet_e217614 995.75 ms/op 858.27 ms/op 1.16
mainnet_e217614 - capella beforeProcessEpoch 65.782 ms/op 62.870 ms/op 1.05
mainnet_e217614 - capella processJustificationAndFinalization 5.3870 us/op 5.5330 us/op 0.97
mainnet_e217614 - capella processInactivityUpdates 14.328 ms/op 14.792 ms/op 0.97
mainnet_e217614 - capella processRewardsAndPenalties 252.71 ms/op 184.83 ms/op 1.37
mainnet_e217614 - capella processRegistryUpdates 6.3760 us/op 6.5250 us/op 0.98
mainnet_e217614 - capella processSlashings 175.00 ns/op 183.00 ns/op 0.96
mainnet_e217614 - capella processEth1DataReset 194.00 ns/op 182.00 ns/op 1.07
mainnet_e217614 - capella processEffectiveBalanceUpdates 9.5033 ms/op 4.3219 ms/op 2.20
mainnet_e217614 - capella processSlashingsReset 1.0890 us/op 896.00 ns/op 1.22
mainnet_e217614 - capella processRandaoMixesReset 1.4320 us/op 1.2020 us/op 1.19
mainnet_e217614 - capella processHistoricalRootsUpdate 175.00 ns/op 183.00 ns/op 0.96
mainnet_e217614 - capella processParticipationFlagUpdates 599.00 ns/op 520.00 ns/op 1.15
mainnet_e217614 - capella afterProcessEpoch 114.52 ms/op 115.56 ms/op 0.99
phase0 processEpoch - mainnet_e58758 319.66 ms/op 308.81 ms/op 1.04
mainnet_e58758 - phase0 beforeProcessEpoch 91.227 ms/op 79.176 ms/op 1.15
mainnet_e58758 - phase0 processJustificationAndFinalization 5.4670 us/op 6.0620 us/op 0.90
mainnet_e58758 - phase0 processRewardsAndPenalties 49.829 ms/op 36.218 ms/op 1.38
mainnet_e58758 - phase0 processRegistryUpdates 2.9610 us/op 3.2300 us/op 0.92
mainnet_e58758 - phase0 processSlashings 186.00 ns/op 185.00 ns/op 1.01
mainnet_e58758 - phase0 processEth1DataReset 166.00 ns/op 184.00 ns/op 0.90
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1381 ms/op 1.4113 ms/op 0.81
mainnet_e58758 - phase0 processSlashingsReset 952.00 ns/op 1.0210 us/op 0.93
mainnet_e58758 - phase0 processRandaoMixesReset 1.2810 us/op 1.2250 us/op 1.05
mainnet_e58758 - phase0 processHistoricalRootsUpdate 178.00 ns/op 186.00 ns/op 0.96
mainnet_e58758 - phase0 processParticipationRecordUpdates 906.00 ns/op 1.0020 us/op 0.90
mainnet_e58758 - phase0 afterProcessEpoch 35.661 ms/op 37.688 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2317 ms/op 1.4128 ms/op 0.87
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9330 ms/op 1.9139 ms/op 1.01
altair processInactivityUpdates - 250000 normalcase 21.746 ms/op 18.258 ms/op 1.19
altair processInactivityUpdates - 250000 worstcase 25.029 ms/op 18.713 ms/op 1.34
phase0 processRegistryUpdates - 250000 normalcase 10.819 us/op 7.5900 us/op 1.43
phase0 processRegistryUpdates - 250000 badcase_full_deposits 429.43 us/op 268.62 us/op 1.60
phase0 processRegistryUpdates - 250000 worstcase 0.5 120.89 ms/op 122.53 ms/op 0.99
altair processRewardsAndPenalties - 250000 normalcase 29.346 ms/op 27.261 ms/op 1.08
altair processRewardsAndPenalties - 250000 worstcase 35.193 ms/op 26.215 ms/op 1.34
phase0 getAttestationDeltas - 250000 normalcase 6.7773 ms/op 8.0611 ms/op 0.84
phase0 getAttestationDeltas - 250000 worstcase 6.4252 ms/op 18.999 ms/op 0.34
phase0 processSlashings - 250000 worstcase 123.05 us/op 99.220 us/op 1.24
altair processSyncCommitteeUpdates - 250000 10.917 ms/op 11.772 ms/op 0.93
BeaconState.hashTreeRoot - No change 210.00 ns/op 231.00 ns/op 0.91
BeaconState.hashTreeRoot - 1 full validator 111.26 us/op 79.539 us/op 1.40
BeaconState.hashTreeRoot - 32 full validator 1.3895 ms/op 827.01 us/op 1.68
BeaconState.hashTreeRoot - 512 full validator 9.6656 ms/op 10.757 ms/op 0.90
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 118.70 us/op 97.956 us/op 1.21
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.0562 ms/op 1.3872 ms/op 1.48
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 25.154 ms/op 23.334 ms/op 1.08
BeaconState.hashTreeRoot - 1 balances 108.06 us/op 77.140 us/op 1.40
BeaconState.hashTreeRoot - 32 balances 890.26 us/op 1.0017 ms/op 0.89
BeaconState.hashTreeRoot - 512 balances 8.4635 ms/op 8.7394 ms/op 0.97
BeaconState.hashTreeRoot - 250000 balances 198.04 ms/op 197.36 ms/op 1.00
aggregationBits - 2048 els - zipIndexesInBitList 21.380 us/op 24.338 us/op 0.88
byteArrayEquals 32 54.052 ns/op 55.600 ns/op 0.97
Buffer.compare 32 17.275 ns/op 17.426 ns/op 0.99
byteArrayEquals 1024 1.6005 us/op 1.6376 us/op 0.98
Buffer.compare 1024 26.157 ns/op 25.710 ns/op 1.02
byteArrayEquals 16384 25.460 us/op 26.513 us/op 0.96
Buffer.compare 16384 204.60 ns/op 187.00 ns/op 1.09
byteArrayEquals 123687377 191.11 ms/op 199.75 ms/op 0.96
Buffer.compare 123687377 6.2067 ms/op 9.4273 ms/op 0.66
byteArrayEquals 32 - diff last byte 53.125 ns/op 55.064 ns/op 0.96
Buffer.compare 32 - diff last byte 17.526 ns/op 18.105 ns/op 0.97
byteArrayEquals 1024 - diff last byte 1.5910 us/op 1.6638 us/op 0.96
Buffer.compare 1024 - diff last byte 25.098 ns/op 27.109 ns/op 0.93
byteArrayEquals 16384 - diff last byte 25.932 us/op 26.431 us/op 0.98
Buffer.compare 16384 - diff last byte 198.04 ns/op 199.18 ns/op 0.99
byteArrayEquals 123687377 - diff last byte 192.02 ms/op 200.87 ms/op 0.96
Buffer.compare 123687377 - diff last byte 6.0696 ms/op 8.7006 ms/op 0.70
byteArrayEquals 32 - random bytes 5.0750 ns/op 5.3380 ns/op 0.95
Buffer.compare 32 - random bytes 16.926 ns/op 17.992 ns/op 0.94
byteArrayEquals 1024 - random bytes 5.3380 ns/op 5.3610 ns/op 1.00
Buffer.compare 1024 - random bytes 16.924 ns/op 18.239 ns/op 0.93
byteArrayEquals 16384 - random bytes 5.0730 ns/op 5.4320 ns/op 0.93
Buffer.compare 16384 - random bytes 16.938 ns/op 18.303 ns/op 0.93
byteArrayEquals 123687377 - random bytes 6.4200 ns/op 6.8200 ns/op 0.94
Buffer.compare 123687377 - random bytes 18.540 ns/op 19.300 ns/op 0.96
regular array get 100000 times 32.307 us/op 45.918 us/op 0.70
wrappedArray get 100000 times 39.714 us/op 34.345 us/op 1.16
arrayWithProxy get 100000 times 12.763 ms/op 14.176 ms/op 0.90
ssz.Root.equals 43.960 ns/op 48.419 ns/op 0.91
byteArrayEquals 43.307 ns/op 47.341 ns/op 0.91
Buffer.compare 9.9640 ns/op 10.882 ns/op 0.92
processSlot - 1 slots 16.272 us/op 10.443 us/op 1.56
processSlot - 32 slots 3.4873 ms/op 1.9762 ms/op 1.76
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.8550 ms/op 3.1231 ms/op 0.91
getCommitteeAssignments - req 1 vs - 250000 vc 2.0175 ms/op 2.2116 ms/op 0.91
getCommitteeAssignments - req 100 vs - 250000 vc 3.8940 ms/op 4.2778 ms/op 0.91
getCommitteeAssignments - req 1000 vs - 250000 vc 4.1418 ms/op 4.5512 ms/op 0.91
findModifiedValidators - 10000 modified validators 733.86 ms/op 768.43 ms/op 0.96
findModifiedValidators - 1000 modified validators 683.34 ms/op 778.46 ms/op 0.88
findModifiedValidators - 100 modified validators 165.09 ms/op 195.06 ms/op 0.85
findModifiedValidators - 10 modified validators 132.02 ms/op 140.13 ms/op 0.94
findModifiedValidators - 1 modified validators 158.68 ms/op 144.46 ms/op 1.10
findModifiedValidators - no difference 139.81 ms/op 168.78 ms/op 0.83
compare ViewDUs 6.1644 s/op 6.3312 s/op 0.97
compare each validator Uint8Array 1.7228 s/op 1.2509 s/op 1.38
compare ViewDU to Uint8Array 1.0604 s/op 1.2311 s/op 0.86
migrate state 1000000 validators, 24 modified, 0 new 927.96 ms/op 839.63 ms/op 1.11
migrate state 1000000 validators, 1700 modified, 1000 new 1.2355 s/op 1.1587 s/op 1.07
migrate state 1000000 validators, 3400 modified, 2000 new 1.2741 s/op 1.2968 s/op 0.98
migrate state 1500000 validators, 24 modified, 0 new 972.52 ms/op 869.66 ms/op 1.12
migrate state 1500000 validators, 1700 modified, 1000 new 1.2118 s/op 1.0987 s/op 1.10
migrate state 1500000 validators, 3400 modified, 2000 new 1.5815 s/op 1.3226 s/op 1.20
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.3200 ns/op 4.4300 ns/op 0.98
state getBlockRootAtSlot - 250000 vs - 7PWei 508.78 ns/op 558.12 ns/op 0.91
naive computeProposerIndex 100000 validators 57.375 ms/op 56.882 ms/op 1.01
computeProposerIndex 100000 validators 1.5200 ms/op 1.5022 ms/op 1.01
naiveGetNextSyncCommitteeIndices 1000 validators 7.8470 s/op 8.0308 s/op 0.98
getNextSyncCommitteeIndices 1000 validators 110.29 ms/op 123.27 ms/op 0.89
naiveGetNextSyncCommitteeIndices 10000 validators 8.0247 s/op 8.1526 s/op 0.98
getNextSyncCommitteeIndices 10000 validators 112.98 ms/op 112.91 ms/op 1.00
naiveGetNextSyncCommitteeIndices 100000 validators 8.0703 s/op 7.6732 s/op 1.05
getNextSyncCommitteeIndices 100000 validators 119.12 ms/op 111.46 ms/op 1.07
naive computeShuffledIndex 100000 validators 23.450 s/op 23.313 s/op 1.01
cached computeShuffledIndex 100000 validators 541.89 ms/op 571.98 ms/op 0.95
naive computeShuffledIndex 2000000 validators 494.47 s/op 585.58 s/op 0.84
cached computeShuffledIndex 2000000 validators 30.013 s/op 64.096 s/op 0.47
computeProposers - vc 250000 590.34 us/op 631.41 us/op 0.93
computeEpochShuffling - vc 250000 41.379 ms/op 44.641 ms/op 0.93
getNextSyncCommittee - vc 250000 10.284 ms/op 10.977 ms/op 0.94
computeSigningRoot for AttestationData 19.775 us/op 22.734 us/op 0.87
hash AttestationData serialized data then Buffer.toString(base64) 1.5602 us/op 1.6644 us/op 0.94
toHexString serialized data 1.0708 us/op 1.2589 us/op 0.85
Buffer.toString(base64) 157.38 ns/op 170.98 ns/op 0.92
nodejs block root to RootHex using toHex 142.12 ns/op 168.14 ns/op 0.85
nodejs block root to RootHex using toRootHex 89.087 ns/op 99.395 ns/op 0.90
browser block root to RootHex using the deprecated toHexString 206.51 ns/op 229.65 ns/op 0.90
browser block root to RootHex using toHex 168.37 ns/op 182.21 ns/op 0.92
browser block root to RootHex using toRootHex 157.97 ns/op 166.63 ns/op 0.95

by benchmarkbot/action

unsubscribeSubnetsFromPrevFork(prevFork: ForkName): void {
this.logger.info("Unsubscribing to random attnets from prev fork", {prevFork});
unsubscribeSubnetsBeforeBoundary(boundary: SubscribeBoundary): void {
this.logger.info("Unsubscribing to random attnets from prev fork", boundary);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
this.logger.info("Unsubscribing to random attnets from prev fork", boundary);
this.logger.info("Unsubscribing to random attnets from prev boundary", boundary);


export type MultiaddrStr = string;
// Boundary of network subscription. We subscribe/unsubscribe during fork and blob schedule transitions
export type SubscribeBoundary = {fork: ForkName; epoch?: Epoch} | ({fork: ForkName} & BlobScheduleEntry);
Copy link
Contributor

Choose a reason for hiding this comment

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

suggest to make it more specific

Suggested change
export type SubscribeBoundary = {fork: ForkName; epoch?: Epoch} | ({fork: ForkName} & BlobScheduleEntry);
export type SubscribeBoundary = {fork: ForkPreFulu; epoch: Epoch} | ({fork: ForkPostFulu} & BlobScheduleEntry);

then in both cases we have epoch, then for a lot of interfaces we only need epoch like forkName2ForkDigestHex(epoch): ForkDigestHex

here I suppose we only need to cache by epoch in out config as commented here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here I suppose we only need to cache by epoch in out config as commented #7954 (comment)

We can cache epoch in genesis config but not here.

Reason being SubscribeBoundary resides in GossipTopic, and we need fork info to do something like getGossipSSZType. Sometimes it is hard to get fork info from epoch because a lot of places don't have access to config. It would need some non-trivial refactoring for some places to have access to config

Copy link
Contributor Author

@ensi321 ensi321 Jun 20, 2025

Choose a reason for hiding this comment

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

here I suppose we only need to cache by epoch in out config as commented #7954 (comment)

We can cache epoch in genesis config but not here.

Reason being SubscribeBoundary resides in GossipTopic, and we need fork info to do something like getGossipSSZType. Sometimes it is hard to get fork info from epoch because a lot of places don't have access to config. It would need some non-trivial refactoring for some places to have access to config

There is also one issue with SubscribeBoundary being epoch only, is that when we are in the fulu fork, but before the first BPO fork, fork digest is calculated using ELECTRA_FORK_EPOCH here, but the ssz types still use fulu's. So we need fork info to indicate which fork we are in to derive the ssz type, and epoch to indicate 1) where the boundary is 2) calculate fork digest

| {
type: ContextBytesType.ForkDigest;
forkDigestContext: ForkDigestContext;
fork: ForkName;
Copy link
Contributor

Choose a reason for hiding this comment

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

same to the other comment, we only need to add an epoch here to simplify, no need fork and blobSchedule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been moved to ResponseOutgoing

forkName2ForkDigest(forkName: ForkName): ForkDigest;
forkName2ForkDigestHex(forkName: ForkName): ForkDigestHex;
forkName2ForkDigest(forkName: ForkName, blobSchedule: BlobScheduleEntry | null): ForkDigest;
forkName2ForkDigestHex(forkName: ForkName, blobSchedule: BlobScheduleEntry | null): ForkDigestHex;
Copy link
Contributor

Choose a reason for hiding this comment

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

with this enhancement this name is not suitable anymore, maybe just go with getForkDigest(epoch: Epoch): ForkDigest; instead


function computeForkDigest(currentVersion: Version, genesisValidatorsRoot: Root): ForkDigest {
return computeForkDataRoot(currentVersion, genesisValidatorsRoot).slice(0, 4);
function computeForkDigest(
Copy link
Member

Choose a reason for hiding this comment

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

there are tests for this on the spec test_compute_fork_digest.py, but does not look like we have wired up the spec iterator for those yet

nflaig added a commit that referenced this pull request Jun 24, 2025
@ensi321
Copy link
Contributor Author

ensi321 commented Jul 14, 2025

Superseded by #8022

@ensi321 ensi321 closed this Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status-do-not-merge Merging this issue will break the build. Do not merge!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants