Skip to content

Conversation

wemeetagain
Copy link
Member

Motivation

Our syncing processes have become quite convoluted over time. We need to think more deeply about how we can reliably sync even or especially in a forky network.

This is a first step towards rethinking our syncing.

Our problem currently is that the intended purposes and algorithms of our syncing processes have become combined and no longer make sense. Our UnknownBlockSync started as a way to download blocks with unknown parents "backwards" parent-by-parent. Then blob and column fetching got bolted on the side. More can be said about this, but we should treat data availability fetching separately from linking unknown blocks to our chain. We should also perform non-finalized forwards-sync by-root rather than by-range.

Description

Independent of block/blob/column caching, the job of an "unknown block" sync is to handle the cases where we receive a block/sidecar/block root/etc that references a block that is not in our fork choice. This sync process should track these unknown headers, and build header chains backwards (going parent by parent), until either the chain is deemed irrelevant or is linked to our chain's fork choice.

This is an implementation of such a sync process -- UnknownChainSync

It is intentionally simplistic in order to have a data model that is coherent and can be reasoned about fairly simply.
It intentionally does not maintain full blocks in order to support syncing extended periods of non-finality without OOMing.

  • The UnknownChainSync maintains a set of BackwardsChain objects that it advances backwards and eventually links to the current chain.
  • BackwardsChain objects maintain a chain of headers backwards as well as a set of peers to pull from.
  • BackwardsChain can be in one of three different states:
    • UnknownHead - Only a lone block root is known. Eg: A peer status refers to a root we don't know. An attestation refers to a root we don't know. After feeding that root here, if it was a newly seen root, it would create a chain in this state.
    • UnknownAncestor - A chain of headers is known, but the earliest ancestor is not known. A BackwardsChain transitions from UnknownHead to UnknownAncestor after it has been advanced.
    • Linked - A chain of headers is known and has been verified to be linked to our known chain -- either in our fork choice or known-to-be before our finalization epoch. Upon becoming Linked, the chain reorganizes the backwards linked-list into a forwards list suitable for use in a forward syncing process.
  • The UnknownChainSync uses a JobItemQueue to manage concurrency of advancement of the managed BackwardsChains. (TODO expose the queue params as makes sense).
  • The UnknownChainSync listens to network peerConnect/peerDisconnect events to update peers and statuses, managing peer sets per BackwardsChain
  • The UnknownChainSync listens to chain block and forkChoiceFinalized events to prune and link BackwardsChains
  • The onUnknownBlockRoot and onUnknownBlockInput functions can be used to feed new unknown block root / headers into BackwardsChains manually
  • Peers are currently shuffled before fetching the next block. (can make this more sophisticated as needed)
  • Once a BackwardsChain becomes linked, a callback processLinkedChain is called on the chain. It is intended that a callback to push work onto a forwards-sync process would be passed here.

Copy link
Contributor

github-actions bot commented Aug 19, 2025

