Skip to content

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jul 30, 2025

Motivation

Description

  • new method getAttestationsForBlockElectraBySlot
  • later on we will loop through each slot and get attestations for it from this pool, and SingleAttestationPool (which is next PR)
  • export more types
  • there is no consumer for it now

part of #8028

Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 77.22772% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.74%. Comparing base (dea6b94) to head (91c729b).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8095      +/-   ##
============================================
+ Coverage     55.70%   55.74%   +0.04%     
============================================
  Files           834      834              
  Lines         59786    59881      +95     
  Branches       4611     4628      +17     
============================================
+ Hits          33304    33382      +78     
- Misses        26413    26430      +17     
  Partials         69       69              
🚀 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.

Copy link
Contributor

⚠️ 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: 7b3def0 Previous: dea6b94 Ratio
toHexString serialized data 5.8714 us/op 1.1990 us/op 4.90
Full benchmark results
Benchmark suite Current: 7b3def0 Previous: dea6b94 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 963.89 us/op 1.1811 ms/op 0.82
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 35.020 us/op 39.704 us/op 0.88
BLS verify - blst 837.84 us/op 934.41 us/op 0.90
BLS verifyMultipleSignatures 3 - blst 1.1616 ms/op 1.3190 ms/op 0.88
BLS verifyMultipleSignatures 8 - blst 1.6363 ms/op 1.7590 ms/op 0.93
BLS verifyMultipleSignatures 32 - blst 4.8619 ms/op 5.2655 ms/op 0.92
BLS verifyMultipleSignatures 64 - blst 9.9443 ms/op 9.8942 ms/op 1.01
BLS verifyMultipleSignatures 128 - blst 17.716 ms/op 18.860 ms/op 0.94
BLS deserializing 10000 signatures 692.67 ms/op 750.20 ms/op 0.92
BLS deserializing 100000 signatures 6.9349 s/op 7.4495 s/op 0.93
BLS verifyMultipleSignatures - same message - 3 - blst 942.04 us/op 1.0117 ms/op 0.93
BLS verifyMultipleSignatures - same message - 8 - blst 1.1078 ms/op 1.1338 ms/op 0.98
BLS verifyMultipleSignatures - same message - 32 - blst 1.7859 ms/op 1.8755 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst 2.6185 ms/op 2.7611 ms/op 0.95
BLS verifyMultipleSignatures - same message - 128 - blst 4.5450 ms/op 4.7196 ms/op 0.96
BLS aggregatePubkeys 32 - blst 19.835 us/op 20.809 us/op 0.95
BLS aggregatePubkeys 128 - blst 70.785 us/op 74.120 us/op 0.96
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 46.333 ms/op 53.945 ms/op 0.86
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.686 ms/op 49.276 ms/op 1.01
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 36.604 ms/op 37.510 ms/op 0.98
getSlashingsAndExits - default max 71.206 us/op 74.812 us/op 0.95
getSlashingsAndExits - 2k 312.38 us/op 296.51 us/op 1.05
proposeBlockBody type=full, size=empty 5.8239 ms/op 5.5826 ms/op 1.04
isKnown best case - 1 super set check 210.00 ns/op 206.00 ns/op 1.02
isKnown normal case - 2 super set checks 206.00 ns/op 205.00 ns/op 1.00
isKnown worse case - 16 super set checks 205.00 ns/op 205.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.4370 us/op 2.3580 us/op 1.03
validate api signedAggregateAndProof - struct 1.3899 ms/op 1.3735 ms/op 1.01
validate gossip signedAggregateAndProof - struct 1.4102 ms/op 1.4579 ms/op 0.97
batch validate gossip attestation - vc 640000 - chunk 32 117.88 us/op 119.64 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 103.96 us/op 105.73 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 128 95.244 us/op 97.103 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 102.84 us/op 102.72 us/op 1.00
pickEth1Vote - no votes 986.02 us/op 1.0663 ms/op 0.92
pickEth1Vote - max votes 7.8047 ms/op 10.094 ms/op 0.77
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.734 ms/op 14.892 ms/op 0.92
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.338 ms/op 23.655 ms/op 0.90
pickEth1Vote - Eth1Data fastSerialize value x2048 453.81 us/op 438.94 us/op 1.03
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.0707 ms/op 4.9146 ms/op 0.42
bytes32 toHexString 374.00 ns/op 424.00 ns/op 0.88
bytes32 Buffer.toString(hex) 252.00 ns/op 259.00 ns/op 0.97
bytes32 Buffer.toString(hex) from Uint8Array 345.00 ns/op 344.00 ns/op 1.00
bytes32 Buffer.toString(hex) + 0x 250.00 ns/op 260.00 ns/op 0.96
Object access 1 prop 0.12100 ns/op 0.12500 ns/op 0.97
Map access 1 prop 0.12700 ns/op 0.12700 ns/op 1.00
Object get x1000 5.7930 ns/op 5.9810 ns/op 0.97
Map get x1000 6.1840 ns/op 6.4250 ns/op 0.96
Object set x1000 32.871 ns/op 33.967 ns/op 0.97
Map set x1000 21.706 ns/op 22.506 ns/op 0.96
Return object 10000 times 0.28990 ns/op 0.30360 ns/op 0.95
Throw Error 10000 times 4.5445 us/op 4.6670 us/op 0.97
toHex 136.48 ns/op 143.27 ns/op 0.95
Buffer.from 121.44 ns/op 125.36 ns/op 0.97
shared Buffer 81.754 ns/op 80.451 ns/op 1.02
fastMsgIdFn sha256 / 200 bytes 2.1980 us/op 2.3420 us/op 0.94
fastMsgIdFn h32 xxhash / 200 bytes 204.00 ns/op 216.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 262.00 ns/op 275.00 ns/op 0.95
fastMsgIdFn sha256 / 1000 bytes 7.2980 us/op 7.5240 us/op 0.97
fastMsgIdFn h32 xxhash / 1000 bytes 335.00 ns/op 357.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 1000 bytes 334.00 ns/op 355.00 ns/op 0.94
fastMsgIdFn sha256 / 10000 bytes 64.712 us/op 67.653 us/op 0.96
fastMsgIdFn h32 xxhash / 10000 bytes 1.8470 us/op 1.8900 us/op 0.98
fastMsgIdFn h64 xxhash / 10000 bytes 1.2280 us/op 1.2460 us/op 0.99
send data - 1000 256B messages 18.590 ms/op 21.801 ms/op 0.85
send data - 1000 512B messages 21.644 ms/op 24.562 ms/op 0.88
send data - 1000 1024B messages 28.859 ms/op 32.294 ms/op 0.89
send data - 1000 1200B messages 28.652 ms/op 33.900 ms/op 0.85
send data - 1000 2048B messages 27.806 ms/op 40.089 ms/op 0.69
send data - 1000 4096B messages 30.076 ms/op 40.547 ms/op 0.74
send data - 1000 16384B messages 46.039 ms/op 61.918 ms/op 0.74
send data - 1000 65536B messages 126.90 ms/op 148.31 ms/op 0.86
enrSubnets - fastDeserialize 64 bits 901.00 ns/op 962.00 ns/op 0.94
enrSubnets - ssz BitVector 64 bits 326.00 ns/op 351.00 ns/op 0.93
enrSubnets - fastDeserialize 4 bits 129.00 ns/op 140.00 ns/op 0.92
enrSubnets - ssz BitVector 4 bits 329.00 ns/op 356.00 ns/op 0.92
prioritizePeers score -10:0 att 32-0.1 sync 2-0 126.47 us/op 133.97 us/op 0.94
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 158.67 us/op 167.72 us/op 0.95
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 223.60 us/op 244.36 us/op 0.92
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 419.81 us/op 435.08 us/op 0.96
prioritizePeers score 0:0 att 64-1 sync 4-1 506.97 us/op 552.40 us/op 0.92
array of 16000 items push then shift 1.6368 us/op 1.7543 us/op 0.93
LinkedList of 16000 items push then shift 9.4150 ns/op 9.9860 ns/op 0.94
array of 16000 items push then pop 85.545 ns/op 94.488 ns/op 0.91
LinkedList of 16000 items push then pop 8.2440 ns/op 8.8290 ns/op 0.93
array of 24000 items push then shift 2.4390 us/op 2.5631 us/op 0.95
LinkedList of 24000 items push then shift 8.3490 ns/op 9.4140 ns/op 0.89
array of 24000 items push then pop 118.88 ns/op 129.34 ns/op 0.92
LinkedList of 24000 items push then pop 7.8650 ns/op 9.1640 ns/op 0.86
intersect bitArray bitLen 8 6.3500 ns/op 6.9300 ns/op 0.92
intersect array and set length 8 38.146 ns/op 50.464 ns/op 0.76
intersect bitArray bitLen 128 29.672 ns/op 32.303 ns/op 0.92
intersect array and set length 128 633.73 ns/op 726.39 ns/op 0.87
bitArray.getTrueBitIndexes() bitLen 128 1.0340 us/op 1.3050 us/op 0.79
bitArray.getTrueBitIndexes() bitLen 248 1.8310 us/op 2.2570 us/op 0.81
bitArray.getTrueBitIndexes() bitLen 512 3.9580 us/op 4.4810 us/op 0.88
Buffer.concat 32 items 622.00 ns/op 654.00 ns/op 0.95
Uint8Array.set 32 items 1.0010 us/op 2.5170 us/op 0.40
Buffer.copy 1.9940 us/op 3.2550 us/op 0.61
Uint8Array.set - with subarray 1.6730 us/op 3.4050 us/op 0.49
Uint8Array.set - without subarray 886.00 ns/op 2.2820 us/op 0.39
getUint32 - dataview 198.00 ns/op 215.00 ns/op 0.92
getUint32 - manual 121.00 ns/op 133.00 ns/op 0.91
Set add up to 64 items then delete first 3.2705 us/op 2.1531 us/op 1.52
OrderedSet add up to 64 items then delete first 4.2939 us/op 4.5358 us/op 0.95
Set add up to 64 items then delete last 3.3791 us/op 2.4527 us/op 1.38
OrderedSet add up to 64 items then delete last 5.5407 us/op 4.6590 us/op 1.19
Set add up to 64 items then delete middle 3.1497 us/op 2.7449 us/op 1.15
OrderedSet add up to 64 items then delete middle 7.0546 us/op 6.5670 us/op 1.07
Set add up to 128 items then delete first 6.9385 us/op 5.9950 us/op 1.16
OrderedSet add up to 128 items then delete first 11.521 us/op 8.8666 us/op 1.30
Set add up to 128 items then delete last 6.9710 us/op 6.6276 us/op 1.05
OrderedSet add up to 128 items then delete last 11.936 us/op 10.708 us/op 1.11
Set add up to 128 items then delete middle 7.0515 us/op 6.5754 us/op 1.07
OrderedSet add up to 128 items then delete middle 19.656 us/op 17.637 us/op 1.11
Set add up to 256 items then delete first 16.124 us/op 13.352 us/op 1.21
OrderedSet add up to 256 items then delete first 24.028 us/op 18.713 us/op 1.28
Set add up to 256 items then delete last 14.204 us/op 13.221 us/op 1.07
OrderedSet add up to 256 items then delete last 20.904 us/op 20.433 us/op 1.02
Set add up to 256 items then delete middle 14.455 us/op 13.920 us/op 1.04
OrderedSet add up to 256 items then delete middle 48.675 us/op 47.733 us/op 1.02
transfer serialized Status (84 B) 2.2020 us/op 3.1220 us/op 0.71
copy serialized Status (84 B) 1.1320 us/op 1.8540 us/op 0.61
transfer serialized SignedVoluntaryExit (112 B) 2.2320 us/op 2.9160 us/op 0.77
copy serialized SignedVoluntaryExit (112 B) 1.1410 us/op 1.7210 us/op 0.66
transfer serialized ProposerSlashing (416 B) 2.2710 us/op 3.8750 us/op 0.59
copy serialized ProposerSlashing (416 B) 1.4970 us/op 2.4210 us/op 0.62
transfer serialized Attestation (485 B) 3.4160 us/op 3.3790 us/op 1.01
copy serialized Attestation (485 B) 1.3490 us/op 2.5060 us/op 0.54
transfer serialized AttesterSlashing (33232 B) 2.4100 us/op 3.3590 us/op 0.72
copy serialized AttesterSlashing (33232 B) 4.2390 us/op 6.1050 us/op 0.69
transfer serialized Small SignedBeaconBlock (128000 B) 2.9750 us/op 3.7690 us/op 0.79
copy serialized Small SignedBeaconBlock (128000 B) 11.917 us/op 16.195 us/op 0.74
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2880 us/op 4.2080 us/op 0.78
copy serialized Avg SignedBeaconBlock (200000 B) 19.659 us/op 24.545 us/op 0.80
transfer serialized BlobsSidecar (524380 B) 3.6760 us/op 4.6470 us/op 0.79
copy serialized BlobsSidecar (524380 B) 119.04 us/op 103.80 us/op 1.15
transfer serialized Big SignedBeaconBlock (1000000 B) 4.0580 us/op 4.8510 us/op 0.84
copy serialized Big SignedBeaconBlock (1000000 B) 266.09 us/op 159.78 us/op 1.67
pass gossip attestations to forkchoice per slot 2.8869 ms/op 2.8994 ms/op 1.00
forkChoice updateHead vc 100000 bc 64 eq 0 454.60 us/op 484.29 us/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 0 3.6736 ms/op 3.1860 ms/op 1.15
forkChoice updateHead vc 1000000 bc 64 eq 0 6.2763 ms/op 5.8463 ms/op 1.07
forkChoice updateHead vc 600000 bc 320 eq 0 3.1385 ms/op 3.4299 ms/op 0.92
forkChoice updateHead vc 600000 bc 1200 eq 0 3.1714 ms/op 3.6308 ms/op 0.87
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2568 ms/op 3.9284 ms/op 0.83
forkChoice updateHead vc 600000 bc 64 eq 1000 10.627 ms/op 11.124 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 10000 10.574 ms/op 11.232 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 300000 14.004 ms/op 16.413 ms/op 0.85
computeDeltas 500000 validators 300 proto nodes 4.2043 ms/op 4.2738 ms/op 0.98
computeDeltas 500000 validators 1200 proto nodes 4.1671 ms/op 4.3230 ms/op 0.96
computeDeltas 500000 validators 7200 proto nodes 4.3027 ms/op 4.2512 ms/op 1.01
computeDeltas 750000 validators 300 proto nodes 6.3344 ms/op 6.3509 ms/op 1.00
computeDeltas 750000 validators 1200 proto nodes 6.0789 ms/op 6.4129 ms/op 0.95
computeDeltas 750000 validators 7200 proto nodes 5.8417 ms/op 6.1393 ms/op 0.95
computeDeltas 1400000 validators 300 proto nodes 10.946 ms/op 11.286 ms/op 0.97
computeDeltas 1400000 validators 1200 proto nodes 10.692 ms/op 11.222 ms/op 0.95
computeDeltas 1400000 validators 7200 proto nodes 10.695 ms/op 11.423 ms/op 0.94
computeDeltas 2100000 validators 300 proto nodes 16.189 ms/op 17.166 ms/op 0.94
computeDeltas 2100000 validators 1200 proto nodes 15.992 ms/op 17.447 ms/op 0.92
computeDeltas 2100000 validators 7200 proto nodes 15.894 ms/op 18.498 ms/op 0.86
altair processAttestation - 250000 vs - 7PWei normalcase 1.9223 ms/op 3.1650 ms/op 0.61
altair processAttestation - 250000 vs - 7PWei worstcase 2.7788 ms/op 4.1796 ms/op 0.66
altair processAttestation - setStatus - 1/6 committees join 112.07 us/op 135.12 us/op 0.83
altair processAttestation - setStatus - 1/3 committees join 224.77 us/op 257.66 us/op 0.87
altair processAttestation - setStatus - 1/2 committees join 319.83 us/op 354.52 us/op 0.90
altair processAttestation - setStatus - 2/3 committees join 407.22 us/op 451.17 us/op 0.90
altair processAttestation - setStatus - 4/5 committees join 557.87 us/op 621.91 us/op 0.90
altair processAttestation - setStatus - 100% committees join 662.47 us/op 727.79 us/op 0.91
altair processBlock - 250000 vs - 7PWei normalcase 4.1079 ms/op 4.8239 ms/op 0.85
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.393 ms/op 30.370 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase 32.583 ms/op 37.938 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase hashState 67.816 ms/op 81.515 ms/op 0.83
phase0 processBlock - 250000 vs - 7PWei normalcase 1.5511 ms/op 1.5719 ms/op 0.99
phase0 processBlock - 250000 vs - 7PWei worstcase 18.950 ms/op 20.774 ms/op 0.91
altair processEth1Data - 250000 vs - 7PWei normalcase 330.89 us/op 373.44 us/op 0.89
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 6.5100 us/op 5.8590 us/op 1.11
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 34.171 us/op 35.390 us/op 0.97
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.5110 us/op 11.004 us/op 0.86
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9310 us/op 6.5140 us/op 0.91
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 137.65 us/op 157.03 us/op 0.88
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.7156 ms/op 1.9021 ms/op 0.90
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.2020 ms/op 2.4669 ms/op 0.89
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.2207 ms/op 2.4102 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.4071 ms/op 4.8598 ms/op 0.91
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3074 ms/op 2.4211 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.4697 ms/op 4.7067 ms/op 0.95
Tree 40 250000 create 420.29 ms/op 414.25 ms/op 1.01
Tree 40 250000 get(125000) 139.57 ns/op 146.26 ns/op 0.95
Tree 40 250000 set(125000) 1.4672 us/op 1.4516 us/op 1.01
Tree 40 250000 toArray() 14.828 ms/op 14.906 ms/op 0.99
Tree 40 250000 iterate all - toArray() + loop 14.744 ms/op 18.064 ms/op 0.82
Tree 40 250000 iterate all - get(i) 52.860 ms/op 51.321 ms/op 1.03
Array 250000 create 2.3115 ms/op 2.6384 ms/op 0.88
Array 250000 clone - spread 776.61 us/op 793.43 us/op 0.98
Array 250000 get(125000) 0.40000 ns/op 0.39500 ns/op 1.01
Array 250000 set(125000) 0.42500 ns/op 0.41000 ns/op 1.04
Array 250000 iterate all - loop 81.344 us/op 80.046 us/op 1.02
phase0 afterProcessEpoch - 250000 vs - 7PWei 41.376 ms/op 41.663 ms/op 0.99
Array.fill - length 1000000 3.3701 ms/op 3.3521 ms/op 1.01
Array push - length 1000000 11.997 ms/op 12.030 ms/op 1.00
Array.get 0.26326 ns/op 0.26889 ns/op 0.98
Uint8Array.get 0.42491 ns/op 0.43578 ns/op 0.98
phase0 beforeProcessEpoch - 250000 vs - 7PWei 14.778 ms/op 15.186 ms/op 0.97
altair processEpoch - mainnet_e81889 267.95 ms/op 257.73 ms/op 1.04
mainnet_e81889 - altair beforeProcessEpoch 18.115 ms/op 18.323 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 5.1970 us/op 5.5370 us/op 0.94
mainnet_e81889 - altair processInactivityUpdates 4.0256 ms/op 4.2354 ms/op 0.95
mainnet_e81889 - altair processRewardsAndPenalties 38.742 ms/op 39.466 ms/op 0.98
mainnet_e81889 - altair processRegistryUpdates 670.00 ns/op 717.00 ns/op 0.93
mainnet_e81889 - altair processSlashings 180.00 ns/op 183.00 ns/op 0.98
mainnet_e81889 - altair processEth1DataReset 176.00 ns/op 178.00 ns/op 0.99
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2975 ms/op 1.2208 ms/op 1.06
mainnet_e81889 - altair processSlashingsReset 842.00 ns/op 891.00 ns/op 0.95
mainnet_e81889 - altair processRandaoMixesReset 1.1300 us/op 1.1540 us/op 0.98
mainnet_e81889 - altair processHistoricalRootsUpdate 180.00 ns/op 180.00 ns/op 1.00
mainnet_e81889 - altair processParticipationFlagUpdates 498.00 ns/op 513.00 ns/op 0.97
mainnet_e81889 - altair processSyncCommitteeUpdates 142.00 ns/op 142.00 ns/op 1.00
mainnet_e81889 - altair afterProcessEpoch 43.839 ms/op 44.473 ms/op 0.99
capella processEpoch - mainnet_e217614 945.69 ms/op 993.41 ms/op 0.95
mainnet_e217614 - capella beforeProcessEpoch 58.062 ms/op 59.245 ms/op 0.98
mainnet_e217614 - capella processJustificationAndFinalization 5.2470 us/op 5.4480 us/op 0.96
mainnet_e217614 - capella processInactivityUpdates 14.105 ms/op 14.174 ms/op 1.00
mainnet_e217614 - capella processRewardsAndPenalties 185.87 ms/op 168.66 ms/op 1.10
mainnet_e217614 - capella processRegistryUpdates 6.3620 us/op 6.3770 us/op 1.00
mainnet_e217614 - capella processSlashings 181.00 ns/op 182.00 ns/op 0.99
mainnet_e217614 - capella processEth1DataReset 181.00 ns/op 177.00 ns/op 1.02
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.3338 ms/op 4.2918 ms/op 1.01
mainnet_e217614 - capella processSlashingsReset 881.00 ns/op 882.00 ns/op 1.00
mainnet_e217614 - capella processRandaoMixesReset 1.3180 us/op 1.1820 us/op 1.12
mainnet_e217614 - capella processHistoricalRootsUpdate 185.00 ns/op 183.00 ns/op 1.01
mainnet_e217614 - capella processParticipationFlagUpdates 517.00 ns/op 528.00 ns/op 0.98
mainnet_e217614 - capella afterProcessEpoch 114.58 ms/op 117.02 ms/op 0.98
phase0 processEpoch - mainnet_e58758 281.19 ms/op 284.14 ms/op 0.99
mainnet_e58758 - phase0 beforeProcessEpoch 67.317 ms/op 75.536 ms/op 0.89
mainnet_e58758 - phase0 processJustificationAndFinalization 5.4420 us/op 5.8020 us/op 0.94
mainnet_e58758 - phase0 processRewardsAndPenalties 34.127 ms/op 34.572 ms/op 0.99
mainnet_e58758 - phase0 processRegistryUpdates 3.0050 us/op 3.1690 us/op 0.95
mainnet_e58758 - phase0 processSlashings 181.00 ns/op 180.00 ns/op 1.01
mainnet_e58758 - phase0 processEth1DataReset 178.00 ns/op 177.00 ns/op 1.01
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1572 ms/op 1.2296 ms/op 0.94
mainnet_e58758 - phase0 processSlashingsReset 916.00 ns/op 934.00 ns/op 0.98
mainnet_e58758 - phase0 processRandaoMixesReset 1.1720 us/op 1.4280 us/op 0.82
mainnet_e58758 - phase0 processHistoricalRootsUpdate 181.00 ns/op 183.00 ns/op 0.99
mainnet_e58758 - phase0 processParticipationRecordUpdates 860.00 ns/op 919.00 ns/op 0.94
mainnet_e58758 - phase0 afterProcessEpoch 35.777 ms/op 36.677 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3421 ms/op 2.3688 ms/op 0.57
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.9976 ms/op 2.4044 ms/op 0.83
altair processInactivityUpdates - 250000 normalcase 17.330 ms/op 18.788 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 17.935 ms/op 17.528 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 6.2860 us/op 6.9990 us/op 0.90
phase0 processRegistryUpdates - 250000 badcase_full_deposits 256.35 us/op 270.87 us/op 0.95
phase0 processRegistryUpdates - 250000 worstcase 0.5 97.864 ms/op 97.175 ms/op 1.01
altair processRewardsAndPenalties - 250000 normalcase 24.402 ms/op 26.735 ms/op 0.91
altair processRewardsAndPenalties - 250000 worstcase 24.832 ms/op 25.783 ms/op 0.96
phase0 getAttestationDeltas - 250000 normalcase 7.2698 ms/op 8.0280 ms/op 0.91
phase0 getAttestationDeltas - 250000 worstcase 5.8675 ms/op 6.0929 ms/op 0.96
phase0 processSlashings - 250000 worstcase 83.599 us/op 89.289 us/op 0.94
altair processSyncCommitteeUpdates - 250000 10.921 ms/op 10.958 ms/op 1.00
BeaconState.hashTreeRoot - No change 216.00 ns/op 216.00 ns/op 1.00
BeaconState.hashTreeRoot - 1 full validator 86.133 us/op 74.439 us/op 1.16
BeaconState.hashTreeRoot - 32 full validator 935.29 us/op 763.93 us/op 1.22
BeaconState.hashTreeRoot - 512 full validator 9.3991 ms/op 11.348 ms/op 0.83
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 90.349 us/op 96.517 us/op 0.94
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.2806 ms/op 1.6165 ms/op 0.79
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 18.431 ms/op 21.390 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 71.639 us/op 87.630 us/op 0.82
BeaconState.hashTreeRoot - 32 balances 905.44 us/op 798.83 us/op 1.13
BeaconState.hashTreeRoot - 512 balances 8.9822 ms/op 8.4703 ms/op 1.06
BeaconState.hashTreeRoot - 250000 balances 160.52 ms/op 181.51 ms/op 0.88
aggregationBits - 2048 els - zipIndexesInBitList 20.951 us/op 22.070 us/op 0.95
byteArrayEquals 32 52.412 ns/op 54.067 ns/op 0.97
Buffer.compare 32 16.899 ns/op 19.805 ns/op 0.85
byteArrayEquals 1024 1.5589 us/op 1.6109 us/op 0.97
Buffer.compare 1024 25.470 ns/op 29.552 ns/op 0.86
byteArrayEquals 16384 25.148 us/op 25.634 us/op 0.98
Buffer.compare 16384 197.62 ns/op 199.05 ns/op 0.99
byteArrayEquals 123687377 190.94 ms/op 192.50 ms/op 0.99
Buffer.compare 123687377 6.2269 ms/op 6.5627 ms/op 0.95
byteArrayEquals 32 - diff last byte 52.137 ns/op 52.661 ns/op 0.99
Buffer.compare 32 - diff last byte 17.131 ns/op 17.115 ns/op 1.00
byteArrayEquals 1024 - diff last byte 1.5705 us/op 1.5918 us/op 0.99
Buffer.compare 1024 - diff last byte 26.197 ns/op 25.134 ns/op 1.04
byteArrayEquals 16384 - diff last byte 24.991 us/op 25.331 us/op 0.99
Buffer.compare 16384 - diff last byte 198.12 ns/op 184.71 ns/op 1.07
byteArrayEquals 123687377 - diff last byte 185.70 ms/op 191.66 ms/op 0.97
Buffer.compare 123687377 - diff last byte 6.1359 ms/op 6.5021 ms/op 0.94
byteArrayEquals 32 - random bytes 4.9910 ns/op 4.9940 ns/op 1.00
Buffer.compare 32 - random bytes 17.022 ns/op 17.067 ns/op 1.00
byteArrayEquals 1024 - random bytes 4.9950 ns/op 5.0980 ns/op 0.98
Buffer.compare 1024 - random bytes 17.001 ns/op 17.250 ns/op 0.99
byteArrayEquals 16384 - random bytes 4.9970 ns/op 5.1320 ns/op 0.97
Buffer.compare 16384 - random bytes 17.022 ns/op 17.321 ns/op 0.98
byteArrayEquals 123687377 - random bytes 6.2100 ns/op 6.6300 ns/op 0.94
Buffer.compare 123687377 - random bytes 18.460 ns/op 18.420 ns/op 1.00
regular array get 100000 times 32.254 us/op 36.618 us/op 0.88
wrappedArray get 100000 times 32.255 us/op 33.324 us/op 0.97
arrayWithProxy get 100000 times 13.377 ms/op 14.010 ms/op 0.95
ssz.Root.equals 45.319 ns/op 46.654 ns/op 0.97
byteArrayEquals 44.475 ns/op 45.822 ns/op 0.97
Buffer.compare 10.218 ns/op 10.393 ns/op 0.98
processSlot - 1 slots 10.448 us/op 10.060 us/op 1.04
processSlot - 32 slots 2.5873 ms/op 1.9589 ms/op 1.32
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 2.8220 ms/op 2.9243 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 2.0905 ms/op 2.1272 ms/op 0.98
getCommitteeAssignments - req 100 vs - 250000 vc 4.0198 ms/op 4.1046 ms/op 0.98
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2955 ms/op 4.4973 ms/op 0.96
findModifiedValidators - 10000 modified validators 726.76 ms/op 730.20 ms/op 1.00
findModifiedValidators - 1000 modified validators 692.00 ms/op 700.86 ms/op 0.99
findModifiedValidators - 100 modified validators 280.38 ms/op 274.39 ms/op 1.02
findModifiedValidators - 10 modified validators 133.99 ms/op 222.08 ms/op 0.60
findModifiedValidators - 1 modified validators 139.04 ms/op 167.15 ms/op 0.83
findModifiedValidators - no difference 180.06 ms/op 156.17 ms/op 1.15
compare ViewDUs 5.9159 s/op 6.1525 s/op 0.96
compare each validator Uint8Array 1.4578 s/op 1.5763 s/op 0.92
compare ViewDU to Uint8Array 943.09 ms/op 1.1064 s/op 0.85
migrate state 1000000 validators, 24 modified, 0 new 736.69 ms/op 749.54 ms/op 0.98
migrate state 1000000 validators, 1700 modified, 1000 new 1.1193 s/op 1.1232 s/op 1.00
migrate state 1000000 validators, 3400 modified, 2000 new 1.1599 s/op 1.3103 s/op 0.89
migrate state 1500000 validators, 24 modified, 0 new 766.32 ms/op 891.43 ms/op 0.86
migrate state 1500000 validators, 1700 modified, 1000 new 1.0892 s/op 1.0164 s/op 1.07
migrate state 1500000 validators, 3400 modified, 2000 new 1.1530 s/op 1.3434 s/op 0.86
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1500 ns/op 4.4500 ns/op 0.93
state getBlockRootAtSlot - 250000 vs - 7PWei 561.36 ns/op 618.99 ns/op 0.91
naive computeProposerIndex 100000 validators 47.418 ms/op 61.052 ms/op 0.78
computeProposerIndex 100000 validators 1.4806 ms/op 1.6360 ms/op 0.91
naiveGetNextSyncCommitteeIndices 1000 validators 7.1834 s/op 8.6133 s/op 0.83
getNextSyncCommitteeIndices 1000 validators 106.44 ms/op 126.65 ms/op 0.84
naiveGetNextSyncCommitteeIndices 10000 validators 7.6031 s/op 8.3521 s/op 0.91
getNextSyncCommitteeIndices 10000 validators 110.54 ms/op 129.54 ms/op 0.85
naiveGetNextSyncCommitteeIndices 100000 validators 7.6620 s/op 8.6709 s/op 0.88
getNextSyncCommitteeIndices 100000 validators 109.93 ms/op 140.37 ms/op 0.78
naive computeShuffledIndex 100000 validators 22.851 s/op 28.035 s/op 0.82
cached computeShuffledIndex 100000 validators 531.50 ms/op 595.32 ms/op 0.89
naive computeShuffledIndex 2000000 validators 502.33 s/op 491.74 s/op 1.02
cached computeShuffledIndex 2000000 validators 31.909 s/op 35.142 s/op 0.91
computeProposers - vc 250000 617.86 us/op 634.60 us/op 0.97
computeEpochShuffling - vc 250000 41.090 ms/op 42.260 ms/op 0.97
getNextSyncCommittee - vc 250000 10.313 ms/op 10.867 ms/op 0.95
computeSigningRoot for AttestationData 19.867 us/op 22.839 us/op 0.87
hash AttestationData serialized data then Buffer.toString(base64) 2.1873 us/op 1.6008 us/op 1.37
toHexString serialized data 5.8714 us/op 1.1990 us/op 4.90
Buffer.toString(base64) 215.90 ns/op 153.55 ns/op 1.41
nodejs block root to RootHex using toHex 214.81 ns/op 141.82 ns/op 1.51
nodejs block root to RootHex using toRootHex 148.57 ns/op 90.634 ns/op 1.64
browser block root to RootHex using the deprecated toHexString 396.36 ns/op 210.27 ns/op 1.89
browser block root to RootHex using toHex 274.53 ns/op 170.42 ns/op 1.61
browser block root to RootHex using toRootHex 219.52 ns/op 159.01 ns/op 1.38

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review July 30, 2025 05:49
@twoeths twoeths requested a review from a team as a code owner July 30, 2025 05:49

