Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove assumption of 3 intervals per slot #7067

Draft
wants to merge 4 commits into
base: unstable
Choose a base branch
from

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Sep 3, 2024

There are a lot of places in Lodestar codebase that assume 3 intervals per slot and thus hard code 3 when calculating seconds into the slot.

In preparation of ePBS, or future protocol upgrades that might potentially introduce more intervals per slot, we should refactor our codebase to remove such assumption.

  • Reword variable naming and comments such as one-third, two-third
  • Modify calculations that have 1 / 3, 2 / 3 hardcoded
  • Introduce enum SlotInterval to explicitly lay out what validator actions should happen at which interval

@ensi321 ensi321 requested a review from a team as a code owner September 3, 2024 07:26
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 70.29703% with 30 lines in your changes missing coverage. Please review.

Project coverage is 50.87%. Comparing base (0dceb83) to head (6a1e1f2).
Report is 80 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #7067      +/-   ##
============================================
+ Coverage     50.84%   50.87%   +0.02%     
============================================
  Files           597      598       +1     
  Lines         39835    39900      +65     
  Branches       2064     2068       +4     
============================================
+ Hits          20255    20298      +43     
- Misses        19580    19602      +22     

Copy link
Contributor

github-actions bot commented Sep 17, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: bfe6c88 Previous: 0dceb83 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0838 ms/op 2.4101 ms/op 0.86
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 56.624 us/op 74.769 us/op 0.76
BLS verify - blst 919.60 us/op 1.0612 ms/op 0.87
BLS verifyMultipleSignatures 3 - blst 1.3253 ms/op 1.4676 ms/op 0.90
BLS verifyMultipleSignatures 8 - blst 1.7325 ms/op 2.3814 ms/op 0.73
BLS verifyMultipleSignatures 32 - blst 5.0520 ms/op 6.2678 ms/op 0.81
BLS verifyMultipleSignatures 64 - blst 9.2846 ms/op 11.431 ms/op 0.81
BLS verifyMultipleSignatures 128 - blst 17.666 ms/op 19.959 ms/op 0.89
BLS deserializing 10000 signatures 686.26 ms/op 729.93 ms/op 0.94
BLS deserializing 100000 signatures 6.9311 s/op 7.2244 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 935.88 us/op 1.0362 ms/op 0.90
BLS verifyMultipleSignatures - same message - 8 - blst 1.0691 ms/op 1.2532 ms/op 0.85
BLS verifyMultipleSignatures - same message - 32 - blst 1.7667 ms/op 2.1786 ms/op 0.81
BLS verifyMultipleSignatures - same message - 64 - blst 2.6304 ms/op 2.9615 ms/op 0.89
BLS verifyMultipleSignatures - same message - 128 - blst 4.4077 ms/op 4.9045 ms/op 0.90
BLS aggregatePubkeys 32 - blst 20.321 us/op 24.361 us/op 0.83
BLS aggregatePubkeys 128 - blst 71.990 us/op 74.235 us/op 0.97
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 71.693 ms/op 75.355 ms/op 0.95
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 51.956 ms/op 84.005 ms/op 0.62
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 35.625 ms/op 53.322 ms/op 0.67
getSlashingsAndExits - default max 119.70 us/op 159.32 us/op 0.75
getSlashingsAndExits - 2k 377.94 us/op 331.75 us/op 1.14
proposeBlockBody type=full, size=empty 5.9154 ms/op 7.1607 ms/op 0.83
isKnown best case - 1 super set check 302.00 ns/op 536.00 ns/op 0.56
isKnown normal case - 2 super set checks 298.00 ns/op 531.00 ns/op 0.56
isKnown worse case - 16 super set checks 286.00 ns/op 529.00 ns/op 0.54
InMemoryCheckpointStateCache - add get delete 2.8050 us/op 3.8280 us/op 0.73
updateUnfinalizedPubkeys - updating 10 pubkeys 1.2539 ms/op 1.4515 ms/op 0.86
updateUnfinalizedPubkeys - updating 100 pubkeys 3.4718 ms/op 4.8723 ms/op 0.71
updateUnfinalizedPubkeys - updating 1000 pubkeys 52.278 ms/op 63.408 ms/op 0.82
validate api signedAggregateAndProof - struct 1.3692 ms/op 1.6717 ms/op 0.82
validate gossip signedAggregateAndProof - struct 1.4414 ms/op 1.8130 ms/op 0.80
validate gossip attestation - vc 640000 926.31 us/op 1.0643 ms/op 0.87
batch validate gossip attestation - vc 640000 - chunk 32 130.78 us/op 152.53 us/op 0.86
batch validate gossip attestation - vc 640000 - chunk 64 114.82 us/op 145.29 us/op 0.79
batch validate gossip attestation - vc 640000 - chunk 128 108.55 us/op 117.42 us/op 0.92
batch validate gossip attestation - vc 640000 - chunk 256 106.25 us/op 116.85 us/op 0.91
pickEth1Vote - no votes 1.2040 ms/op 1.3212 ms/op 0.91
pickEth1Vote - max votes 5.6067 ms/op 8.0321 ms/op 0.70
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.650 ms/op 15.050 ms/op 1.11
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 21.599 ms/op 23.435 ms/op 0.92
pickEth1Vote - Eth1Data fastSerialize value x2048 484.81 us/op 588.90 us/op 0.82
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.8052 ms/op 3.6694 ms/op 1.04
bytes32 toHexString 411.00 ns/op 606.00 ns/op 0.68
bytes32 Buffer.toString(hex) 244.00 ns/op 276.00 ns/op 0.88
bytes32 Buffer.toString(hex) from Uint8Array 361.00 ns/op 475.00 ns/op 0.76
bytes32 Buffer.toString(hex) + 0x 246.00 ns/op 269.00 ns/op 0.91
Object access 1 prop 0.12500 ns/op 0.15700 ns/op 0.80
Map access 1 prop 0.12200 ns/op 0.13600 ns/op 0.90
Object get x1000 6.1850 ns/op 6.4890 ns/op 0.95
Map get x1000 6.3860 ns/op 8.6030 ns/op 0.74
Object set x1000 31.874 ns/op 43.407 ns/op 0.73
Map set x1000 22.179 ns/op 25.244 ns/op 0.88
Return object 10000 times 0.28700 ns/op 0.29110 ns/op 0.99
Throw Error 10000 times 3.3294 us/op 3.4216 us/op 0.97
toHex 155.20 ns/op 158.63 ns/op 0.98
Buffer.from 139.14 ns/op 143.02 ns/op 0.97
shared Buffer 91.901 ns/op 95.883 ns/op 0.96
fastMsgIdFn sha256 / 200 bytes 2.1860 us/op 2.3990 us/op 0.91
fastMsgIdFn h32 xxhash / 200 bytes 234.00 ns/op 269.00 ns/op 0.87
fastMsgIdFn h64 xxhash / 200 bytes 263.00 ns/op 276.00 ns/op 0.95
fastMsgIdFn sha256 / 1000 bytes 7.1450 us/op 7.6030 us/op 0.94
fastMsgIdFn h32 xxhash / 1000 bytes 348.00 ns/op 412.00 ns/op 0.84
fastMsgIdFn h64 xxhash / 1000 bytes 336.00 ns/op 348.00 ns/op 0.97
fastMsgIdFn sha256 / 10000 bytes 63.298 us/op 66.639 us/op 0.95
fastMsgIdFn h32 xxhash / 10000 bytes 1.7930 us/op 1.9260 us/op 0.93
fastMsgIdFn h64 xxhash / 10000 bytes 1.1730 us/op 1.2460 us/op 0.94
send data - 1000 256B messages 12.281 ms/op 13.749 ms/op 0.89
send data - 1000 512B messages 15.958 ms/op 17.279 ms/op 0.92
send data - 1000 1024B messages 27.727 ms/op 27.936 ms/op 0.99
send data - 1000 1200B messages 26.421 ms/op 28.421 ms/op 0.93
send data - 1000 2048B messages 34.056 ms/op 36.324 ms/op 0.94
send data - 1000 4096B messages 34.010 ms/op 32.922 ms/op 1.03
send data - 1000 16384B messages 76.118 ms/op 80.341 ms/op 0.95
send data - 1000 65536B messages 235.65 ms/op 231.15 ms/op 1.02
enrSubnets - fastDeserialize 64 bits 1.2040 us/op 1.2370 us/op 0.97
enrSubnets - ssz BitVector 64 bits 423.00 ns/op 432.00 ns/op 0.98
enrSubnets - fastDeserialize 4 bits 176.00 ns/op 194.00 ns/op 0.91
enrSubnets - ssz BitVector 4 bits 417.00 ns/op 415.00 ns/op 1.00
prioritizePeers score -10:0 att 32-0.1 sync 2-0 172.17 us/op 178.59 us/op 0.96
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 158.11 us/op 179.43 us/op 0.88
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 348.09 us/op 313.74 us/op 1.11
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 411.84 us/op 452.35 us/op 0.91
prioritizePeers score 0:0 att 64-1 sync 4-1 771.52 us/op 795.01 us/op 0.97
array of 16000 items push then shift 1.7128 us/op 1.6762 us/op 1.02
LinkedList of 16000 items push then shift 7.8900 ns/op 8.1340 ns/op 0.97
array of 16000 items push then pop 145.87 ns/op 130.75 ns/op 1.12
LinkedList of 16000 items push then pop 7.6420 ns/op 7.3710 ns/op 1.04
array of 24000 items push then shift 2.5523 us/op 2.4674 us/op 1.03
LinkedList of 24000 items push then shift 8.0380 ns/op 7.8140 ns/op 1.03
array of 24000 items push then pop 182.73 ns/op 186.69 ns/op 0.98
LinkedList of 24000 items push then pop 7.5340 ns/op 7.9450 ns/op 0.95
intersect bitArray bitLen 8 6.5430 ns/op 7.2360 ns/op 0.90
intersect array and set length 8 49.011 ns/op 51.156 ns/op 0.96
intersect bitArray bitLen 128 30.161 ns/op 29.943 ns/op 1.01
intersect array and set length 128 721.97 ns/op 753.83 ns/op 0.96
bitArray.getTrueBitIndexes() bitLen 128 1.9820 us/op 2.0430 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 248 3.5400 us/op 3.5720 us/op 0.99
bitArray.getTrueBitIndexes() bitLen 512 7.2410 us/op 7.4810 us/op 0.97
Buffer.concat 32 items 1.0490 us/op 933.00 ns/op 1.12
Uint8Array.set 32 items 1.9960 us/op 1.5640 us/op 1.28
Buffer.copy 2.5190 us/op 1.9180 us/op 1.31
Uint8Array.set - with subarray 3.0920 us/op 3.0560 us/op 1.01
Uint8Array.set - without subarray 1.8240 us/op 1.5650 us/op 1.17
getUint32 - dataview 297.00 ns/op 303.00 ns/op 0.98
getUint32 - manual 187.00 ns/op 223.00 ns/op 0.84
Set add up to 64 items then delete first 2.3015 us/op 2.7090 us/op 0.85
OrderedSet add up to 64 items then delete first 4.2754 us/op 3.9264 us/op 1.09
Set add up to 64 items then delete last 3.0699 us/op 3.1573 us/op 0.97
OrderedSet add up to 64 items then delete last 5.4335 us/op 4.6268 us/op 1.17
Set add up to 64 items then delete middle 3.6717 us/op 2.7075 us/op 1.36
OrderedSet add up to 64 items then delete middle 7.1503 us/op 6.7923 us/op 1.05
Set add up to 128 items then delete first 6.7578 us/op 6.5125 us/op 1.04
OrderedSet add up to 128 items then delete first 9.9491 us/op 9.9761 us/op 1.00
Set add up to 128 items then delete last 6.6576 us/op 6.1414 us/op 1.08
OrderedSet add up to 128 items then delete last 10.304 us/op 9.5445 us/op 1.08
Set add up to 128 items then delete middle 6.5400 us/op 6.1705 us/op 1.06
OrderedSet add up to 128 items then delete middle 17.249 us/op 14.814 us/op 1.16
Set add up to 256 items then delete first 13.933 us/op 11.597 us/op 1.20
OrderedSet add up to 256 items then delete first 21.794 us/op 19.812 us/op 1.10
Set add up to 256 items then delete last 14.319 us/op 13.249 us/op 1.08
OrderedSet add up to 256 items then delete last 23.387 us/op 18.091 us/op 1.29
Set add up to 256 items then delete middle 14.713 us/op 11.216 us/op 1.31
OrderedSet add up to 256 items then delete middle 51.246 us/op 44.577 us/op 1.15
transfer serialized Status (84 B) 1.5670 us/op 1.5040 us/op 1.04
copy serialized Status (84 B) 1.4420 us/op 1.4280 us/op 1.01
transfer serialized SignedVoluntaryExit (112 B) 1.5850 us/op 1.6200 us/op 0.98
copy serialized SignedVoluntaryExit (112 B) 1.5040 us/op 1.5200 us/op 0.99
transfer serialized ProposerSlashing (416 B) 2.1060 us/op 2.8680 us/op 0.73
copy serialized ProposerSlashing (416 B) 2.0920 us/op 3.0280 us/op 0.69
transfer serialized Attestation (485 B) 2.2230 us/op 2.8350 us/op 0.78
copy serialized Attestation (485 B) 2.8990 us/op 2.9010 us/op 1.00
transfer serialized AttesterSlashing (33232 B) 3.0510 us/op 3.3470 us/op 0.91
copy serialized AttesterSlashing (33232 B) 8.0060 us/op 8.6580 us/op 0.92
transfer serialized Small SignedBeaconBlock (128000 B) 2.7810 us/op 3.3030 us/op 0.84
copy serialized Small SignedBeaconBlock (128000 B) 22.909 us/op 23.052 us/op 0.99
transfer serialized Avg SignedBeaconBlock (200000 B) 3.8960 us/op 3.9120 us/op 1.00
copy serialized Avg SignedBeaconBlock (200000 B) 34.601 us/op 33.034 us/op 1.05
transfer serialized BlobsSidecar (524380 B) 3.8600 us/op 3.9580 us/op 0.98
copy serialized BlobsSidecar (524380 B) 164.21 us/op 132.79 us/op 1.24
transfer serialized Big SignedBeaconBlock (1000000 B) 3.5350 us/op 4.5620 us/op 0.77
copy serialized Big SignedBeaconBlock (1000000 B) 176.02 us/op 189.29 us/op 0.93
pass gossip attestations to forkchoice per slot 3.0039 ms/op 2.8948 ms/op 1.04
forkChoice updateHead vc 100000 bc 64 eq 0 635.59 us/op 607.14 us/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 0 3.3735 ms/op 4.3279 ms/op 0.78
forkChoice updateHead vc 1000000 bc 64 eq 0 6.4864 ms/op 5.7893 ms/op 1.12
forkChoice updateHead vc 600000 bc 320 eq 0 3.4745 ms/op 3.2736 ms/op 1.06
forkChoice updateHead vc 600000 bc 1200 eq 0 3.6836 ms/op 3.6558 ms/op 1.01
forkChoice updateHead vc 600000 bc 7200 eq 0 4.2431 ms/op 4.2157 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 1000 11.678 ms/op 11.092 ms/op 1.05
forkChoice updateHead vc 600000 bc 64 eq 10000 11.629 ms/op 11.362 ms/op 1.02
forkChoice updateHead vc 600000 bc 64 eq 300000 17.779 ms/op 18.289 ms/op 0.97
computeDeltas 500000 validators 300 proto nodes 4.5751 ms/op 4.2661 ms/op 1.07
computeDeltas 500000 validators 1200 proto nodes 4.0701 ms/op 4.1034 ms/op 0.99
computeDeltas 500000 validators 7200 proto nodes 3.8122 ms/op 4.3026 ms/op 0.89
computeDeltas 750000 validators 300 proto nodes 5.6912 ms/op 6.2695 ms/op 0.91
computeDeltas 750000 validators 1200 proto nodes 5.5736 ms/op 5.9345 ms/op 0.94
computeDeltas 750000 validators 7200 proto nodes 5.6023 ms/op 5.8058 ms/op 0.96
computeDeltas 1400000 validators 300 proto nodes 10.675 ms/op 10.865 ms/op 0.98
computeDeltas 1400000 validators 1200 proto nodes 10.738 ms/op 10.277 ms/op 1.04
computeDeltas 1400000 validators 7200 proto nodes 11.575 ms/op 10.106 ms/op 1.15
computeDeltas 2100000 validators 300 proto nodes 15.744 ms/op 14.969 ms/op 1.05
computeDeltas 2100000 validators 1200 proto nodes 15.738 ms/op 15.458 ms/op 1.02
computeDeltas 2100000 validators 7200 proto nodes 14.961 ms/op 15.241 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 1.8005 ms/op 1.6783 ms/op 1.07
altair processAttestation - 250000 vs - 7PWei worstcase 2.9617 ms/op 2.6174 ms/op 1.13
altair processAttestation - setStatus - 1/6 committees join 102.80 us/op 87.356 us/op 1.18
altair processAttestation - setStatus - 1/3 committees join 189.91 us/op 173.31 us/op 1.10
altair processAttestation - setStatus - 1/2 committees join 267.30 us/op 244.25 us/op 1.09
altair processAttestation - setStatus - 2/3 committees join 346.43 us/op 315.23 us/op 1.10
altair processAttestation - setStatus - 4/5 committees join 499.10 us/op 477.17 us/op 1.05
altair processAttestation - setStatus - 100% committees join 602.05 us/op 548.82 us/op 1.10
altair processBlock - 250000 vs - 7PWei normalcase 4.2658 ms/op 3.7312 ms/op 1.14
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.055 ms/op 26.142 ms/op 1.07
altair processBlock - 250000 vs - 7PWei worstcase 32.767 ms/op 34.384 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 74.537 ms/op 70.686 ms/op 1.05
phase0 processBlock - 250000 vs - 7PWei normalcase 2.1196 ms/op 1.9327 ms/op 1.10
phase0 processBlock - 250000 vs - 7PWei worstcase 21.569 ms/op 19.821 ms/op 1.09
altair processEth1Data - 250000 vs - 7PWei normalcase 357.50 us/op 295.79 us/op 1.21
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.5490 us/op 4.8620 us/op 1.14
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 39.041 us/op 30.846 us/op 1.27
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 10.543 us/op 8.5630 us/op 1.23
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9540 us/op 5.3300 us/op 1.12
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 145.02 us/op 118.24 us/op 1.23
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.1235 ms/op 1.1309 ms/op 0.99
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5603 ms/op 1.5100 ms/op 1.03
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.5113 ms/op 1.5551 ms/op 0.97
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.7136 ms/op 3.9024 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6645 ms/op 1.6497 ms/op 1.01
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 4.0931 ms/op 3.6743 ms/op 1.11
Tree 40 250000 create 252.09 ms/op 231.91 ms/op 1.09
Tree 40 250000 get(125000) 161.95 ns/op 146.43 ns/op 1.11
Tree 40 250000 set(125000) 784.73 ns/op 680.18 ns/op 1.15
Tree 40 250000 toArray() 20.195 ms/op 16.178 ms/op 1.25
Tree 40 250000 iterate all - toArray() + loop 20.905 ms/op 15.878 ms/op 1.32
Tree 40 250000 iterate all - get(i) 59.350 ms/op 51.276 ms/op 1.16
Array 250000 create 4.1076 ms/op 2.7759 ms/op 1.48
Array 250000 clone - spread 1.6957 ms/op 1.3519 ms/op 1.25
Array 250000 get(125000) 0.44700 ns/op 0.40100 ns/op 1.11
Array 250000 set(125000) 0.47900 ns/op 0.41300 ns/op 1.16
Array 250000 iterate all - loop 101.06 us/op 101.84 us/op 0.99
phase0 afterProcessEpoch - 250000 vs - 7PWei 93.393 ms/op 90.556 ms/op 1.03
Array.fill - length 1000000 3.5607 ms/op 3.3941 ms/op 1.05
Array push - length 1000000 18.370 ms/op 22.186 ms/op 0.83
Array.get 0.30587 ns/op 0.26645 ns/op 1.15
Uint8Array.get 0.45554 ns/op 0.41884 ns/op 1.09
phase0 beforeProcessEpoch - 250000 vs - 7PWei 19.173 ms/op 16.314 ms/op 1.18
altair processEpoch - mainnet_e81889 344.00 ms/op 323.79 ms/op 1.06
mainnet_e81889 - altair beforeProcessEpoch 19.905 ms/op 18.144 ms/op 1.10
mainnet_e81889 - altair processJustificationAndFinalization 14.171 us/op 11.490 us/op 1.23
mainnet_e81889 - altair processInactivityUpdates 7.3458 ms/op 5.2905 ms/op 1.39
mainnet_e81889 - altair processRewardsAndPenalties 45.266 ms/op 54.297 ms/op 0.83
mainnet_e81889 - altair processRegistryUpdates 2.1920 us/op 1.6780 us/op 1.31
mainnet_e81889 - altair processSlashings 461.00 ns/op 380.00 ns/op 1.21
mainnet_e81889 - altair processEth1DataReset 443.00 ns/op 305.00 ns/op 1.45
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.9971 ms/op 1.9403 ms/op 1.03
mainnet_e81889 - altair processSlashingsReset 2.9220 us/op 2.4280 us/op 1.20
mainnet_e81889 - altair processRandaoMixesReset 4.7230 us/op 3.3170 us/op 1.42
mainnet_e81889 - altair processHistoricalRootsUpdate 692.00 ns/op 320.00 ns/op 2.16
mainnet_e81889 - altair processParticipationFlagUpdates 2.6200 us/op 1.8230 us/op 1.44
mainnet_e81889 - altair processSyncCommitteeUpdates 616.00 ns/op 230.00 ns/op 2.68
mainnet_e81889 - altair afterProcessEpoch 97.644 ms/op 95.428 ms/op 1.02
capella processEpoch - mainnet_e217614 1.1758 s/op 1.1974 s/op 0.98
mainnet_e217614 - capella beforeProcessEpoch 74.092 ms/op 69.147 ms/op 1.07
mainnet_e217614 - capella processJustificationAndFinalization 14.547 us/op 15.095 us/op 0.96
mainnet_e217614 - capella processInactivityUpdates 18.154 ms/op 18.464 ms/op 0.98
mainnet_e217614 - capella processRewardsAndPenalties 224.66 ms/op 234.26 ms/op 0.96
mainnet_e217614 - capella processRegistryUpdates 12.869 us/op 13.029 us/op 0.99
mainnet_e217614 - capella processSlashings 400.00 ns/op 382.00 ns/op 1.05
mainnet_e217614 - capella processEth1DataReset 366.00 ns/op 322.00 ns/op 1.14
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.975 ms/op 15.069 ms/op 0.93
mainnet_e217614 - capella processSlashingsReset 3.7940 us/op 2.5610 us/op 1.48
mainnet_e217614 - capella processRandaoMixesReset 4.9010 us/op 4.0830 us/op 1.20
mainnet_e217614 - capella processHistoricalRootsUpdate 891.00 ns/op 328.00 ns/op 2.72
mainnet_e217614 - capella processParticipationFlagUpdates 2.3450 us/op 1.1540 us/op 2.03
mainnet_e217614 - capella afterProcessEpoch 244.52 ms/op 239.72 ms/op 1.02
phase0 processEpoch - mainnet_e58758 460.74 ms/op 424.64 ms/op 1.09
mainnet_e58758 - phase0 beforeProcessEpoch 92.746 ms/op 93.804 ms/op 0.99
mainnet_e58758 - phase0 processJustificationAndFinalization 20.801 us/op 17.842 us/op 1.17
mainnet_e58758 - phase0 processRewardsAndPenalties 36.919 ms/op 25.738 ms/op 1.43
mainnet_e58758 - phase0 processRegistryUpdates 9.4110 us/op 8.4270 us/op 1.12
mainnet_e58758 - phase0 processSlashings 451.00 ns/op 399.00 ns/op 1.13
mainnet_e58758 - phase0 processEth1DataReset 359.00 ns/op 355.00 ns/op 1.01
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.2198 ms/op 1.3193 ms/op 0.92
mainnet_e58758 - phase0 processSlashingsReset 2.8230 us/op 3.6550 us/op 0.77
mainnet_e58758 - phase0 processRandaoMixesReset 5.0210 us/op 5.6320 us/op 0.89
mainnet_e58758 - phase0 processHistoricalRootsUpdate 431.00 ns/op 780.00 ns/op 0.55
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.9340 us/op 3.4200 us/op 1.15
mainnet_e58758 - phase0 afterProcessEpoch 84.753 ms/op 80.977 ms/op 1.05
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.9408 ms/op 1.4293 ms/op 1.36
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.7281 ms/op 2.5388 ms/op 1.07
altair processInactivityUpdates - 250000 normalcase 16.459 ms/op 20.376 ms/op 0.81
altair processInactivityUpdates - 250000 worstcase 18.554 ms/op 17.707 ms/op 1.05
phase0 processRegistryUpdates - 250000 normalcase 7.5090 us/op 6.5070 us/op 1.15
phase0 processRegistryUpdates - 250000 badcase_full_deposits 284.72 us/op 307.62 us/op 0.93
phase0 processRegistryUpdates - 250000 worstcase 0.5 119.92 ms/op 111.29 ms/op 1.08
altair processRewardsAndPenalties - 250000 normalcase 40.926 ms/op 42.327 ms/op 0.97
altair processRewardsAndPenalties - 250000 worstcase 35.931 ms/op 39.607 ms/op 0.91
phase0 getAttestationDeltas - 250000 normalcase 7.7729 ms/op 9.3194 ms/op 0.83
phase0 getAttestationDeltas - 250000 worstcase 7.8443 ms/op 8.1057 ms/op 0.97
phase0 processSlashings - 250000 worstcase 100.45 us/op 91.128 us/op 1.10
altair processSyncCommitteeUpdates - 250000 129.55 ms/op 127.86 ms/op 1.01
BeaconState.hashTreeRoot - No change 234.00 ns/op 262.00 ns/op 0.89
BeaconState.hashTreeRoot - 1 full validator 98.412 us/op 120.19 us/op 0.82
BeaconState.hashTreeRoot - 32 full validator 960.01 us/op 1.5826 ms/op 0.61
BeaconState.hashTreeRoot - 512 full validator 10.398 ms/op 14.040 ms/op 0.74
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 104.33 us/op 147.79 us/op 0.71
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.4174 ms/op 2.0330 ms/op 0.70
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 19.854 ms/op 25.316 ms/op 0.78
BeaconState.hashTreeRoot - 1 balances 83.566 us/op 110.43 us/op 0.76
BeaconState.hashTreeRoot - 32 balances 816.46 us/op 1.2342 ms/op 0.66
BeaconState.hashTreeRoot - 512 balances 7.7764 ms/op 8.5594 ms/op 0.91
BeaconState.hashTreeRoot - 250000 balances 169.77 ms/op 162.87 ms/op 1.04
aggregationBits - 2048 els - zipIndexesInBitList 24.781 us/op 32.239 us/op 0.77
byteArrayEquals 32 54.171 ns/op 54.050 ns/op 1.00
Buffer.compare 32 17.392 ns/op 17.095 ns/op 1.02
byteArrayEquals 1024 1.5996 us/op 1.5669 us/op 1.02
Buffer.compare 1024 25.978 ns/op 24.171 ns/op 1.07
byteArrayEquals 16384 25.615 us/op 25.253 us/op 1.01
Buffer.compare 16384 217.06 ns/op 192.21 ns/op 1.13
byteArrayEquals 123687377 198.78 ms/op 189.29 ms/op 1.05
Buffer.compare 123687377 8.1606 ms/op 7.0977 ms/op 1.15
byteArrayEquals 32 - diff last byte 55.484 ns/op 52.108 ns/op 1.06
Buffer.compare 32 - diff last byte 18.467 ns/op 17.632 ns/op 1.05
byteArrayEquals 1024 - diff last byte 1.6588 us/op 1.5739 us/op 1.05
Buffer.compare 1024 - diff last byte 27.086 ns/op 25.836 ns/op 1.05
byteArrayEquals 16384 - diff last byte 26.455 us/op 25.068 us/op 1.06
Buffer.compare 16384 - diff last byte 205.56 ns/op 188.99 ns/op 1.09
byteArrayEquals 123687377 - diff last byte 203.20 ms/op 188.59 ms/op 1.08
Buffer.compare 123687377 - diff last byte 10.782 ms/op 6.2212 ms/op 1.73
byteArrayEquals 32 - random bytes 5.6950 ns/op 5.1170 ns/op 1.11
Buffer.compare 32 - random bytes 19.009 ns/op 16.939 ns/op 1.12
byteArrayEquals 1024 - random bytes 5.5900 ns/op 5.1180 ns/op 1.09
Buffer.compare 1024 - random bytes 18.684 ns/op 17.115 ns/op 1.09
byteArrayEquals 16384 - random bytes 5.5900 ns/op 5.0710 ns/op 1.10
Buffer.compare 16384 - random bytes 18.504 ns/op 16.993 ns/op 1.09
byteArrayEquals 123687377 - random bytes 7.1900 ns/op 6.3300 ns/op 1.14
Buffer.compare 123687377 - random bytes 20.580 ns/op 18.280 ns/op 1.13
regular array get 100000 times 35.822 us/op 40.121 us/op 0.89
wrappedArray get 100000 times 36.560 us/op 32.935 us/op 1.11
arrayWithProxy get 100000 times 14.057 ms/op 13.215 ms/op 1.06
ssz.Root.equals 48.765 ns/op 45.693 ns/op 1.07
byteArrayEquals 47.770 ns/op 45.157 ns/op 1.06
Buffer.compare 11.532 ns/op 10.340 ns/op 1.12
shuffle list - 16384 els 6.4979 ms/op 6.3542 ms/op 1.02
shuffle list - 250000 els 97.394 ms/op 91.212 ms/op 1.07
processSlot - 1 slots 18.666 us/op 12.280 us/op 1.52
processSlot - 32 slots 3.4049 ms/op 2.4032 ms/op 1.42
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 35.845 ms/op 36.441 ms/op 0.98
getCommitteeAssignments - req 1 vs - 250000 vc 2.0908 ms/op 2.1140 ms/op 0.99
getCommitteeAssignments - req 100 vs - 250000 vc 4.1489 ms/op 4.1296 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.4899 ms/op 4.3976 ms/op 1.02
findModifiedValidators - 10000 modified validators 255.36 ms/op 253.50 ms/op 1.01
findModifiedValidators - 1000 modified validators 163.29 ms/op 184.47 ms/op 0.89
findModifiedValidators - 100 modified validators 154.41 ms/op 164.91 ms/op 0.94
findModifiedValidators - 10 modified validators 156.27 ms/op 161.12 ms/op 0.97
findModifiedValidators - 1 modified validators 157.30 ms/op 171.39 ms/op 0.92
findModifiedValidators - no difference 174.00 ms/op 157.35 ms/op 1.11
compare ViewDUs 3.0545 s/op 2.9784 s/op 1.03
compare each validator Uint8Array 1.3216 s/op 1.4062 s/op 0.94
compare ViewDU to Uint8Array 1.1099 s/op 1.1754 s/op 0.94
migrate state 1000000 validators, 24 modified, 0 new 913.81 ms/op 901.49 ms/op 1.01
migrate state 1000000 validators, 1700 modified, 1000 new 1.1889 s/op 1.2578 s/op 0.95
migrate state 1000000 validators, 3400 modified, 2000 new 1.3904 s/op 1.4842 s/op 0.94
migrate state 1500000 validators, 24 modified, 0 new 963.12 ms/op 1.0103 s/op 0.95
migrate state 1500000 validators, 1700 modified, 1000 new 1.3342 s/op 1.1858 s/op 1.13
migrate state 1500000 validators, 3400 modified, 2000 new 1.4285 s/op 1.3438 s/op 1.06
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8100 ns/op 4.4800 ns/op 1.07
state getBlockRootAtSlot - 250000 vs - 7PWei 784.72 ns/op 551.24 ns/op 1.42
computeProposers - vc 250000 7.5985 ms/op 7.4230 ms/op 1.02
computeEpochShuffling - vc 250000 97.717 ms/op 93.609 ms/op 1.04
getNextSyncCommittee - vc 250000 133.54 ms/op 128.87 ms/op 1.04
computeSigningRoot for AttestationData 21.743 us/op 24.198 us/op 0.90
hash AttestationData serialized data then Buffer.toString(base64) 1.6462 us/op 1.6127 us/op 1.02
toHexString serialized data 902.84 ns/op 912.88 ns/op 0.99
Buffer.toString(base64) 176.39 ns/op 196.14 ns/op 0.90
nodejs block root to RootHex using toHex 145.97 ns/op 153.37 ns/op 0.95
nodejs block root to RootHex using toRootHex 93.570 ns/op 97.550 ns/op 0.96
browser block root to RootHex using the deprecated toHexString 224.92 ns/op 236.19 ns/op 0.95
browser block root to RootHex using toHex 185.91 ns/op 188.91 ns/op 0.98
browser block root to RootHex using toRootHex 163.93 ns/op 171.26 ns/op 0.96

by benchmarkbot/action

*/
/* eslint-disable @typescript-eslint/no-duplicate-enum-values */
export enum SlotInterval {
BLOCK_PROPAGATION = 0,
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if the name here is accurate because the interval includes block production (local and builder) while propagation (via gossipsub) of the block a lot of the time happens at 2 seconds or later into the slot.

@ensi321 ensi321 marked this pull request as draft December 3, 2024 15:15
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.

2 participants