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

chore: flatten fork logic in notifyNewPayload #7385

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from
Open

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Jan 22, 2025

The way the current notifyNewPayload is structured does not allow new fork and payload method (eg. focil fork and engine_newPayloadV5) to be added easily without introducing more nested if statement.

This PR flattens the logic into a single layer by having a switch statement which makes new methods to be added easily.

@ensi321 ensi321 requested a review from a team as a code owner January 22, 2025 00:46
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.62%. Comparing base (d584aed) to head (45e6f5d).

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #7385   +/-   ##
=========================================
  Coverage     48.62%   48.62%           
=========================================
  Files           603      603           
  Lines         40510    40510           
  Branches       2071     2071           
=========================================
  Hits          19700    19700           
  Misses        20772    20772           
  Partials         38       38           

Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 87db769 Previous: d584aed Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.4071 ms/op 1.5995 ms/op 0.88
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 33.220 us/op 32.423 us/op 1.02
BLS verify - blst 897.86 us/op 894.82 us/op 1.00
BLS verifyMultipleSignatures 3 - blst 1.4764 ms/op 1.3409 ms/op 1.10
BLS verifyMultipleSignatures 8 - blst 2.1608 ms/op 2.0534 ms/op 1.05
BLS verifyMultipleSignatures 32 - blst 4.5615 ms/op 4.4121 ms/op 1.03
BLS verifyMultipleSignatures 64 - blst 8.4747 ms/op 8.2600 ms/op 1.03
BLS verifyMultipleSignatures 128 - blst 16.056 ms/op 15.677 ms/op 1.02
BLS deserializing 10000 signatures 633.14 ms/op 642.86 ms/op 0.98
BLS deserializing 100000 signatures 6.3608 s/op 6.6339 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst 977.05 us/op 937.64 us/op 1.04
BLS verifyMultipleSignatures - same message - 8 - blst 1.0499 ms/op 1.0316 ms/op 1.02
BLS verifyMultipleSignatures - same message - 32 - blst 1.6378 ms/op 1.6675 ms/op 0.98
BLS verifyMultipleSignatures - same message - 64 - blst 2.4447 ms/op 2.4738 ms/op 0.99
BLS verifyMultipleSignatures - same message - 128 - blst 4.0236 ms/op 4.0126 ms/op 1.00
BLS aggregatePubkeys 32 - blst 17.826 us/op 18.216 us/op 0.98
BLS aggregatePubkeys 128 - blst 63.131 us/op 63.269 us/op 1.00
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 54.047 ms/op 44.756 ms/op 1.21
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 46.342 ms/op 38.669 ms/op 1.20
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 35.528 ms/op 34.266 ms/op 1.04
getSlashingsAndExits - default max 60.885 us/op 54.772 us/op 1.11
getSlashingsAndExits - 2k 279.87 us/op 254.80 us/op 1.10
proposeBlockBody type=full, size=empty 4.2309 ms/op 4.2684 ms/op 0.99
isKnown best case - 1 super set check 462.00 ns/op 463.00 ns/op 1.00
isKnown normal case - 2 super set checks 442.00 ns/op 438.00 ns/op 1.01
isKnown worse case - 16 super set checks 433.00 ns/op 436.00 ns/op 0.99
InMemoryCheckpointStateCache - add get delete 2.7110 us/op 2.7120 us/op 1.00
validate api signedAggregateAndProof - struct 1.4915 ms/op 2.0252 ms/op 0.74
validate gossip signedAggregateAndProof - struct 1.4650 ms/op 1.7471 ms/op 0.84
batch validate gossip attestation - vc 640000 - chunk 32 128.21 us/op 124.62 us/op 1.03
batch validate gossip attestation - vc 640000 - chunk 64 103.30 us/op 102.98 us/op 1.00
batch validate gossip attestation - vc 640000 - chunk 128 94.341 us/op 95.936 us/op 0.98
batch validate gossip attestation - vc 640000 - chunk 256 92.343 us/op 94.064 us/op 0.98
pickEth1Vote - no votes 860.60 us/op 784.87 us/op 1.10
pickEth1Vote - max votes 5.8731 ms/op 4.7289 ms/op 1.24
pickEth1Vote - Eth1Data hashTreeRoot value x2048 16.337 ms/op 18.862 ms/op 0.87
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.848 ms/op 21.093 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize value x2048 389.85 us/op 388.43 us/op 1.00
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.1029 ms/op 3.2427 ms/op 1.27
bytes32 toHexString 582.00 ns/op 592.00 ns/op 0.98
bytes32 Buffer.toString(hex) 423.00 ns/op 409.00 ns/op 1.03
bytes32 Buffer.toString(hex) from Uint8Array 519.00 ns/op 509.00 ns/op 1.02
bytes32 Buffer.toString(hex) + 0x 419.00 ns/op 416.00 ns/op 1.01
Object access 1 prop 0.32200 ns/op 0.33100 ns/op 0.97
Map access 1 prop 0.32400 ns/op 0.32700 ns/op 0.99
Object get x1000 5.4650 ns/op 4.8180 ns/op 1.13
Map get x1000 6.1020 ns/op 5.4930 ns/op 1.11
Object set x1000 22.016 ns/op 22.332 ns/op 0.99
Map set x1000 18.895 ns/op 19.022 ns/op 0.99
Return object 10000 times 0.29550 ns/op 0.28150 ns/op 1.05
Throw Error 10000 times 2.6627 us/op 2.5034 us/op 1.06
toHex 110.56 ns/op 98.527 ns/op 1.12
Buffer.from 102.66 ns/op 90.349 ns/op 1.14
shared Buffer 68.979 ns/op 60.849 ns/op 1.13
fastMsgIdFn sha256 / 200 bytes 1.9980 us/op 1.8710 us/op 1.07
fastMsgIdFn h32 xxhash / 200 bytes 408.00 ns/op 384.00 ns/op 1.06
fastMsgIdFn h64 xxhash / 200 bytes 443.00 ns/op 425.00 ns/op 1.04
fastMsgIdFn sha256 / 1000 bytes 5.8920 us/op 5.7070 us/op 1.03
fastMsgIdFn h32 xxhash / 1000 bytes 522.00 ns/op 531.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 1000 bytes 508.00 ns/op 506.00 ns/op 1.00
fastMsgIdFn sha256 / 10000 bytes 49.598 us/op 46.214 us/op 1.07
fastMsgIdFn h32 xxhash / 10000 bytes 1.8900 us/op 1.8090 us/op 1.04
fastMsgIdFn h64 xxhash / 10000 bytes 1.3220 us/op 1.2590 us/op 1.05
send data - 1000 256B messages 9.2082 ms/op 10.374 ms/op 0.89
send data - 1000 512B messages 13.246 ms/op 14.851 ms/op 0.89
send data - 1000 1024B messages 22.977 ms/op 22.370 ms/op 1.03
send data - 1000 1200B messages 22.909 ms/op 24.249 ms/op 0.94
send data - 1000 2048B messages 27.581 ms/op 29.278 ms/op 0.94
send data - 1000 4096B messages 25.086 ms/op 25.223 ms/op 0.99
send data - 1000 16384B messages 68.154 ms/op 65.741 ms/op 1.04
send data - 1000 65536B messages 240.26 ms/op 257.96 ms/op 0.93
enrSubnets - fastDeserialize 64 bits 1.0820 us/op 1.0700 us/op 1.01
enrSubnets - ssz BitVector 64 bits 513.00 ns/op 493.00 ns/op 1.04
enrSubnets - fastDeserialize 4 bits 327.00 ns/op 323.00 ns/op 1.01
enrSubnets - ssz BitVector 4 bits 512.00 ns/op 500.00 ns/op 1.02
prioritizePeers score -10:0 att 32-0.1 sync 2-0 109.64 us/op 106.50 us/op 1.03
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 129.94 us/op 128.80 us/op 1.01
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 188.64 us/op 189.38 us/op 1.00
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 327.71 us/op 347.90 us/op 0.94
prioritizePeers score 0:0 att 64-1 sync 4-1 397.28 us/op 416.61 us/op 0.95
array of 16000 items push then shift 1.2069 us/op 1.2035 us/op 1.00
LinkedList of 16000 items push then shift 6.5430 ns/op 7.0750 ns/op 0.92
array of 16000 items push then pop 75.786 ns/op 85.527 ns/op 0.89
LinkedList of 16000 items push then pop 6.2310 ns/op 6.0900 ns/op 1.02
array of 24000 items push then shift 1.8917 us/op 1.7561 us/op 1.08
LinkedList of 24000 items push then shift 6.8530 ns/op 6.7800 ns/op 1.01
array of 24000 items push then pop 106.63 ns/op 106.25 ns/op 1.00
LinkedList of 24000 items push then pop 6.0100 ns/op 5.9720 ns/op 1.01
intersect bitArray bitLen 8 5.3200 ns/op 5.1510 ns/op 1.03
intersect array and set length 8 35.375 ns/op 35.139 ns/op 1.01
intersect bitArray bitLen 128 25.442 ns/op 25.152 ns/op 1.01
intersect array and set length 128 543.65 ns/op 534.40 ns/op 1.02
bitArray.getTrueBitIndexes() bitLen 128 1.4310 us/op 1.2870 us/op 1.11
bitArray.getTrueBitIndexes() bitLen 248 2.0700 us/op 2.1450 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 512 3.7060 us/op 3.7920 us/op 0.98
Buffer.concat 32 items 1.0050 us/op 884.00 ns/op 1.14
Uint8Array.set 32 items 1.7810 us/op 2.0060 us/op 0.89
Buffer.copy 2.9340 us/op 2.8750 us/op 1.02
Uint8Array.set - with subarray 3.1640 us/op 2.7440 us/op 1.15
Uint8Array.set - without subarray 2.1170 us/op 2.0380 us/op 1.04
getUint32 - dataview 393.00 ns/op 384.00 ns/op 1.02
getUint32 - manual 334.00 ns/op 325.00 ns/op 1.03
Set add up to 64 items then delete first 1.8765 us/op 1.7467 us/op 1.07
OrderedSet add up to 64 items then delete first 2.7646 us/op 2.7100 us/op 1.02
Set add up to 64 items then delete last 2.0773 us/op 1.9930 us/op 1.04
OrderedSet add up to 64 items then delete last 3.0532 us/op 2.8755 us/op 1.06
Set add up to 64 items then delete middle 2.0234 us/op 1.8524 us/op 1.09
OrderedSet add up to 64 items then delete middle 4.4141 us/op 4.1289 us/op 1.07
Set add up to 128 items then delete first 3.9683 us/op 3.6746 us/op 1.08
OrderedSet add up to 128 items then delete first 6.2165 us/op 6.1900 us/op 1.00
Set add up to 128 items then delete last 3.8307 us/op 3.6970 us/op 1.04
OrderedSet add up to 128 items then delete last 5.8103 us/op 5.7680 us/op 1.01
Set add up to 128 items then delete middle 3.8377 us/op 3.9869 us/op 0.96
OrderedSet add up to 128 items then delete middle 11.640 us/op 11.371 us/op 1.02
Set add up to 256 items then delete first 7.7919 us/op 8.1167 us/op 0.96
OrderedSet add up to 256 items then delete first 12.366 us/op 12.191 us/op 1.01
Set add up to 256 items then delete last 7.4949 us/op 7.3972 us/op 1.01
OrderedSet add up to 256 items then delete last 11.587 us/op 11.216 us/op 1.03
Set add up to 256 items then delete middle 7.4906 us/op 7.1300 us/op 1.05
OrderedSet add up to 256 items then delete middle 34.182 us/op 32.648 us/op 1.05
transfer serialized Status (84 B) 2.3470 us/op 2.2080 us/op 1.06
copy serialized Status (84 B) 1.4000 us/op 1.5510 us/op 0.90
transfer serialized SignedVoluntaryExit (112 B) 2.5620 us/op 2.8380 us/op 0.90
copy serialized SignedVoluntaryExit (112 B) 1.5020 us/op 1.6760 us/op 0.90
transfer serialized ProposerSlashing (416 B) 2.7110 us/op 2.7190 us/op 1.00
copy serialized ProposerSlashing (416 B) 2.0140 us/op 1.7400 us/op 1.16
transfer serialized Attestation (485 B) 2.7050 us/op 2.6130 us/op 1.04
copy serialized Attestation (485 B) 2.0140 us/op 1.7780 us/op 1.13
transfer serialized AttesterSlashing (33232 B) 3.1210 us/op 2.7070 us/op 1.15
copy serialized AttesterSlashing (33232 B) 4.1700 us/op 4.1850 us/op 1.00
transfer serialized Small SignedBeaconBlock (128000 B) 3.1970 us/op 2.9920 us/op 1.07
copy serialized Small SignedBeaconBlock (128000 B) 9.2250 us/op 9.6560 us/op 0.96
transfer serialized Avg SignedBeaconBlock (200000 B) 3.2780 us/op 3.7420 us/op 0.88
copy serialized Avg SignedBeaconBlock (200000 B) 12.831 us/op 14.401 us/op 0.89
transfer serialized BlobsSidecar (524380 B) 4.1060 us/op 4.8140 us/op 0.85
copy serialized BlobsSidecar (524380 B) 109.03 us/op 78.007 us/op 1.40
transfer serialized Big SignedBeaconBlock (1000000 B) 4.5130 us/op 4.8370 us/op 0.93
copy serialized Big SignedBeaconBlock (1000000 B) 135.90 us/op 166.04 us/op 0.82
pass gossip attestations to forkchoice per slot 2.3209 ms/op 2.2639 ms/op 1.03
forkChoice updateHead vc 100000 bc 64 eq 0 407.55 us/op 332.22 us/op 1.23
forkChoice updateHead vc 600000 bc 64 eq 0 2.5599 ms/op 2.9883 ms/op 0.86
forkChoice updateHead vc 1000000 bc 64 eq 0 3.9909 ms/op 3.7346 ms/op 1.07
forkChoice updateHead vc 600000 bc 320 eq 0 2.1474 ms/op 2.3944 ms/op 0.90
forkChoice updateHead vc 600000 bc 1200 eq 0 2.0280 ms/op 2.3170 ms/op 0.88
forkChoice updateHead vc 600000 bc 7200 eq 0 2.4934 ms/op 2.2980 ms/op 1.09
forkChoice updateHead vc 600000 bc 64 eq 1000 9.7542 ms/op 9.4327 ms/op 1.03
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4435 ms/op 9.3117 ms/op 1.01
forkChoice updateHead vc 600000 bc 64 eq 300000 11.505 ms/op 11.530 ms/op 1.00
computeDeltas 500000 validators 300 proto nodes 3.3413 ms/op 3.2827 ms/op 1.02
computeDeltas 500000 validators 1200 proto nodes 3.2733 ms/op 3.4081 ms/op 0.96
computeDeltas 500000 validators 7200 proto nodes 3.2858 ms/op 3.3157 ms/op 0.99
computeDeltas 750000 validators 300 proto nodes 4.8804 ms/op 4.9541 ms/op 0.99
computeDeltas 750000 validators 1200 proto nodes 4.9635 ms/op 4.9877 ms/op 1.00
computeDeltas 750000 validators 7200 proto nodes 4.9798 ms/op 4.9948 ms/op 1.00
computeDeltas 1400000 validators 300 proto nodes 8.8603 ms/op 9.2545 ms/op 0.96
computeDeltas 1400000 validators 1200 proto nodes 8.9833 ms/op 9.4817 ms/op 0.95
computeDeltas 1400000 validators 7200 proto nodes 8.9475 ms/op 8.9167 ms/op 1.00
computeDeltas 2100000 validators 300 proto nodes 14.130 ms/op 14.099 ms/op 1.00
computeDeltas 2100000 validators 1200 proto nodes 14.254 ms/op 13.994 ms/op 1.02
computeDeltas 2100000 validators 7200 proto nodes 14.242 ms/op 13.943 ms/op 1.02
altair processAttestation - 250000 vs - 7PWei normalcase 2.0161 ms/op 1.7244 ms/op 1.17
altair processAttestation - 250000 vs - 7PWei worstcase 3.0572 ms/op 2.3826 ms/op 1.28
altair processAttestation - setStatus - 1/6 committees join 108.27 us/op 97.512 us/op 1.11
altair processAttestation - setStatus - 1/3 committees join 196.98 us/op 187.93 us/op 1.05
altair processAttestation - setStatus - 1/2 committees join 301.58 us/op 265.21 us/op 1.14
altair processAttestation - setStatus - 2/3 committees join 366.94 us/op 345.30 us/op 1.06
altair processAttestation - setStatus - 4/5 committees join 517.17 us/op 475.44 us/op 1.09
altair processAttestation - setStatus - 100% committees join 601.02 us/op 561.07 us/op 1.07
altair processBlock - 250000 vs - 7PWei normalcase 4.6152 ms/op 4.8590 ms/op 0.95
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.033 ms/op 28.434 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase 36.221 ms/op 35.268 ms/op 1.03
altair processBlock - 250000 vs - 7PWei worstcase hashState 82.891 ms/op 81.194 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4872 ms/op 2.0702 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei worstcase 23.379 ms/op 25.431 ms/op 0.92
altair processEth1Data - 250000 vs - 7PWei normalcase 328.44 us/op 291.42 us/op 1.13
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 5.6590 us/op 2.7950 us/op 2.02
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 31.684 us/op 17.882 us/op 1.77
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.5490 us/op 10.369 us/op 0.82
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 5.9700 us/op 4.8460 us/op 1.23
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 144.61 us/op 128.38 us/op 1.13
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 931.56 us/op 851.85 us/op 1.09
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.1949 ms/op 1.1453 ms/op 1.04
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.1926 ms/op 1.0664 ms/op 1.12
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.8805 ms/op 2.9878 ms/op 1.30
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.3229 ms/op 1.1760 ms/op 1.12
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.4208 ms/op 2.8650 ms/op 1.19
Tree 40 250000 create 418.78 ms/op 355.02 ms/op 1.18
Tree 40 250000 get(125000) 125.02 ns/op 103.86 ns/op 1.20
Tree 40 250000 set(125000) 1.3513 us/op 1.0878 us/op 1.24
Tree 40 250000 toArray() 18.941 ms/op 12.145 ms/op 1.56
Tree 40 250000 iterate all - toArray() + loop 18.908 ms/op 12.741 ms/op 1.48
Tree 40 250000 iterate all - get(i) 50.299 ms/op 40.851 ms/op 1.23
Array 250000 create 3.5025 ms/op 2.3215 ms/op 1.51
Array 250000 clone - spread 1.2641 ms/op 1.1087 ms/op 1.14
Array 250000 get(125000) 0.63800 ns/op 0.55800 ns/op 1.14
Array 250000 set(125000) 0.61800 ns/op 0.57100 ns/op 1.08
Array 250000 iterate all - loop 80.252 us/op 72.799 us/op 1.10
phase0 afterProcessEpoch - 250000 vs - 7PWei 46.152 ms/op 38.987 ms/op 1.18
Array.fill - length 1000000 2.5493 ms/op 2.2377 ms/op 1.14
Array push - length 1000000 15.454 ms/op 14.132 ms/op 1.09
Array.get 0.26358 ns/op 0.25894 ns/op 1.02
Uint8Array.get 0.34265 ns/op 0.33991 ns/op 1.01
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.368 ms/op 12.887 ms/op 1.43
altair processEpoch - mainnet_e81889 267.37 ms/op 274.11 ms/op 0.98
mainnet_e81889 - altair beforeProcessEpoch 19.956 ms/op 14.803 ms/op 1.35
mainnet_e81889 - altair processJustificationAndFinalization 15.495 us/op 12.418 us/op 1.25
mainnet_e81889 - altair processInactivityUpdates 3.8959 ms/op 3.4306 ms/op 1.14
mainnet_e81889 - altair processRewardsAndPenalties 49.171 ms/op 57.339 ms/op 0.86
mainnet_e81889 - altair processRegistryUpdates 3.7060 us/op 2.6420 us/op 1.40
mainnet_e81889 - altair processSlashings 820.00 ns/op 823.00 ns/op 1.00
mainnet_e81889 - altair processEth1DataReset 929.00 ns/op 879.00 ns/op 1.06
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0420 ms/op 1.6237 ms/op 0.64
mainnet_e81889 - altair processSlashingsReset 4.6910 us/op 2.4220 us/op 1.94
mainnet_e81889 - altair processRandaoMixesReset 6.0410 us/op 3.4820 us/op 1.73
mainnet_e81889 - altair processHistoricalRootsUpdate 1.3610 us/op 1.2750 us/op 1.07
mainnet_e81889 - altair processParticipationFlagUpdates 2.8860 us/op 2.0990 us/op 1.37
mainnet_e81889 - altair processSyncCommitteeUpdates 1.1330 us/op 815.00 ns/op 1.39
mainnet_e81889 - altair afterProcessEpoch 43.587 ms/op 42.315 ms/op 1.03
capella processEpoch - mainnet_e217614 839.74 ms/op 991.03 ms/op 0.85
mainnet_e217614 - capella beforeProcessEpoch 67.909 ms/op 67.642 ms/op 1.00
mainnet_e217614 - capella processJustificationAndFinalization 12.079 us/op 11.781 us/op 1.03
mainnet_e217614 - capella processInactivityUpdates 15.282 ms/op 11.049 ms/op 1.38
mainnet_e217614 - capella processRewardsAndPenalties 252.64 ms/op 249.99 ms/op 1.01
mainnet_e217614 - capella processRegistryUpdates 11.249 us/op 10.679 us/op 1.05
mainnet_e217614 - capella processSlashings 1000.0 ns/op 832.00 ns/op 1.20
mainnet_e217614 - capella processEth1DataReset 776.00 ns/op 820.00 ns/op 0.95
mainnet_e217614 - capella processEffectiveBalanceUpdates 7.0790 ms/op 3.2528 ms/op 2.18
mainnet_e217614 - capella processSlashingsReset 2.9450 us/op 3.0510 us/op 0.97
mainnet_e217614 - capella processRandaoMixesReset 8.4220 us/op 3.7490 us/op 2.25
mainnet_e217614 - capella processHistoricalRootsUpdate 957.00 ns/op 872.00 ns/op 1.10
mainnet_e217614 - capella processParticipationFlagUpdates 2.7450 us/op 1.8930 us/op 1.45
mainnet_e217614 - capella afterProcessEpoch 102.12 ms/op 101.08 ms/op 1.01
phase0 processEpoch - mainnet_e58758 314.44 ms/op 307.67 ms/op 1.02
mainnet_e58758 - phase0 beforeProcessEpoch 69.610 ms/op 58.171 ms/op 1.20
mainnet_e58758 - phase0 processJustificationAndFinalization 13.230 us/op 13.880 us/op 0.95
mainnet_e58758 - phase0 processRewardsAndPenalties 24.623 ms/op 26.391 ms/op 0.93
mainnet_e58758 - phase0 processRegistryUpdates 8.3620 us/op 5.6690 us/op 1.48
mainnet_e58758 - phase0 processSlashings 873.00 ns/op 841.00 ns/op 1.04
mainnet_e58758 - phase0 processEth1DataReset 959.00 ns/op 928.00 ns/op 1.03
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 827.69 us/op 762.03 us/op 1.09
mainnet_e58758 - phase0 processSlashingsReset 3.1200 us/op 2.6180 us/op 1.19
mainnet_e58758 - phase0 processRandaoMixesReset 4.4810 us/op 5.5160 us/op 0.81
mainnet_e58758 - phase0 processHistoricalRootsUpdate 966.00 ns/op 983.00 ns/op 0.98
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.3470 us/op 4.1530 us/op 1.05
mainnet_e58758 - phase0 afterProcessEpoch 34.597 ms/op 36.714 ms/op 0.94
phase0 processEffectiveBalanceUpdates - 250000 normalcase 962.27 us/op 938.89 us/op 1.02
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.3537 ms/op 1.3412 ms/op 1.01
altair processInactivityUpdates - 250000 normalcase 16.717 ms/op 19.420 ms/op 0.86
altair processInactivityUpdates - 250000 worstcase 17.730 ms/op 17.684 ms/op 1.00
phase0 processRegistryUpdates - 250000 normalcase 4.9320 us/op 3.0560 us/op 1.61
phase0 processRegistryUpdates - 250000 badcase_full_deposits 289.31 us/op 274.73 us/op 1.05
phase0 processRegistryUpdates - 250000 worstcase 0.5 112.24 ms/op 110.32 ms/op 1.02
altair processRewardsAndPenalties - 250000 normalcase 48.811 ms/op 48.589 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 47.720 ms/op 41.734 ms/op 1.14
phase0 getAttestationDeltas - 250000 normalcase 5.6518 ms/op 6.4262 ms/op 0.88
phase0 getAttestationDeltas - 250000 worstcase 5.2258 ms/op 5.5333 ms/op 0.94
phase0 processSlashings - 250000 worstcase 93.836 us/op 92.821 us/op 1.01
altair processSyncCommitteeUpdates - 250000 106.33 ms/op 96.087 ms/op 1.11
BeaconState.hashTreeRoot - No change 497.00 ns/op 465.00 ns/op 1.07
BeaconState.hashTreeRoot - 1 full validator 96.209 us/op 121.68 us/op 0.79
BeaconState.hashTreeRoot - 32 full validator 1.4649 ms/op 1.1373 ms/op 1.29
BeaconState.hashTreeRoot - 512 full validator 11.744 ms/op 8.7281 ms/op 1.35
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 128.82 us/op 125.99 us/op 1.02
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.8915 ms/op 1.5190 ms/op 1.25
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.199 ms/op 18.806 ms/op 1.13
BeaconState.hashTreeRoot - 1 balances 117.89 us/op 89.538 us/op 1.32
BeaconState.hashTreeRoot - 32 balances 1.2886 ms/op 880.77 us/op 1.46
BeaconState.hashTreeRoot - 512 balances 9.0363 ms/op 6.8752 ms/op 1.31
BeaconState.hashTreeRoot - 250000 balances 182.64 ms/op 134.14 ms/op 1.36
aggregationBits - 2048 els - zipIndexesInBitList 19.469 us/op 19.117 us/op 1.02
byteArrayEquals 32 47.199 ns/op 48.143 ns/op 0.98
Buffer.compare 32 17.316 ns/op 16.363 ns/op 1.06
byteArrayEquals 1024 1.2579 us/op 1.2650 us/op 0.99
Buffer.compare 1024 24.623 ns/op 24.635 ns/op 1.00
byteArrayEquals 16384 19.956 us/op 20.094 us/op 0.99
Buffer.compare 16384 202.19 ns/op 210.92 ns/op 0.96
byteArrayEquals 123687377 143.28 ms/op 151.18 ms/op 0.95
Buffer.compare 123687377 4.9184 ms/op 3.8722 ms/op 1.27
byteArrayEquals 32 - diff last byte 45.170 ns/op 46.619 ns/op 0.97
Buffer.compare 32 - diff last byte 15.119 ns/op 16.547 ns/op 0.91
byteArrayEquals 1024 - diff last byte 1.2171 us/op 1.2569 us/op 0.97
Buffer.compare 1024 - diff last byte 29.285 ns/op 23.344 ns/op 1.25
byteArrayEquals 16384 - diff last byte 19.289 us/op 19.951 us/op 0.97
Buffer.compare 16384 - diff last byte 163.47 ns/op 177.43 ns/op 0.92
byteArrayEquals 123687377 - diff last byte 145.73 ms/op 149.46 ms/op 0.98
Buffer.compare 123687377 - diff last byte 5.2952 ms/op 3.8172 ms/op 1.39
byteArrayEquals 32 - random bytes 4.8120 ns/op 4.8700 ns/op 0.99
Buffer.compare 32 - random bytes 15.267 ns/op 16.652 ns/op 0.92
byteArrayEquals 1024 - random bytes 4.8140 ns/op 4.8710 ns/op 0.99
Buffer.compare 1024 - random bytes 15.126 ns/op 16.677 ns/op 0.91
byteArrayEquals 16384 - random bytes 4.8060 ns/op 4.8330 ns/op 0.99
Buffer.compare 16384 - random bytes 15.112 ns/op 16.709 ns/op 0.90
byteArrayEquals 123687377 - random bytes 7.6000 ns/op 7.6900 ns/op 0.99
Buffer.compare 123687377 - random bytes 17.960 ns/op 19.720 ns/op 0.91
regular array get 100000 times 29.804 us/op 30.994 us/op 0.96
wrappedArray get 100000 times 29.810 us/op 31.057 us/op 0.96
arrayWithProxy get 100000 times 8.6773 ms/op 9.8019 ms/op 0.89
ssz.Root.equals 42.450 ns/op 43.174 ns/op 0.98
byteArrayEquals 41.383 ns/op 42.796 ns/op 0.97
Buffer.compare 8.6980 ns/op 9.7020 ns/op 0.90
processSlot - 1 slots 12.121 us/op 11.650 us/op 1.04
processSlot - 32 slots 2.8928 ms/op 1.8462 ms/op 1.57
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 40.067 ms/op 38.050 ms/op 1.05
getCommitteeAssignments - req 1 vs - 250000 vc 1.8392 ms/op 1.7756 ms/op 1.04
getCommitteeAssignments - req 100 vs - 250000 vc 3.5998 ms/op 3.5444 ms/op 1.02
getCommitteeAssignments - req 1000 vs - 250000 vc 3.8475 ms/op 3.7008 ms/op 1.04
findModifiedValidators - 10000 modified validators 216.61 ms/op 220.24 ms/op 0.98
findModifiedValidators - 1000 modified validators 130.31 ms/op 139.34 ms/op 0.94
findModifiedValidators - 100 modified validators 127.58 ms/op 139.25 ms/op 0.92
findModifiedValidators - 10 modified validators 117.21 ms/op 131.79 ms/op 0.89
findModifiedValidators - 1 modified validators 116.92 ms/op 124.90 ms/op 0.94
findModifiedValidators - no difference 138.55 ms/op 151.00 ms/op 0.92
compare ViewDUs 3.4588 s/op 3.2692 s/op 1.06
compare each validator Uint8Array 1.6257 s/op 1.6863 s/op 0.96
compare ViewDU to Uint8Array 697.18 ms/op 737.08 ms/op 0.95
migrate state 1000000 validators, 24 modified, 0 new 690.38 ms/op 679.76 ms/op 1.02
migrate state 1000000 validators, 1700 modified, 1000 new 934.64 ms/op 918.68 ms/op 1.02
migrate state 1000000 validators, 3400 modified, 2000 new 1.0754 s/op 1.2131 s/op 0.89
migrate state 1500000 validators, 24 modified, 0 new 687.98 ms/op 747.01 ms/op 0.92
migrate state 1500000 validators, 1700 modified, 1000 new 949.57 ms/op 977.36 ms/op 0.97
migrate state 1500000 validators, 3400 modified, 2000 new 1.0969 s/op 1.1608 s/op 0.94
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.5700 ns/op 5.7500 ns/op 1.14
state getBlockRootAtSlot - 250000 vs - 7PWei 564.40 ns/op 1.0498 us/op 0.54
computeProposers - vc 250000 5.3933 ms/op 6.7175 ms/op 0.80
computeEpochShuffling - vc 250000 36.138 ms/op 33.506 ms/op 1.08
getNextSyncCommittee - vc 250000 96.728 ms/op 105.61 ms/op 0.92
computeSigningRoot for AttestationData 19.283 us/op 21.716 us/op 0.89
hash AttestationData serialized data then Buffer.toString(base64) 1.1662 us/op 1.1725 us/op 0.99
toHexString serialized data 754.33 ns/op 787.62 ns/op 0.96
Buffer.toString(base64) 147.27 ns/op 127.43 ns/op 1.16
nodejs block root to RootHex using toHex 114.19 ns/op 115.32 ns/op 0.99
nodejs block root to RootHex using toRootHex 75.318 ns/op 75.014 ns/op 1.00
browser block root to RootHex using the deprecated toHexString 205.22 ns/op 210.16 ns/op 0.98
browser block root to RootHex using toHex 169.81 ns/op 167.65 ns/op 1.01
browser block root to RootHex using toRootHex 151.90 ns/op 146.65 ns/op 1.04

by benchmarkbot/action

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