⚠️ 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: 142f7e1 Previous: 8d743ff Ratio
phase0 getAttestationDeltas - 250000 worstcase 23.987 ms/op 6.5892 ms/op 3.64
Full benchmark results
Benchmark suite Current: 142f7e1 Previous: 8d743ff Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.0013 ms/op 990.33 us/op 1.01
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 37.593 us/op 36.472 us/op 1.03
BLS verify - blst 873.73 us/op 976.17 us/op 0.90
BLS verifyMultipleSignatures 3 - blst 1.2215 ms/op 1.2597 ms/op 0.97
BLS verifyMultipleSignatures 8 - blst 1.8042 ms/op 1.8944 ms/op 0.95
BLS verifyMultipleSignatures 32 - blst 4.9520 ms/op 5.8783 ms/op 0.84
BLS verifyMultipleSignatures 64 - blst 9.2553 ms/op 10.875 ms/op 0.85
BLS verifyMultipleSignatures 128 - blst 17.900 ms/op 17.386 ms/op 1.03
BLS deserializing 10000 signatures 707.38 ms/op 695.77 ms/op 1.02
BLS deserializing 100000 signatures 7.0092 s/op 6.9864 s/op 1.00
BLS verifyMultipleSignatures - same message - 3 - blst 905.15 us/op 990.79 us/op 0.91
BLS verifyMultipleSignatures - same message - 8 - blst 1.0064 ms/op 1.0721 ms/op 0.94
BLS verifyMultipleSignatures - same message - 32 - blst 1.7221 ms/op 1.7461 ms/op 0.99
BLS verifyMultipleSignatures - same message - 64 - blst 2.6131 ms/op 2.9987 ms/op 0.87
BLS verifyMultipleSignatures - same message - 128 - blst 4.4016 ms/op 4.4633 ms/op 0.99
BLS aggregatePubkeys 32 - blst 19.583 us/op 21.157 us/op 0.93
BLS aggregatePubkeys 128 - blst 70.189 us/op 71.051 us/op 0.99
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 50.008 ms/op 59.274 ms/op 0.84
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 45.151 ms/op 56.395 ms/op 0.80
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 36.785 ms/op 47.796 ms/op 0.77
getSlashingsAndExits - default max 72.691 us/op 82.536 us/op 0.88
getSlashingsAndExits - 2k 289.60 us/op 416.54 us/op 0.70
proposeBlockBody type=full, size=empty 6.7961 ms/op 6.3221 ms/op 1.07
isKnown best case - 1 super set check 218.00 ns/op 228.00 ns/op 0.96
isKnown normal case - 2 super set checks 216.00 ns/op 213.00 ns/op 1.01
isKnown worse case - 16 super set checks 214.00 ns/op 213.00 ns/op 1.00
InMemoryCheckpointStateCache - add get delete 2.4210 us/op 2.5460 us/op 0.95
validate api signedAggregateAndProof - struct 1.4024 ms/op 1.8045 ms/op 0.78
validate gossip signedAggregateAndProof - struct 1.3827 ms/op 1.6310 ms/op 0.85
batch validate gossip attestation - vc 640000 - chunk 32 120.56 us/op 121.59 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 108.14 us/op 104.82 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 128 102.01 us/op 107.26 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 256 117.24 us/op 105.42 us/op 1.11
pickEth1Vote - no votes 1.0548 ms/op 1.0248 ms/op 1.03
pickEth1Vote - max votes 7.2884 ms/op 8.9030 ms/op 0.82
pickEth1Vote - Eth1Data hashTreeRoot value x2048 20.484 ms/op 12.708 ms/op 1.61
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 31.999 ms/op 21.665 ms/op 1.48
pickEth1Vote - Eth1Data fastSerialize value x2048 567.52 us/op 444.83 us/op 1.28
pickEth1Vote - Eth1Data fastSerialize tree x2048 2.7951 ms/op 4.4991 ms/op 0.62
bytes32 toHexString 477.00 ns/op 383.00 ns/op 1.25
bytes32 Buffer.toString(hex) 277.00 ns/op 328.00 ns/op 0.84
bytes32 Buffer.toString(hex) from Uint8Array 452.00 ns/op 407.00 ns/op 1.11
bytes32 Buffer.toString(hex) + 0x 375.00 ns/op 314.00 ns/op 1.19
Object access 1 prop 0.18900 ns/op 0.13400 ns/op 1.41
Map access 1 prop 0.25400 ns/op 0.13300 ns/op 1.91
Object get x1000 10.765 ns/op 6.5890 ns/op 1.63
Map get x1000 8.1140 ns/op 6.6790 ns/op 1.21
Object set x1000 44.276 ns/op 32.070 ns/op 1.38
Map set x1000 29.810 ns/op 21.682 ns/op 1.37
Return object 10000 times 0.38970 ns/op 0.30160 ns/op 1.29
Throw Error 10000 times 4.7246 us/op 5.4543 us/op 0.87
toHex 148.36 ns/op 206.21 ns/op 0.72
Buffer.from 124.36 ns/op 131.60 ns/op 0.94
shared Buffer 87.935 ns/op 95.555 ns/op 0.92
fastMsgIdFn sha256 / 200 bytes 2.2780 us/op 2.3010 us/op 0.99
fastMsgIdFn h32 xxhash / 200 bytes 211.00 ns/op 219.00 ns/op 0.96
fastMsgIdFn h64 xxhash / 200 bytes 344.00 ns/op 406.00 ns/op 0.85
fastMsgIdFn sha256 / 1000 bytes 7.6590 us/op 7.5330 us/op 1.02
fastMsgIdFn h32 xxhash / 1000 bytes 350.00 ns/op 456.00 ns/op 0.77
fastMsgIdFn h64 xxhash / 1000 bytes 352.00 ns/op 486.00 ns/op 0.72
fastMsgIdFn sha256 / 10000 bytes 68.765 us/op 67.796 us/op 1.01
fastMsgIdFn h32 xxhash / 10000 bytes 1.9660 us/op 1.9330 us/op 1.02
fastMsgIdFn h64 xxhash / 10000 bytes 1.3000 us/op 1.2950 us/op 1.00
send data - 1000 256B messages 20.291 ms/op 18.450 ms/op 1.10
send data - 1000 512B messages 24.782 ms/op 23.332 ms/op 1.06
send data - 1000 1024B messages 34.544 ms/op 29.514 ms/op 1.17
send data - 1000 1200B messages 28.363 ms/op 32.252 ms/op 0.88
send data - 1000 2048B messages 33.064 ms/op 26.008 ms/op 1.27
send data - 1000 4096B messages 34.003 ms/op 29.435 ms/op 1.16
send data - 1000 16384B messages 53.885 ms/op 46.369 ms/op 1.16
send data - 1000 65536B messages 138.41 ms/op 124.54 ms/op 1.11
enrSubnets - fastDeserialize 64 bits 1.0350 us/op 956.00 ns/op 1.08
enrSubnets - ssz BitVector 64 bits 346.00 ns/op 341.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 136.00 ns/op 171.00 ns/op 0.80
enrSubnets - ssz BitVector 4 bits 337.00 ns/op 367.00 ns/op 0.92
prioritizePeers score -10:0 att 32-0.1 sync 2-0 155.13 us/op 134.00 us/op 1.16
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 213.78 us/op 161.10 us/op 1.33
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 237.61 us/op 219.65 us/op 1.08
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 436.52 us/op 399.09 us/op 1.09
prioritizePeers score 0:0 att 64-1 sync 4-1 552.12 us/op 486.31 us/op 1.14
array of 16000 items push then shift 2.4718 us/op 1.6261 us/op 1.52
LinkedList of 16000 items push then shift 9.7620 ns/op 7.5300 ns/op 1.30
array of 16000 items push then pop 88.458 ns/op 80.435 ns/op 1.10
LinkedList of 16000 items push then pop 8.5720 ns/op 7.5170 ns/op 1.14
array of 24000 items push then shift 2.8317 us/op 2.4918 us/op 1.14
LinkedList of 24000 items push then shift 10.517 ns/op 8.4500 ns/op 1.24
array of 24000 items push then pop 141.57 ns/op 109.34 ns/op 1.29
LinkedList of 24000 items push then pop 15.654 ns/op 7.7420 ns/op 2.02
intersect bitArray bitLen 8 9.0210 ns/op 6.5130 ns/op 1.39
intersect array and set length 8 45.670 ns/op 38.672 ns/op 1.18
intersect bitArray bitLen 128 34.644 ns/op 30.379 ns/op 1.14
intersect array and set length 128 740.82 ns/op 641.59 ns/op 1.15
bitArray.getTrueBitIndexes() bitLen 128 1.1750 us/op 1.0400 us/op 1.13
bitArray.getTrueBitIndexes() bitLen 248 2.1700 us/op 1.8240 us/op 1.19
bitArray.getTrueBitIndexes() bitLen 512 4.5500 us/op 3.9090 us/op 1.16
Buffer.concat 32 items 1.2560 us/op 687.00 ns/op 1.83
Uint8Array.set 32 items 1.0220 us/op 1.0220 us/op 1.00
Buffer.copy 2.5890 us/op 2.1640 us/op 1.20
Uint8Array.set - with subarray 1.7720 us/op 1.5610 us/op 1.14
Uint8Array.set - without subarray 1.2510 us/op 1.0740 us/op 1.16
getUint32 - dataview 208.00 ns/op 199.00 ns/op 1.05
getUint32 - manual 136.00 ns/op 128.00 ns/op 1.06
Set add up to 64 items then delete first 3.6259 us/op 2.4042 us/op 1.51
OrderedSet add up to 64 items then delete first 5.4027 us/op 3.4024 us/op 1.59
Set add up to 64 items then delete last 4.2755 us/op 2.6783 us/op 1.60
OrderedSet add up to 64 items then delete last 6.5874 us/op 4.1147 us/op 1.60
Set add up to 64 items then delete middle 3.7218 us/op 2.6826 us/op 1.39
OrderedSet add up to 64 items then delete middle 8.4175 us/op 5.9506 us/op 1.41
Set add up to 128 items then delete first 7.9443 us/op 5.1701 us/op 1.54
OrderedSet add up to 128 items then delete first 15.306 us/op 7.9323 us/op 1.93
Set add up to 128 items then delete last 8.4489 us/op 5.8502 us/op 1.44
OrderedSet add up to 128 items then delete last 14.733 us/op 8.5897 us/op 1.72
Set add up to 128 items then delete middle 10.007 us/op 5.1644 us/op 1.94
OrderedSet add up to 128 items then delete middle 26.003 us/op 14.665 us/op 1.77
Set add up to 256 items then delete first 15.563 us/op 10.622 us/op 1.47
OrderedSet add up to 256 items then delete first 29.888 us/op 18.333 us/op 1.63
Set add up to 256 items then delete last 22.862 us/op 10.655 us/op 2.15
OrderedSet add up to 256 items then delete last 30.312 us/op 17.038 us/op 1.78
Set add up to 256 items then delete middle 16.395 us/op 11.252 us/op 1.46
OrderedSet add up to 256 items then delete middle 57.583 us/op 42.073 us/op 1.37
transfer serialized Status (84 B) 3.3340 us/op 2.1880 us/op 1.52
copy serialized Status (84 B) 1.5900 us/op 1.1240 us/op 1.41
transfer serialized SignedVoluntaryExit (112 B) 3.7360 us/op 2.2750 us/op 1.64
copy serialized SignedVoluntaryExit (112 B) 1.9810 us/op 1.1420 us/op 1.73
transfer serialized ProposerSlashing (416 B) 2.8280 us/op 2.2940 us/op 1.23
copy serialized ProposerSlashing (416 B) 1.6100 us/op 1.3900 us/op 1.16
transfer serialized Attestation (485 B) 3.2800 us/op 2.5350 us/op 1.29
copy serialized Attestation (485 B) 2.0320 us/op 1.2710 us/op 1.60
transfer serialized AttesterSlashing (33232 B) 2.5370 us/op 2.8840 us/op 0.88
copy serialized AttesterSlashing (33232 B) 5.8050 us/op 4.2070 us/op 1.38
transfer serialized Small SignedBeaconBlock (128000 B) 3.1650 us/op 3.5010 us/op 0.90
copy serialized Small SignedBeaconBlock (128000 B) 17.018 us/op 11.724 us/op 1.45
transfer serialized Avg SignedBeaconBlock (200000 B) 4.8900 us/op 4.0490 us/op 1.21
copy serialized Avg SignedBeaconBlock (200000 B) 25.694 us/op 16.858 us/op 1.52
transfer serialized BlobsSidecar (524380 B) 4.6780 us/op 4.0600 us/op 1.15
copy serialized BlobsSidecar (524380 B) 76.523 us/op 63.058 us/op 1.21
transfer serialized Big SignedBeaconBlock (1000000 B) 6.5590 us/op 4.3620 us/op 1.50
copy serialized Big SignedBeaconBlock (1000000 B) 154.17 us/op 139.28 us/op 1.11
pass gossip attestations to forkchoice per slot 3.4171 ms/op 3.1347 ms/op 1.09
forkChoice updateHead vc 100000 bc 64 eq 0 531.13 us/op 541.25 us/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 0 3.9347 ms/op 6.1987 ms/op 0.63
forkChoice updateHead vc 1000000 bc 64 eq 0 6.2738 ms/op 10.401 ms/op 0.60
forkChoice updateHead vc 600000 bc 320 eq 0 3.5791 ms/op 6.4900 ms/op 0.55
forkChoice updateHead vc 600000 bc 1200 eq 0 3.6774 ms/op 5.9957 ms/op 0.61
forkChoice updateHead vc 600000 bc 7200 eq 0 4.2954 ms/op 5.0302 ms/op 0.85
forkChoice updateHead vc 600000 bc 64 eq 1000 11.555 ms/op 12.322 ms/op 0.94
forkChoice updateHead vc 600000 bc 64 eq 10000 12.136 ms/op 12.415 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 24.679 ms/op 85.647 ms/op 0.29
computeDeltas 500000 validators 300 proto nodes 4.4260 ms/op 6.5368 ms/op 0.68
computeDeltas 500000 validators 1200 proto nodes 4.4471 ms/op 6.4952 ms/op 0.68
computeDeltas 500000 validators 7200 proto nodes 4.2550 ms/op 6.4384 ms/op 0.66
computeDeltas 750000 validators 300 proto nodes 6.1707 ms/op 8.2491 ms/op 0.75
computeDeltas 750000 validators 1200 proto nodes 6.2631 ms/op 7.4338 ms/op 0.84
computeDeltas 750000 validators 7200 proto nodes 6.2437 ms/op 7.9987 ms/op 0.78
computeDeltas 1400000 validators 300 proto nodes 12.171 ms/op 13.465 ms/op 0.90
computeDeltas 1400000 validators 1200 proto nodes 11.881 ms/op 14.628 ms/op 0.81
computeDeltas 1400000 validators 7200 proto nodes 11.973 ms/op 11.696 ms/op 1.02
computeDeltas 2100000 validators 300 proto nodes 18.748 ms/op 18.033 ms/op 1.04
computeDeltas 2100000 validators 1200 proto nodes 19.304 ms/op 17.467 ms/op 1.11
computeDeltas 2100000 validators 7200 proto nodes 17.474 ms/op 16.828 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei normalcase 2.1583 ms/op 2.1294 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei worstcase 3.0404 ms/op 3.0333 ms/op 1.00
altair processAttestation - setStatus - 1/6 committees join 132.38 us/op 125.40 us/op 1.06
altair processAttestation - setStatus - 1/3 committees join 260.37 us/op 239.25 us/op 1.09
altair processAttestation - setStatus - 1/2 committees join 363.29 us/op 338.25 us/op 1.07
altair processAttestation - setStatus - 2/3 committees join 463.58 us/op 434.15 us/op 1.07
altair processAttestation - setStatus - 4/5 committees join 639.88 us/op 594.94 us/op 1.08
altair processAttestation - setStatus - 100% committees join 788.35 us/op 705.21 us/op 1.12
altair processBlock - 250000 vs - 7PWei normalcase 4.7969 ms/op 5.9635 ms/op 0.80
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.400 ms/op 30.347 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase 37.947 ms/op 40.668 ms/op 0.93
altair processBlock - 250000 vs - 7PWei worstcase hashState 80.695 ms/op 84.783 ms/op 0.95
phase0 processBlock - 250000 vs - 7PWei normalcase 1.7487 ms/op 2.1780 ms/op 0.80
phase0 processBlock - 250000 vs - 7PWei worstcase 23.600 ms/op 21.308 ms/op 1.11
altair processEth1Data - 250000 vs - 7PWei normalcase 361.09 us/op 342.38 us/op 1.05
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.3580 us/op 9.2120 us/op 0.80
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 45.552 us/op 58.193 us/op 0.78
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.985 us/op 20.914 us/op 0.62
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.7430 us/op 6.7830 us/op 1.14
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 205.56 us/op 186.79 us/op 1.10
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.9034 ms/op 2.2845 ms/op 0.83
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.4061 ms/op 2.4237 ms/op 0.99
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.3880 ms/op 2.4517 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.6518 ms/op 4.4395 ms/op 1.05
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.4237 ms/op 2.5007 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.6904 ms/op 4.4468 ms/op 1.05
Tree 40 250000 create 445.83 ms/op 452.56 ms/op 0.99
Tree 40 250000 get(125000) 149.40 ns/op 155.96 ns/op 0.96
Tree 40 250000 set(125000) 1.5969 us/op 1.4916 us/op 1.07
Tree 40 250000 toArray() 18.100 ms/op 17.655 ms/op 1.03
Tree 40 250000 iterate all - toArray() + loop 16.325 ms/op 19.996 ms/op 0.82
Tree 40 250000 iterate all - get(i) 56.439 ms/op 65.860 ms/op 0.86
Array 250000 create 2.5712 ms/op 2.6447 ms/op 0.97
Array 250000 clone - spread 1.4154 ms/op 1.5011 ms/op 0.94
Array 250000 get(125000) 0.43500 ns/op 0.43300 ns/op 1.00
Array 250000 set(125000) 0.45800 ns/op 0.44900 ns/op 1.02
Array 250000 iterate all - loop 112.20 us/op 112.78 us/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 43.007 ms/op 42.563 ms/op 1.01
Array.fill - length 1000000 3.5420 ms/op 3.5365 ms/op 1.00
Array push - length 1000000 13.409 ms/op 14.885 ms/op 0.90
Array.get 0.29183 ns/op 0.29324 ns/op 1.00
Uint8Array.get 0.49323 ns/op 0.50692 ns/op 0.97
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.272 ms/op 17.779 ms/op 1.03
altair processEpoch - mainnet_e81889 258.52 ms/op 250.58 ms/op 1.03
mainnet_e81889 - altair beforeProcessEpoch 18.966 ms/op 19.178 ms/op 0.99
mainnet_e81889 - altair processJustificationAndFinalization 5.4720 us/op 5.8370 us/op 0.94
mainnet_e81889 - altair processInactivityUpdates 4.7185 ms/op 4.4314 ms/op 1.06
mainnet_e81889 - altair processRewardsAndPenalties 39.422 ms/op 41.356 ms/op 0.95
mainnet_e81889 - altair processRegistryUpdates 736.00 ns/op 778.00 ns/op 0.95
mainnet_e81889 - altair processSlashings 187.00 ns/op 195.00 ns/op 0.96
mainnet_e81889 - altair processEth1DataReset 186.00 ns/op 200.00 ns/op 0.93
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2077 ms/op 1.3183 ms/op 0.92
mainnet_e81889 - altair processSlashingsReset 901.00 ns/op 1.0720 us/op 0.84
mainnet_e81889 - altair processRandaoMixesReset 1.1210 us/op 1.3110 us/op 0.86
mainnet_e81889 - altair processHistoricalRootsUpdate 183.00 ns/op 191.00 ns/op 0.96
mainnet_e81889 - altair processParticipationFlagUpdates 548.00 ns/op 549.00 ns/op 1.00
mainnet_e81889 - altair processSyncCommitteeUpdates 149.00 ns/op 152.00 ns/op 0.98
mainnet_e81889 - altair afterProcessEpoch 45.126 ms/op 45.099 ms/op 1.00
capella processEpoch - mainnet_e217614 1.0391 s/op 1.1466 s/op 0.91
mainnet_e217614 - capella beforeProcessEpoch 69.840 ms/op 67.703 ms/op 1.03
mainnet_e217614 - capella processJustificationAndFinalization 5.8710 us/op 5.7400 us/op 1.02
mainnet_e217614 - capella processInactivityUpdates 15.944 ms/op 15.506 ms/op 1.03
mainnet_e217614 - capella processRewardsAndPenalties 202.01 ms/op 198.32 ms/op 1.02
mainnet_e217614 - capella processRegistryUpdates 6.8440 us/op 7.4970 us/op 0.91
mainnet_e217614 - capella processSlashings 196.00 ns/op 208.00 ns/op 0.94
mainnet_e217614 - capella processEth1DataReset 194.00 ns/op 207.00 ns/op 0.94
mainnet_e217614 - capella processEffectiveBalanceUpdates 5.5980 ms/op 4.5017 ms/op 1.24
mainnet_e217614 - capella processSlashingsReset 1.2090 us/op 963.00 ns/op 1.26
mainnet_e217614 - capella processRandaoMixesReset 1.1730 us/op 1.3680 us/op 0.86
mainnet_e217614 - capella processHistoricalRootsUpdate 192.00 ns/op 203.00 ns/op 0.95
mainnet_e217614 - capella processParticipationFlagUpdates 579.00 ns/op 1.4150 us/op 0.41
mainnet_e217614 - capella afterProcessEpoch 121.32 ms/op 119.57 ms/op 1.01
phase0 processEpoch - mainnet_e58758 372.97 ms/op 353.49 ms/op 1.06
mainnet_e58758 - phase0 beforeProcessEpoch 110.28 ms/op 102.42 ms/op 1.08
mainnet_e58758 - phase0 processJustificationAndFinalization 8.5740 us/op 7.0650 us/op 1.21
mainnet_e58758 - phase0 processRewardsAndPenalties 54.604 ms/op 43.873 ms/op 1.24
mainnet_e58758 - phase0 processRegistryUpdates 4.5800 us/op 3.8930 us/op 1.18
mainnet_e58758 - phase0 processSlashings 197.00 ns/op 207.00 ns/op 0.95
mainnet_e58758 - phase0 processEth1DataReset 194.00 ns/op 189.00 ns/op 1.03
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2658 ms/op 2.9875 ms/op 0.42
mainnet_e58758 - phase0 processSlashingsReset 1.0320 us/op 1.0800 us/op 0.96
mainnet_e58758 - phase0 processRandaoMixesReset 1.2500 us/op 1.4300 us/op 0.87
mainnet_e58758 - phase0 processHistoricalRootsUpdate 199.00 ns/op 205.00 ns/op 0.97
mainnet_e58758 - phase0 processParticipationRecordUpdates 1.3810 us/op 991.00 ns/op 1.39
mainnet_e58758 - phase0 afterProcessEpoch 38.560 ms/op 37.210 ms/op 1.04
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.1474 ms/op 1.6910 ms/op 1.27
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.0198 ms/op 3.3860 ms/op 0.60
altair processInactivityUpdates - 250000 normalcase 22.199 ms/op 22.018 ms/op 1.01
altair processInactivityUpdates - 250000 worstcase 20.989 ms/op 20.605 ms/op 1.02
phase0 processRegistryUpdates - 250000 normalcase 13.028 us/op 8.0410 us/op 1.62
phase0 processRegistryUpdates - 250000 badcase_full_deposits 487.55 us/op 353.53 us/op 1.38
phase0 processRegistryUpdates - 250000 worstcase 0.5 148.05 ms/op 121.21 ms/op 1.22
altair processRewardsAndPenalties - 250000 normalcase 29.520 ms/op 28.098 ms/op 1.05
altair processRewardsAndPenalties - 250000 worstcase 28.697 ms/op 30.539 ms/op 0.94
phase0 getAttestationDeltas - 250000 normalcase 6.6817 ms/op 13.093 ms/op 0.51
phase0 getAttestationDeltas - 250000 worstcase 23.987 ms/op 6.5892 ms/op 3.64
phase0 processSlashings - 250000 worstcase 111.76 us/op 116.39 us/op 0.96
altair processSyncCommitteeUpdates - 250000 12.351 ms/op 13.931 ms/op 0.89
BeaconState.hashTreeRoot - No change 252.00 ns/op 232.00 ns/op 1.09
BeaconState.hashTreeRoot - 1 full validator 98.171 us/op 101.65 us/op 0.97
BeaconState.hashTreeRoot - 32 full validator 1.0405 ms/op 1.2620 ms/op 0.82
BeaconState.hashTreeRoot - 512 full validator 14.682 ms/op 14.007 ms/op 1.05
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 120.48 us/op 110.69 us/op 1.09
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7300 ms/op 1.7102 ms/op 1.01
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.802 ms/op 27.592 ms/op 0.97
BeaconState.hashTreeRoot - 1 balances 79.829 us/op 80.400 us/op 0.99
BeaconState.hashTreeRoot - 32 balances 967.87 us/op 803.89 us/op 1.20
BeaconState.hashTreeRoot - 512 balances 11.576 ms/op 8.4047 ms/op 1.38
BeaconState.hashTreeRoot - 250000 balances 251.18 ms/op 174.66 ms/op 1.44
aggregationBits - 2048 els - zipIndexesInBitList 26.009 us/op 23.544 us/op 1.10
byteArrayEquals 32 57.558 ns/op 55.552 ns/op 1.04
Buffer.compare 32 19.130 ns/op 18.406 ns/op 1.04
byteArrayEquals 1024 1.6902 us/op 1.6642 us/op 1.02
Buffer.compare 1024 27.389 ns/op 25.858 ns/op 1.06
byteArrayEquals 16384 27.018 us/op 26.504 us/op 1.02
Buffer.compare 16384 208.02 ns/op 201.75 ns/op 1.03
byteArrayEquals 123687377 201.08 ms/op 197.12 ms/op 1.02
Buffer.compare 123687377 9.2279 ms/op 7.5109 ms/op 1.23
byteArrayEquals 32 - diff last byte 54.740 ns/op 53.930 ns/op 1.02
Buffer.compare 32 - diff last byte 17.998 ns/op 17.695 ns/op 1.02
byteArrayEquals 1024 - diff last byte 1.6676 us/op 1.6304 us/op 1.02
Buffer.compare 1024 - diff last byte 28.225 ns/op 25.677 ns/op 1.10
byteArrayEquals 16384 - diff last byte 26.745 us/op 25.943 us/op 1.03
Buffer.compare 16384 - diff last byte 207.07 ns/op 205.63 ns/op 1.01
byteArrayEquals 123687377 - diff last byte 220.74 ms/op 189.28 ms/op 1.17
Buffer.compare 123687377 - diff last byte 11.188 ms/op 6.1454 ms/op 1.82
byteArrayEquals 32 - random bytes 7.5840 ns/op 5.0040 ns/op 1.52
Buffer.compare 32 - random bytes 19.487 ns/op 16.745 ns/op 1.16
byteArrayEquals 1024 - random bytes 5.7150 ns/op 5.0040 ns/op 1.14
Buffer.compare 1024 - random bytes 19.810 ns/op 16.838 ns/op 1.18
byteArrayEquals 16384 - random bytes 6.0090 ns/op 5.0100 ns/op 1.20
Buffer.compare 16384 - random bytes 19.885 ns/op 16.813 ns/op 1.18
byteArrayEquals 123687377 - random bytes 7.4100 ns/op 6.3900 ns/op 1.16
Buffer.compare 123687377 - random bytes 20.830 ns/op 38.090 ns/op 0.55
regular array get 100000 times 48.916 us/op 34.181 us/op 1.43
wrappedArray get 100000 times 65.614 us/op 31.614 us/op 2.08
arrayWithProxy get 100000 times 23.326 ms/op 11.566 ms/op 2.02
ssz.Root.equals 52.839 ns/op 44.427 ns/op 1.19
byteArrayEquals 51.287 ns/op 44.000 ns/op 1.17
Buffer.compare 11.844 ns/op 10.119 ns/op 1.17
processSlot - 1 slots 14.261 us/op 10.425 us/op 1.37
processSlot - 32 slots 3.8921 ms/op 2.3238 ms/op 1.67
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 6.6145 ms/op 2.8405 ms/op 2.33
getCommitteeAssignments - req 1 vs - 250000 vc 2.5063 ms/op 2.1133 ms/op 1.19
getCommitteeAssignments - req 100 vs - 250000 vc 4.5879 ms/op 4.1433 ms/op 1.11
getCommitteeAssignments - req 1000 vs - 250000 vc 5.3751 ms/op 4.4432 ms/op 1.21
findModifiedValidators - 10000 modified validators 1.0961 s/op 732.64 ms/op 1.50
findModifiedValidators - 1000 modified validators 945.69 ms/op 643.83 ms/op 1.47
findModifiedValidators - 100 modified validators 372.35 ms/op 220.31 ms/op 1.69
findModifiedValidators - 10 modified validators 301.43 ms/op 192.49 ms/op 1.57
findModifiedValidators - 1 modified validators 264.15 ms/op 140.57 ms/op 1.88
findModifiedValidators - no difference 353.71 ms/op 147.45 ms/op 2.40
compare ViewDUs 9.8172 s/op 6.2506 s/op 1.57
compare each validator Uint8Array 1.8083 s/op 1.6085 s/op 1.12
compare ViewDU to Uint8Array 1.7111 s/op 943.73 ms/op 1.81
migrate state 1000000 validators, 24 modified, 0 new 1.0104 s/op 905.07 ms/op 1.12
migrate state 1000000 validators, 1700 modified, 1000 new 1.3500 s/op 1.2410 s/op 1.09
migrate state 1000000 validators, 3400 modified, 2000 new 1.6274 s/op 1.3810 s/op 1.18
migrate state 1500000 validators, 24 modified, 0 new 999.29 ms/op 929.25 ms/op 1.08
migrate state 1500000 validators, 1700 modified, 1000 new 1.4784 s/op 1.1302 s/op 1.31
migrate state 1500000 validators, 3400 modified, 2000 new 1.4896 s/op 1.3606 s/op 1.09
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6400 ns/op 4.3300 ns/op 1.07
state getBlockRootAtSlot - 250000 vs - 7PWei 762.31 ns/op 517.92 ns/op 1.47
naive computeProposerIndex 100000 validators 63.539 ms/op 52.528 ms/op 1.21
computeProposerIndex 100000 validators 1.5840 ms/op 1.5180 ms/op 1.04
naiveGetNextSyncCommitteeIndices 1000 validators 8.2010 s/op 7.5832 s/op 1.08
getNextSyncCommitteeIndices 1000 validators 126.81 ms/op 107.70 ms/op 1.18
naiveGetNextSyncCommitteeIndices 10000 validators 8.3000 s/op 7.1853 s/op 1.16
getNextSyncCommitteeIndices 10000 validators 130.59 ms/op 115.08 ms/op 1.13
naiveGetNextSyncCommitteeIndices 100000 validators 8.0709 s/op 7.8825 s/op 1.02
getNextSyncCommitteeIndices 100000 validators 124.75 ms/op 114.97 ms/op 1.09
naive computeShuffledIndex 100000 validators 25.446 s/op 26.681 s/op 0.95
cached computeShuffledIndex 100000 validators 587.67 ms/op 585.23 ms/op 1.00
naive computeShuffledIndex 2000000 validators 549.86 s/op 524.32 s/op 1.05
cached computeShuffledIndex 2000000 validators 47.986 s/op 38.363 s/op 1.25
computeProposers - vc 250000 672.06 us/op 633.44 us/op 1.06
computeEpochShuffling - vc 250000 44.678 ms/op 42.384 ms/op 1.05
getNextSyncCommittee - vc 250000 11.290 ms/op 10.439 ms/op 1.08
computeSigningRoot for AttestationData 29.655 us/op 21.322 us/op 1.39
hash AttestationData serialized data then Buffer.toString(base64) 1.6808 us/op 1.6308 us/op 1.03
toHexString serialized data 1.3587 us/op 1.2992 us/op 1.05
Buffer.toString(base64) 157.56 ns/op 152.15 ns/op 1.04
nodejs block root to RootHex using toHex 151.99 ns/op 159.04 ns/op 0.96
nodejs block root to RootHex using toRootHex 91.253 ns/op 95.032 ns/op 0.96
browser block root to RootHex using the deprecated toHexString 240.17 ns/op 237.51 ns/op 1.01
browser block root to RootHex using toHex 189.74 ns/op 182.73 ns/op 1.04
browser block root to RootHex using toRootHex 174.22 ns/op 164.27 ns/op 1.06

by benchmarkbot/action

Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 90.46512% with 41 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.43%. Comparing base (8d743ff) to head (ba4d727).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #8221      +/-   ##
============================================
+ Coverage     54.19%   54.43%   +0.24%     
============================================
  Files           845      847       +2     
  Lines         63612    64040     +428     
  Branches       4799     4888      +89     
============================================
+ Hits          34473    34863     +390     
- Misses        29063    29101      +38     
  Partials         76       76              
🚀 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.

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.

1 participant