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

feat: add clone option to state caches #6512

Merged
merged 2 commits into from Mar 6, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 6, 2024

Motivation

Description

  • Add StateCloneOpts to state caches add api
  • All consumers need to specify that StateCloneOpts, it's already done in the current source code for state transition, need to use same params for state caches get api

Closes #6511

Test result

Metrics look same to v1.16 after ~3h of testing

Screenshot 2024-03-06 at 13 17 52 Screenshot 2024-03-06 at 13 18 10

Copy link

codecov bot commented Mar 6, 2024

Codecov Report

Merging #6512 (0f363ae) into unstable (918924e) will decrease coverage by 0.01%.
The diff coverage is 44.57%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6512      +/-   ##
============================================
- Coverage     61.55%   61.54%   -0.01%     
============================================
  Files           556      556              
  Lines         58586    58629      +43     
  Branches       1847     1847              
============================================
+ Hits          36060    36083      +23     
- Misses        22486    22506      +20     
  Partials         40       40              

@twoeths twoeths marked this pull request as ready for review March 6, 2024 06:55
@twoeths twoeths requested a review from a team as a code owner March 6, 2024 06:55
Copy link
Contributor

github-actions bot commented Mar 6, 2024

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 839606c Previous: 918924e Ratio
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 5.3530 us/op 16.362 us/op 0.33
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 3.4420 us/op 11.095 us/op 0.31
Full benchmark results
Benchmark suite Current: 839606c Previous: 918924e Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 422.49 us/op 795.48 us/op 0.53
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 55.172 us/op 95.674 us/op 0.58
BLS verify - blst-native 1.1103 ms/op 1.1537 ms/op 0.96
BLS verifyMultipleSignatures 3 - blst-native 2.3812 ms/op 2.4925 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 5.2253 ms/op 5.4487 ms/op 0.96
BLS verifyMultipleSignatures 32 - blst-native 19.377 ms/op 21.128 ms/op 0.92
BLS verifyMultipleSignatures 64 - blst-native 38.269 ms/op 42.379 ms/op 0.90
BLS verifyMultipleSignatures 128 - blst-native 77.902 ms/op 78.588 ms/op 0.99
BLS deserializing 10000 signatures 804.06 ms/op 852.98 ms/op 0.94
BLS deserializing 100000 signatures 8.2723 s/op 8.7094 s/op 0.95
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1242 ms/op 1.1538 ms/op 0.97
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2797 ms/op 1.3090 ms/op 0.98
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.0069 ms/op 2.1753 ms/op 0.92
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.7760 ms/op 4.0295 ms/op 0.94
BLS verifyMultipleSignatures - same message - 128 - blst-native 5.0395 ms/op 5.2997 ms/op 0.95
BLS aggregatePubkeys 32 - blst-native 22.680 us/op 23.691 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 88.986 us/op 90.397 us/op 0.98
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 42.090 ms/op 44.498 ms/op 0.95
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 39.160 ms/op 47.065 ms/op 0.83
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 25.033 ms/op 27.456 ms/op 0.91
getSlashingsAndExits - default max 143.88 us/op 231.48 us/op 0.62
getSlashingsAndExits - 2k 292.04 us/op 438.41 us/op 0.67
proposeBlockBody type=full, size=empty 4.2023 ms/op 4.2090 ms/op 1.00
isKnown best case - 1 super set check 334.00 ns/op 385.00 ns/op 0.87
isKnown normal case - 2 super set checks 330.00 ns/op 347.00 ns/op 0.95
isKnown worse case - 16 super set checks 330.00 ns/op 344.00 ns/op 0.96
CheckpointStateCache - add get delete 6.9650 us/op 7.3830 us/op 0.94
validate api signedAggregateAndProof - struct 2.3859 ms/op 2.7223 ms/op 0.88
validate gossip signedAggregateAndProof - struct 2.3773 ms/op 2.6510 ms/op 0.90
validate gossip attestation - vc 640000 1.1495 ms/op 1.2675 ms/op 0.91
batch validate gossip attestation - vc 640000 - chunk 32 142.39 us/op 158.19 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 64 127.34 us/op 141.07 us/op 0.90
batch validate gossip attestation - vc 640000 - chunk 128 123.47 us/op 124.82 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 256 109.98 us/op 133.13 us/op 0.83
pickEth1Vote - no votes 858.24 us/op 1.0471 ms/op 0.82
pickEth1Vote - max votes 5.3496 ms/op 15.726 ms/op 0.34
pickEth1Vote - Eth1Data hashTreeRoot value x2048 11.377 ms/op 26.340 ms/op 0.43
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.744 ms/op 26.264 ms/op 0.71
pickEth1Vote - Eth1Data fastSerialize value x2048 439.17 us/op 610.83 us/op 0.72
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.1802 ms/op 8.6647 ms/op 0.37
bytes32 toHexString 452.00 ns/op 961.00 ns/op 0.47
bytes32 Buffer.toString(hex) 305.00 ns/op 387.00 ns/op 0.79
bytes32 Buffer.toString(hex) from Uint8Array 411.00 ns/op 553.00 ns/op 0.74
bytes32 Buffer.toString(hex) + 0x 309.00 ns/op 401.00 ns/op 0.77
Object access 1 prop 0.19600 ns/op 0.28200 ns/op 0.70
Map access 1 prop 0.19100 ns/op 0.22700 ns/op 0.84
Object get x1000 5.8920 ns/op 5.5920 ns/op 1.05
Map get x1000 0.75500 ns/op 0.90200 ns/op 0.84
Object set x1000 24.813 ns/op 31.070 ns/op 0.80
Map set x1000 17.215 ns/op 21.920 ns/op 0.79
Return object 10000 times 0.22770 ns/op 0.26950 ns/op 0.84
Throw Error 10000 times 2.6983 us/op 3.2842 us/op 0.82
fastMsgIdFn sha256 / 200 bytes 1.9810 us/op 2.5560 us/op 0.78
fastMsgIdFn h32 xxhash / 200 bytes 293.00 ns/op 558.00 ns/op 0.53
fastMsgIdFn h64 xxhash / 200 bytes 341.00 ns/op 526.00 ns/op 0.65
fastMsgIdFn sha256 / 1000 bytes 6.2170 us/op 8.1370 us/op 0.76
fastMsgIdFn h32 xxhash / 1000 bytes 413.00 ns/op 582.00 ns/op 0.71
fastMsgIdFn h64 xxhash / 1000 bytes 410.00 ns/op 516.00 ns/op 0.79
fastMsgIdFn sha256 / 10000 bytes 52.716 us/op 57.367 us/op 0.92
fastMsgIdFn h32 xxhash / 10000 bytes 1.7900 us/op 2.1410 us/op 0.84
fastMsgIdFn h64 xxhash / 10000 bytes 1.2430 us/op 1.4250 us/op 0.87
send data - 1000 256B messages 11.158 ms/op 17.229 ms/op 0.65
send data - 1000 512B messages 14.732 ms/op 18.576 ms/op 0.79
send data - 1000 1024B messages 24.173 ms/op 30.864 ms/op 0.78
send data - 1000 1200B messages 30.167 ms/op 38.200 ms/op 0.79
send data - 1000 2048B messages 36.588 ms/op 37.568 ms/op 0.97
send data - 1000 4096B messages 32.569 ms/op 38.886 ms/op 0.84
send data - 1000 16384B messages 91.232 ms/op 92.556 ms/op 0.99
send data - 1000 65536B messages 442.82 ms/op 443.14 ms/op 1.00
enrSubnets - fastDeserialize 64 bits 949.00 ns/op 1.5760 us/op 0.60
enrSubnets - ssz BitVector 64 bits 446.00 ns/op 631.00 ns/op 0.71
enrSubnets - fastDeserialize 4 bits 213.00 ns/op 324.00 ns/op 0.66
enrSubnets - ssz BitVector 4 bits 430.00 ns/op 639.00 ns/op 0.67
prioritizePeers score -10:0 att 32-0.1 sync 2-0 68.211 us/op 77.338 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 80.317 us/op 110.46 us/op 0.73
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 110.62 us/op 162.21 us/op 0.68
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 185.72 us/op 290.19 us/op 0.64
prioritizePeers score 0:0 att 64-1 sync 4-1 205.66 us/op 270.91 us/op 0.76
array of 16000 items push then shift 1.2907 us/op 1.5188 us/op 0.85
LinkedList of 16000 items push then shift 5.9690 ns/op 6.3750 ns/op 0.94
array of 16000 items push then pop 77.240 ns/op 94.718 ns/op 0.82
LinkedList of 16000 items push then pop 5.8180 ns/op 5.7710 ns/op 1.01
array of 24000 items push then shift 1.8753 us/op 2.0227 us/op 0.93
LinkedList of 24000 items push then shift 5.8920 ns/op 6.0730 ns/op 0.97
array of 24000 items push then pop 88.131 ns/op 113.01 ns/op 0.78
LinkedList of 24000 items push then pop 5.6820 ns/op 6.9790 ns/op 0.81
intersect bitArray bitLen 8 4.7930 ns/op 5.1320 ns/op 0.93
intersect array and set length 8 49.026 ns/op 50.588 ns/op 0.97
intersect bitArray bitLen 128 29.412 ns/op 30.505 ns/op 0.96
intersect array and set length 128 690.88 ns/op 719.57 ns/op 0.96
bitArray.getTrueBitIndexes() bitLen 128 1.1860 us/op 1.5730 us/op 0.75
bitArray.getTrueBitIndexes() bitLen 248 2.0060 us/op 2.3270 us/op 0.86
bitArray.getTrueBitIndexes() bitLen 512 3.6230 us/op 4.0520 us/op 0.89
Buffer.concat 32 items 1.0610 us/op 879.00 ns/op 1.21
Uint8Array.set 32 items 1.8710 us/op 1.7580 us/op 1.06
Set add up to 64 items then delete first 1.7614 us/op 1.8612 us/op 0.95
OrderedSet add up to 64 items then delete first 2.6848 us/op 3.0036 us/op 0.89
Set add up to 64 items then delete last 1.9964 us/op 2.6341 us/op 0.76
OrderedSet add up to 64 items then delete last 2.9763 us/op 4.0149 us/op 0.74
Set add up to 64 items then delete middle 2.0026 us/op 2.5222 us/op 0.79
OrderedSet add up to 64 items then delete middle 4.2060 us/op 5.6195 us/op 0.75
Set add up to 128 items then delete first 3.9507 us/op 5.3248 us/op 0.74
OrderedSet add up to 128 items then delete first 6.2187 us/op 6.6151 us/op 0.94
Set add up to 128 items then delete last 3.8227 us/op 3.8692 us/op 0.99
OrderedSet add up to 128 items then delete last 5.7622 us/op 5.9780 us/op 0.96
Set add up to 128 items then delete middle 3.8620 us/op 3.8148 us/op 1.01
OrderedSet add up to 128 items then delete middle 10.721 us/op 10.668 us/op 1.00
Set add up to 256 items then delete first 7.7367 us/op 7.8826 us/op 0.98
OrderedSet add up to 256 items then delete first 12.290 us/op 12.171 us/op 1.01
Set add up to 256 items then delete last 7.5225 us/op 7.4873 us/op 1.00
OrderedSet add up to 256 items then delete last 11.541 us/op 11.480 us/op 1.01
Set add up to 256 items then delete middle 7.4857 us/op 7.4933 us/op 1.00
OrderedSet add up to 256 items then delete middle 31.239 us/op 30.413 us/op 1.03
transfer serialized Status (84 B) 1.2940 us/op 1.2690 us/op 1.02
copy serialized Status (84 B) 1.0130 us/op 1.0130 us/op 1.00
transfer serialized SignedVoluntaryExit (112 B) 1.3450 us/op 1.3230 us/op 1.02
copy serialized SignedVoluntaryExit (112 B) 1.0310 us/op 1.0480 us/op 0.98
transfer serialized ProposerSlashing (416 B) 1.4660 us/op 1.5560 us/op 0.94
copy serialized ProposerSlashing (416 B) 1.5030 us/op 1.3690 us/op 1.10
transfer serialized Attestation (485 B) 1.7170 us/op 1.6250 us/op 1.06
copy serialized Attestation (485 B) 1.7860 us/op 1.3870 us/op 1.29
transfer serialized AttesterSlashing (33232 B) 1.5760 us/op 2.2630 us/op 0.70
copy serialized AttesterSlashing (33232 B) 3.0990 us/op 5.1470 us/op 0.60
transfer serialized Small SignedBeaconBlock (128000 B) 1.6620 us/op 2.3930 us/op 0.69
copy serialized Small SignedBeaconBlock (128000 B) 7.6190 us/op 12.213 us/op 0.62
transfer serialized Avg SignedBeaconBlock (200000 B) 1.6830 us/op 2.9510 us/op 0.57
copy serialized Avg SignedBeaconBlock (200000 B) 11.821 us/op 23.099 us/op 0.51
transfer serialized BlobsSidecar (524380 B) 2.2770 us/op 2.9790 us/op 0.76
copy serialized BlobsSidecar (524380 B) 70.785 us/op 68.578 us/op 1.03
transfer serialized Big SignedBeaconBlock (1000000 B) 2.4860 us/op 3.1620 us/op 0.79
copy serialized Big SignedBeaconBlock (1000000 B) 309.60 us/op 138.22 us/op 2.24
pass gossip attestations to forkchoice per slot 2.7924 ms/op 2.7392 ms/op 1.02
forkChoice updateHead vc 100000 bc 64 eq 0 503.44 us/op 436.02 us/op 1.15
forkChoice updateHead vc 600000 bc 64 eq 0 2.7156 ms/op 3.9759 ms/op 0.68
forkChoice updateHead vc 1000000 bc 64 eq 0 4.3382 ms/op 4.7300 ms/op 0.92
forkChoice updateHead vc 600000 bc 320 eq 0 2.6262 ms/op 2.6168 ms/op 1.00
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7168 ms/op 2.7441 ms/op 0.99
forkChoice updateHead vc 600000 bc 7200 eq 0 3.2140 ms/op 3.3402 ms/op 0.96
forkChoice updateHead vc 600000 bc 64 eq 1000 9.9056 ms/op 10.141 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 10000 9.7847 ms/op 9.7660 ms/op 1.00
forkChoice updateHead vc 600000 bc 64 eq 300000 11.917 ms/op 11.923 ms/op 1.00
computeDeltas 500000 validators 300 proto nodes 3.0348 ms/op 3.3634 ms/op 0.90
computeDeltas 500000 validators 1200 proto nodes 2.9253 ms/op 3.4003 ms/op 0.86
computeDeltas 500000 validators 7200 proto nodes 2.9726 ms/op 4.0593 ms/op 0.73
computeDeltas 750000 validators 300 proto nodes 4.5181 ms/op 5.8967 ms/op 0.77
computeDeltas 750000 validators 1200 proto nodes 4.6634 ms/op 5.2569 ms/op 0.89
computeDeltas 750000 validators 7200 proto nodes 4.5661 ms/op 5.0187 ms/op 0.91
computeDeltas 1400000 validators 300 proto nodes 8.9509 ms/op 9.6321 ms/op 0.93
computeDeltas 1400000 validators 1200 proto nodes 9.0767 ms/op 9.9602 ms/op 0.91
computeDeltas 1400000 validators 7200 proto nodes 9.2433 ms/op 8.8812 ms/op 1.04
computeDeltas 2100000 validators 300 proto nodes 13.593 ms/op 13.292 ms/op 1.02
computeDeltas 2100000 validators 1200 proto nodes 13.861 ms/op 13.783 ms/op 1.01
computeDeltas 2100000 validators 7200 proto nodes 13.500 ms/op 13.371 ms/op 1.01
altair processAttestation - 250000 vs - 7PWei normalcase 1.6242 ms/op 1.8119 ms/op 0.90
altair processAttestation - 250000 vs - 7PWei worstcase 2.3220 ms/op 2.5297 ms/op 0.92
altair processAttestation - setStatus - 1/6 committees join 102.15 us/op 75.246 us/op 1.36
altair processAttestation - setStatus - 1/3 committees join 188.49 us/op 157.76 us/op 1.19
altair processAttestation - setStatus - 1/2 committees join 287.10 us/op 227.80 us/op 1.26
altair processAttestation - setStatus - 2/3 committees join 363.30 us/op 291.18 us/op 1.25
altair processAttestation - setStatus - 4/5 committees join 474.64 us/op 410.52 us/op 1.16
altair processAttestation - setStatus - 100% committees join 569.22 us/op 520.39 us/op 1.09
altair processBlock - 250000 vs - 7PWei normalcase 7.7993 ms/op 7.8769 ms/op 0.99
altair processBlock - 250000 vs - 7PWei normalcase hashState 30.434 ms/op 34.550 ms/op 0.88
altair processBlock - 250000 vs - 7PWei worstcase 34.011 ms/op 30.820 ms/op 1.10
altair processBlock - 250000 vs - 7PWei worstcase hashState 79.973 ms/op 82.071 ms/op 0.97
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4948 ms/op 2.0821 ms/op 1.20
phase0 processBlock - 250000 vs - 7PWei worstcase 24.951 ms/op 26.347 ms/op 0.95
altair processEth1Data - 250000 vs - 7PWei normalcase 304.70 us/op 428.86 us/op 0.71
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.7010 us/op 12.878 us/op 0.75
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 53.120 us/op 40.971 us/op 1.30
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 5.3530 us/op 16.362 us/op 0.33
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 3.4420 us/op 11.095 us/op 0.31
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 139.22 us/op 149.57 us/op 0.93
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 654.46 us/op 1.0655 ms/op 0.61
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 882.15 us/op 1.2226 ms/op 0.72
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0892 ms/op 1.1474 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.0515 ms/op 2.9467 ms/op 0.70
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6067 ms/op 1.8773 ms/op 0.86
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.4752 ms/op 4.2027 ms/op 0.83
Tree 40 250000 create 254.39 ms/op 322.87 ms/op 0.79
Tree 40 250000 get(125000) 113.17 ns/op 127.89 ns/op 0.88
Tree 40 250000 set(125000) 718.54 ns/op 870.09 ns/op 0.83
Tree 40 250000 toArray() 9.6906 ms/op 21.209 ms/op 0.46
Tree 40 250000 iterate all - toArray() + loop 10.431 ms/op 20.127 ms/op 0.52
Tree 40 250000 iterate all - get(i) 40.007 ms/op 50.673 ms/op 0.79
MutableVector 250000 create 9.5921 ms/op 9.3451 ms/op 1.03
MutableVector 250000 get(125000) 5.5900 ns/op 9.7760 ns/op 0.57
MutableVector 250000 set(125000) 206.89 ns/op 230.93 ns/op 0.90
MutableVector 250000 toArray() 2.1944 ms/op 3.1428 ms/op 0.70
MutableVector 250000 iterate all - toArray() + loop 2.2037 ms/op 3.3234 ms/op 0.66
MutableVector 250000 iterate all - get(i) 1.3296 ms/op 1.4378 ms/op 0.92
Array 250000 create 2.0130 ms/op 3.1746 ms/op 0.63
Array 250000 clone - spread 1.1769 ms/op 1.2754 ms/op 0.92
Array 250000 get(125000) 1.0650 ns/op 1.0110 ns/op 1.05
Array 250000 set(125000) 1.2730 ns/op 1.2180 ns/op 1.05
Array 250000 iterate all - loop 153.27 us/op 155.13 us/op 0.99
effectiveBalanceIncrements clone Uint8Array 300000 14.607 us/op 13.385 us/op 1.09
effectiveBalanceIncrements clone MutableVector 300000 441.00 ns/op 374.00 ns/op 1.18
effectiveBalanceIncrements rw all Uint8Array 300000 183.70 us/op 187.43 us/op 0.98
effectiveBalanceIncrements rw all MutableVector 300000 66.198 ms/op 74.820 ms/op 0.88
phase0 afterProcessEpoch - 250000 vs - 7PWei 70.433 ms/op 77.690 ms/op 0.91
phase0 beforeProcessEpoch - 250000 vs - 7PWei 40.369 ms/op 48.132 ms/op 0.84
altair processEpoch - mainnet_e81889 428.50 ms/op 408.17 ms/op 1.05
mainnet_e81889 - altair beforeProcessEpoch 71.667 ms/op 80.978 ms/op 0.89
mainnet_e81889 - altair processJustificationAndFinalization 10.703 us/op 14.825 us/op 0.72
mainnet_e81889 - altair processInactivityUpdates 4.5785 ms/op 7.1509 ms/op 0.64
mainnet_e81889 - altair processRewardsAndPenalties 61.410 ms/op 63.208 ms/op 0.97
mainnet_e81889 - altair processRegistryUpdates 1.7050 us/op 3.2580 us/op 0.52
mainnet_e81889 - altair processSlashings 629.00 ns/op 1.0240 us/op 0.61
mainnet_e81889 - altair processEth1DataReset 566.00 ns/op 820.00 ns/op 0.69
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7587 ms/op 1.1947 ms/op 1.47
mainnet_e81889 - altair processSlashingsReset 1.8700 us/op 4.5620 us/op 0.41
mainnet_e81889 - altair processRandaoMixesReset 4.7100 us/op 9.1850 us/op 0.51
mainnet_e81889 - altair processHistoricalRootsUpdate 678.00 ns/op 1.4850 us/op 0.46
mainnet_e81889 - altair processParticipationFlagUpdates 1.8360 us/op 3.9380 us/op 0.47
mainnet_e81889 - altair processSyncCommitteeUpdates 709.00 ns/op 1.0120 us/op 0.70
mainnet_e81889 - altair afterProcessEpoch 77.557 ms/op 87.478 ms/op 0.89
capella processEpoch - mainnet_e217614 1.7797 s/op 2.2393 s/op 0.79
mainnet_e217614 - capella beforeProcessEpoch 406.48 ms/op 452.43 ms/op 0.90
mainnet_e217614 - capella processJustificationAndFinalization 13.093 us/op 18.544 us/op 0.71
mainnet_e217614 - capella processInactivityUpdates 17.843 ms/op 24.249 ms/op 0.74
mainnet_e217614 - capella processRewardsAndPenalties 379.47 ms/op 436.33 ms/op 0.87
mainnet_e217614 - capella processRegistryUpdates 13.858 us/op 16.343 us/op 0.85
mainnet_e217614 - capella processSlashings 571.00 ns/op 1.2700 us/op 0.45
mainnet_e217614 - capella processEth1DataReset 685.00 ns/op 636.00 ns/op 1.08
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.4713 ms/op 3.9448 ms/op 1.13
mainnet_e217614 - capella processSlashingsReset 1.6060 us/op 3.0340 us/op 0.53
mainnet_e217614 - capella processRandaoMixesReset 1.8340 us/op 5.6200 us/op 0.33
mainnet_e217614 - capella processHistoricalRootsUpdate 517.00 ns/op 926.00 ns/op 0.56
mainnet_e217614 - capella processParticipationFlagUpdates 1.2570 us/op 2.4470 us/op 0.51
mainnet_e217614 - capella afterProcessEpoch 221.58 ms/op 217.17 ms/op 1.02
phase0 processEpoch - mainnet_e58758 388.35 ms/op 418.22 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 106.99 ms/op 127.45 ms/op 0.84
mainnet_e58758 - phase0 processJustificationAndFinalization 12.100 us/op 13.177 us/op 0.92
mainnet_e58758 - phase0 processRewardsAndPenalties 53.778 ms/op 53.804 ms/op 1.00
mainnet_e58758 - phase0 processRegistryUpdates 7.4630 us/op 10.527 us/op 0.71
mainnet_e58758 - phase0 processSlashings 570.00 ns/op 679.00 ns/op 0.84
mainnet_e58758 - phase0 processEth1DataReset 292.00 ns/op 716.00 ns/op 0.41
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 809.38 us/op 943.43 us/op 0.86
mainnet_e58758 - phase0 processSlashingsReset 2.7010 us/op 4.8820 us/op 0.55
mainnet_e58758 - phase0 processRandaoMixesReset 2.3680 us/op 5.6310 us/op 0.42
mainnet_e58758 - phase0 processHistoricalRootsUpdate 708.00 ns/op 1.2010 us/op 0.59
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.5760 us/op 3.5960 us/op 0.72
mainnet_e58758 - phase0 afterProcessEpoch 61.926 ms/op 69.596 ms/op 0.89
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.6937 ms/op 1.0833 ms/op 1.56
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1220 ms/op 1.5267 ms/op 0.73
altair processInactivityUpdates - 250000 normalcase 25.338 ms/op 27.108 ms/op 0.93
altair processInactivityUpdates - 250000 worstcase 24.319 ms/op 26.038 ms/op 0.93
phase0 processRegistryUpdates - 250000 normalcase 6.8590 us/op 10.912 us/op 0.63
phase0 processRegistryUpdates - 250000 badcase_full_deposits 431.13 us/op 482.09 us/op 0.89
phase0 processRegistryUpdates - 250000 worstcase 0.5 131.38 ms/op 126.75 ms/op 1.04
altair processRewardsAndPenalties - 250000 normalcase 57.530 ms/op 57.331 ms/op 1.00
altair processRewardsAndPenalties - 250000 worstcase 50.307 ms/op 55.918 ms/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 5.7337 ms/op 7.3145 ms/op 0.78
phase0 getAttestationDeltas - 250000 worstcase 5.6148 ms/op 7.7384 ms/op 0.73
phase0 processSlashings - 250000 worstcase 75.245 us/op 83.035 us/op 0.91
altair processSyncCommitteeUpdates - 250000 97.783 ms/op 106.75 ms/op 0.92
BeaconState.hashTreeRoot - No change 383.00 ns/op 354.00 ns/op 1.08
BeaconState.hashTreeRoot - 1 full validator 84.027 us/op 123.08 us/op 0.68
BeaconState.hashTreeRoot - 32 full validator 1.3666 ms/op 1.0962 ms/op 1.25
BeaconState.hashTreeRoot - 512 full validator 13.082 ms/op 9.7652 ms/op 1.34
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 133.30 us/op 150.22 us/op 0.89
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7499 ms/op 1.6883 ms/op 1.04
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 26.144 ms/op 20.989 ms/op 1.25
BeaconState.hashTreeRoot - 1 balances 95.379 us/op 100.36 us/op 0.95
BeaconState.hashTreeRoot - 32 balances 966.74 us/op 990.33 us/op 0.98
BeaconState.hashTreeRoot - 512 balances 9.5933 ms/op 13.206 ms/op 0.73
BeaconState.hashTreeRoot - 250000 balances 149.36 ms/op 205.95 ms/op 0.73
aggregationBits - 2048 els - zipIndexesInBitList 10.939 us/op 10.921 us/op 1.00
byteArrayEquals 32 65.391 ns/op 66.851 ns/op 0.98
Buffer.compare 32 40.221 ns/op 38.600 ns/op 1.04
byteArrayEquals 1024 1.7697 us/op 1.8534 us/op 0.95
Buffer.compare 1024 43.981 ns/op 46.272 ns/op 0.95
byteArrayEquals 16384 28.020 us/op 28.804 us/op 0.97
Buffer.compare 16384 225.95 ns/op 208.94 ns/op 1.08
byteArrayEquals 123687377 208.30 ms/op 210.84 ms/op 0.99
Buffer.compare 123687377 3.7463 ms/op 5.2797 ms/op 0.71
byteArrayEquals 32 - diff last byte 61.403 ns/op 66.373 ns/op 0.93
Buffer.compare 32 - diff last byte 37.461 ns/op 39.684 ns/op 0.94
byteArrayEquals 1024 - diff last byte 1.7090 us/op 1.7632 us/op 0.97
Buffer.compare 1024 - diff last byte 45.818 ns/op 45.781 ns/op 1.00
byteArrayEquals 16384 - diff last byte 27.206 us/op 28.327 us/op 0.96
Buffer.compare 16384 - diff last byte 219.83 ns/op 205.51 ns/op 1.07
byteArrayEquals 123687377 - diff last byte 193.86 ms/op 218.79 ms/op 0.89
Buffer.compare 123687377 - diff last byte 5.3222 ms/op 4.5272 ms/op 1.18
byteArrayEquals 32 - random bytes 4.3000 ns/op 4.5780 ns/op 0.94
Buffer.compare 32 - random bytes 34.799 ns/op 39.747 ns/op 0.88
byteArrayEquals 1024 - random bytes 4.0610 ns/op 4.5020 ns/op 0.90
Buffer.compare 1024 - random bytes 33.147 ns/op 38.123 ns/op 0.87
byteArrayEquals 16384 - random bytes 4.0470 ns/op 4.4930 ns/op 0.90
Buffer.compare 16384 - random bytes 33.211 ns/op 38.222 ns/op 0.87
byteArrayEquals 123687377 - random bytes 7.0800 ns/op 8.0800 ns/op 0.88
Buffer.compare 123687377 - random bytes 36.150 ns/op 41.720 ns/op 0.87
regular array get 100000 times 37.497 us/op 41.078 us/op 0.91
wrappedArray get 100000 times 37.237 us/op 40.942 us/op 0.91
arrayWithProxy get 100000 times 10.457 ms/op 9.8873 ms/op 1.06
ssz.Root.equals 54.000 ns/op 55.374 ns/op 0.98
byteArrayEquals 53.308 ns/op 54.413 ns/op 0.98
Buffer.compare 10.188 ns/op 10.156 ns/op 1.00
shuffle list - 16384 els 4.1873 ms/op 4.5342 ms/op 0.92
shuffle list - 250000 els 60.980 ms/op 69.032 ms/op 0.88
processSlot - 1 slots 14.952 us/op 14.383 us/op 1.04
processSlot - 32 slots 3.9773 ms/op 2.9010 ms/op 1.37
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 55.412 ms/op 53.065 ms/op 1.04
getCommitteeAssignments - req 1 vs - 250000 vc 2.2617 ms/op 2.1947 ms/op 1.03
getCommitteeAssignments - req 100 vs - 250000 vc 3.3056 ms/op 3.3461 ms/op 0.99
getCommitteeAssignments - req 1000 vs - 250000 vc 3.5122 ms/op 3.7326 ms/op 0.94
findModifiedValidators - 10000 modified validators 403.70 ms/op 403.99 ms/op 1.00
findModifiedValidators - 1000 modified validators 282.47 ms/op 341.51 ms/op 0.83
findModifiedValidators - 100 modified validators 286.52 ms/op 330.02 ms/op 0.87
findModifiedValidators - 10 modified validators 313.11 ms/op 319.84 ms/op 0.98
findModifiedValidators - 1 modified validators 298.95 ms/op 322.63 ms/op 0.93
findModifiedValidators - no difference 301.57 ms/op 326.88 ms/op 0.92
compare ViewDUs 3.9277 s/op 4.1765 s/op 0.94
compare each validator Uint8Array 1.3207 s/op 1.7222 s/op 0.77
compare ViewDU to Uint8Array 842.28 ms/op 988.73 ms/op 0.85
migrate state 1000000 validators, 24 modified, 0 new 644.72 ms/op 749.77 ms/op 0.86
migrate state 1000000 validators, 1700 modified, 1000 new 1.0094 s/op 1.0264 s/op 0.98
migrate state 1000000 validators, 3400 modified, 2000 new 1.1609 s/op 1.3753 s/op 0.84
migrate state 1500000 validators, 24 modified, 0 new 741.61 ms/op 708.10 ms/op 1.05
migrate state 1500000 validators, 1700 modified, 1000 new 1.0479 s/op 1.0319 s/op 1.02
migrate state 1500000 validators, 3400 modified, 2000 new 1.3114 s/op 1.1864 s/op 1.11
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.7500 ns/op 4.9300 ns/op 0.96
state getBlockRootAtSlot - 250000 vs - 7PWei 778.96 ns/op 992.83 ns/op 0.78
computeProposers - vc 250000 6.7944 ms/op 8.1622 ms/op 0.83
computeEpochShuffling - vc 250000 67.665 ms/op 81.083 ms/op 0.83
getNextSyncCommittee - vc 250000 111.21 ms/op 132.74 ms/op 0.84
computeSigningRoot for AttestationData 24.874 us/op 26.233 us/op 0.95
hash AttestationData serialized data then Buffer.toString(base64) 1.1830 us/op 1.3939 us/op 0.85
toHexString serialized data 745.97 ns/op 900.64 ns/op 0.83
Buffer.toString(base64) 143.43 ns/op 175.99 ns/op 0.81

by benchmarkbot/action

@philknows philknows added this to the v1.17.0 milestone Mar 6, 2024
@g11tech g11tech merged commit 52ac155 into unstable Mar 6, 2024
20 checks passed
@g11tech g11tech deleted the tuyen/add_clone_option_to_state_caches branch March 6, 2024 13:47
philknows pushed a commit that referenced this pull request Mar 6, 2024
* feat: clone option for state caches

* fix: compilation error
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.17.0 🎉

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.

Higher block processing time
4 participants