const notSeenCommitteeMembers = new Set<number>();
for (const [i, validatorIndex] of committee.entries()) {
for (const [committeeValidatorIndex, validatorIndex] of committee.entries()) {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be called validatorCommitteeIndex, ie. the position of the validator in the committee

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just checked unstable, we both have committeeValidatorIndex and validatorCommitteeIndex
do you know if it's specified somewhere in the spec?

Copy link
Contributor

Choose a reason for hiding this comment

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

just checked unstable, we both have committeeValidatorIndex and validatorCommitteeIndex do you know if it's specified somewhere in the spec?

@twoeths I think we were trying to establish the naming convention in #7687

// we will update it, so that we only scan not seen validators through SingleAttestationPool
// null means all seen
const notSeenCommitteeMembersByIndex = new Map<CommitteeIndex, Set<CommitteeValidatorIndex> | null>();

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to add a comment stating that stateSlot and slot check (eg. slot + MIN_ATTESTATION_INCLUSION_DELAY <= stateSlot) are performed by the caller. Here we assume we have valid stateSlot and slot

totalAttestationsPerSlot
);

return {consolidations, notSeenCommitteeMembersByIndex};
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we limit the size of consolidations to MAX_ATTESTATIONS_ELECTRA * 2 like what we did in getAttestationsForBlockElectra?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I move it to the consumer of this method https://github.com/ChainSafe/lodestar/pull/8076/files#diff-9e94c5ee6b4110e7f2209f65519336c9e0b2c293ee781ed6389497a6bf85eee7R122

since there are too many consolidation from the SingleAttestation pool I increased it to MAX_ATTESTATIONS_ELECTRA * 3

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.

3 participants