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: new BeaconState.balances ssz type #6557

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 18, 2024

Motivation

  • Reduce missing ssz balances cache of BeaconState which help processing blocks faster

Description

Closes #6520

Test result

  • It processes ~3ms faster on mainnet and ~4ms faster on holesky
  • Missed balances cache metrics are close to 0 now
Screenshot 2024-03-18 at 09 36 40

@twoeths twoeths requested a review from a team as a code owner March 18, 2024 02:37
Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Merging #6557 (7da5063) into unstable (9e5864d) will decrease coverage by 0.07%.
Report is 1 commits behind head on unstable.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6557      +/-   ##
============================================
- Coverage     61.46%   61.40%   -0.07%     
============================================
  Files           556      556              
  Lines         58652    58753     +101     
  Branches       1848     1848              
============================================
+ Hits          36051    36075      +24     
- Misses        22561    22638      +77     
  Partials         40       40              

Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 9ed3e15 Previous: 57127cc Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 731.89 us/op 1.0006 ms/op 0.73
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 81.106 us/op 86.002 us/op 0.94
BLS verify - blst-native 1.2908 ms/op 1.2913 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.7106 ms/op 2.7452 ms/op 0.99
BLS verifyMultipleSignatures 8 - blst-native 5.9484 ms/op 5.9397 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 21.757 ms/op 21.945 ms/op 0.99
BLS verifyMultipleSignatures 64 - blst-native 42.834 ms/op 43.425 ms/op 0.99
BLS verifyMultipleSignatures 128 - blst-native 85.050 ms/op 88.401 ms/op 0.96
BLS deserializing 10000 signatures 861.42 ms/op 925.57 ms/op 0.93
BLS deserializing 100000 signatures 9.1130 s/op 9.4651 s/op 0.96
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.2603 ms/op 1.3416 ms/op 0.94
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.4206 ms/op 1.6891 ms/op 0.84
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.7669 ms/op 2.3059 ms/op 1.20
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.9803 ms/op 3.3898 ms/op 1.17
BLS verifyMultipleSignatures - same message - 128 - blst-native 7.3127 ms/op 8.0454 ms/op 0.91
BLS aggregatePubkeys 32 - blst-native 26.469 us/op 28.006 us/op 0.95
BLS aggregatePubkeys 128 - blst-native 96.625 us/op 100.74 us/op 0.96
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 61.084 ms/op 60.698 ms/op 1.01
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 63.470 ms/op 58.323 ms/op 1.09
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 34.670 ms/op 34.725 ms/op 1.00
getSlashingsAndExits - default max 185.62 us/op 193.37 us/op 0.96
getSlashingsAndExits - 2k 384.74 us/op 392.73 us/op 0.98
proposeBlockBody type=full, size=empty 5.5969 ms/op 5.5382 ms/op 1.01
isKnown best case - 1 super set check 298.00 ns/op 322.00 ns/op 0.93
isKnown normal case - 2 super set checks 284.00 ns/op 304.00 ns/op 0.93
isKnown worse case - 16 super set checks 281.00 ns/op 304.00 ns/op 0.92
CheckpointStateCache - add get delete 5.4410 us/op 6.1530 us/op 0.88
validate api signedAggregateAndProof - struct 2.6686 ms/op 2.8029 ms/op 0.95
validate gossip signedAggregateAndProof - struct 2.7482 ms/op 2.8109 ms/op 0.98
validate gossip attestation - vc 640000 1.3514 ms/op 1.3583 ms/op 0.99
batch validate gossip attestation - vc 640000 - chunk 32 161.12 us/op 162.92 us/op 0.99
batch validate gossip attestation - vc 640000 - chunk 64 141.81 us/op 148.97 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 128 136.20 us/op 144.05 us/op 0.95
batch validate gossip attestation - vc 640000 - chunk 256 127.82 us/op 135.75 us/op 0.94
pickEth1Vote - no votes 1.2595 ms/op 1.2442 ms/op 1.01
pickEth1Vote - max votes 9.7092 ms/op 8.6777 ms/op 1.12
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.342 ms/op 16.563 ms/op 1.17
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 29.598 ms/op 32.685 ms/op 0.91
pickEth1Vote - Eth1Data fastSerialize value x2048 589.56 us/op 648.25 us/op 0.91
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.6173 ms/op 7.3648 ms/op 1.03
bytes32 toHexString 478.00 ns/op 512.00 ns/op 0.93
bytes32 Buffer.toString(hex) 288.00 ns/op 317.00 ns/op 0.91
bytes32 Buffer.toString(hex) from Uint8Array 407.00 ns/op 447.00 ns/op 0.91
bytes32 Buffer.toString(hex) + 0x 292.00 ns/op 323.00 ns/op 0.90
Object access 1 prop 0.16400 ns/op 0.18700 ns/op 0.88
Map access 1 prop 0.13900 ns/op 0.16000 ns/op 0.87
Object get x1000 6.9270 ns/op 8.8570 ns/op 0.78
Map get x1000 0.71300 ns/op 0.86000 ns/op 0.83
Object set x1000 48.256 ns/op 53.780 ns/op 0.90
Map set x1000 37.813 ns/op 43.553 ns/op 0.87
Return object 10000 times 0.23450 ns/op 0.25300 ns/op 0.93
Throw Error 10000 times 3.8335 us/op 4.1779 us/op 0.92
fastMsgIdFn sha256 / 200 bytes 3.1620 us/op 3.5450 us/op 0.89
fastMsgIdFn h32 xxhash / 200 bytes 265.00 ns/op 334.00 ns/op 0.79
fastMsgIdFn h64 xxhash / 200 bytes 328.00 ns/op 393.00 ns/op 0.83
fastMsgIdFn sha256 / 1000 bytes 11.002 us/op 12.281 us/op 0.90
fastMsgIdFn h32 xxhash / 1000 bytes 424.00 ns/op 478.00 ns/op 0.89
fastMsgIdFn h64 xxhash / 1000 bytes 406.00 ns/op 473.00 ns/op 0.86
fastMsgIdFn sha256 / 10000 bytes 100.60 us/op 112.03 us/op 0.90
fastMsgIdFn h32 xxhash / 10000 bytes 1.8670 us/op 2.0600 us/op 0.91
fastMsgIdFn h64 xxhash / 10000 bytes 1.3070 us/op 1.4410 us/op 0.91
send data - 1000 256B messages 19.371 ms/op 20.872 ms/op 0.93
send data - 1000 512B messages 24.003 ms/op 24.462 ms/op 0.98
send data - 1000 1024B messages 42.137 ms/op 42.239 ms/op 1.00
send data - 1000 1200B messages 38.574 ms/op 40.480 ms/op 0.95
send data - 1000 2048B messages 47.896 ms/op 50.396 ms/op 0.95
send data - 1000 4096B messages 41.593 ms/op 46.107 ms/op 0.90
send data - 1000 16384B messages 116.10 ms/op 124.11 ms/op 0.94
send data - 1000 65536B messages 459.72 ms/op 442.57 ms/op 1.04
enrSubnets - fastDeserialize 64 bits 1.3980 us/op 1.2680 us/op 1.10
enrSubnets - ssz BitVector 64 bits 477.00 ns/op 413.00 ns/op 1.15
enrSubnets - fastDeserialize 4 bits 203.00 ns/op 172.00 ns/op 1.18
enrSubnets - ssz BitVector 4 bits 516.00 ns/op 425.00 ns/op 1.21
prioritizePeers score -10:0 att 32-0.1 sync 2-0 117.67 us/op 108.17 us/op 1.09
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 138.06 us/op 127.44 us/op 1.08
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 190.29 us/op 163.78 us/op 1.16
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 331.62 us/op 290.12 us/op 1.14
prioritizePeers score 0:0 att 64-1 sync 4-1 367.76 us/op 340.17 us/op 1.08
array of 16000 items push then shift 1.6127 us/op 1.6069 us/op 1.00
LinkedList of 16000 items push then shift 8.7710 ns/op 9.1700 ns/op 0.96
array of 16000 items push then pop 100.05 ns/op 79.001 ns/op 1.27
LinkedList of 16000 items push then pop 8.5790 ns/op 8.8370 ns/op 0.97
array of 24000 items push then shift 2.3545 us/op 2.4227 us/op 0.97
LinkedList of 24000 items push then shift 8.5750 ns/op 9.4800 ns/op 0.90
array of 24000 items push then pop 109.37 ns/op 114.90 ns/op 0.95
LinkedList of 24000 items push then pop 8.5780 ns/op 9.7680 ns/op 0.88
intersect bitArray bitLen 8 5.5950 ns/op 6.0770 ns/op 0.92
intersect array and set length 8 61.132 ns/op 63.531 ns/op 0.96
intersect bitArray bitLen 128 34.108 ns/op 36.442 ns/op 0.94
intersect array and set length 128 827.81 ns/op 876.46 ns/op 0.94
bitArray.getTrueBitIndexes() bitLen 128 1.5450 us/op 1.5000 us/op 1.03
bitArray.getTrueBitIndexes() bitLen 248 2.4450 us/op 2.5080 us/op 0.97
bitArray.getTrueBitIndexes() bitLen 512 4.7870 us/op 4.8580 us/op 0.99
Buffer.concat 32 items 995.00 ns/op 1.0280 us/op 0.97
Uint8Array.set 32 items 1.8730 us/op 2.2360 us/op 0.84
Set add up to 64 items then delete first 4.3695 us/op 4.3014 us/op 1.02
OrderedSet add up to 64 items then delete first 6.0247 us/op 5.4687 us/op 1.10
Set add up to 64 items then delete last 4.6258 us/op 4.6416 us/op 1.00
OrderedSet add up to 64 items then delete last 6.0372 us/op 5.8264 us/op 1.04
Set add up to 64 items then delete middle 4.6787 us/op 4.6656 us/op 1.00
OrderedSet add up to 64 items then delete middle 7.0966 us/op 7.2856 us/op 0.97
Set add up to 128 items then delete first 9.1113 us/op 9.3836 us/op 0.97
OrderedSet add up to 128 items then delete first 12.696 us/op 12.675 us/op 1.00
Set add up to 128 items then delete last 9.1254 us/op 9.2818 us/op 0.98
OrderedSet add up to 128 items then delete last 11.301 us/op 11.962 us/op 0.94
Set add up to 128 items then delete middle 8.9213 us/op 9.2739 us/op 0.96
OrderedSet add up to 128 items then delete middle 16.345 us/op 17.547 us/op 0.93
Set add up to 256 items then delete first 18.082 us/op 19.223 us/op 0.94
OrderedSet add up to 256 items then delete first 25.526 us/op 25.788 us/op 0.99
Set add up to 256 items then delete last 17.985 us/op 18.508 us/op 0.97
OrderedSet add up to 256 items then delete last 23.126 us/op 23.690 us/op 0.98
Set add up to 256 items then delete middle 18.189 us/op 18.404 us/op 0.99
OrderedSet add up to 256 items then delete middle 44.780 us/op 47.006 us/op 0.95
transfer serialized Status (84 B) 1.6570 us/op 1.7710 us/op 0.94
copy serialized Status (84 B) 1.2370 us/op 1.3180 us/op 0.94
transfer serialized SignedVoluntaryExit (112 B) 1.7720 us/op 1.7690 us/op 1.00
copy serialized SignedVoluntaryExit (112 B) 1.3740 us/op 1.3970 us/op 0.98
transfer serialized ProposerSlashing (416 B) 2.9930 us/op 2.5800 us/op 1.16
copy serialized ProposerSlashing (416 B) 2.2230 us/op 2.4860 us/op 0.89
transfer serialized Attestation (485 B) 2.8250 us/op 3.0070 us/op 0.94
copy serialized Attestation (485 B) 2.4260 us/op 2.7500 us/op 0.88
transfer serialized AttesterSlashing (33232 B) 2.5330 us/op 2.9610 us/op 0.86
copy serialized AttesterSlashing (33232 B) 5.9530 us/op 7.4510 us/op 0.80
transfer serialized Small SignedBeaconBlock (128000 B) 2.5680 us/op 3.8250 us/op 0.67
copy serialized Small SignedBeaconBlock (128000 B) 13.647 us/op 14.972 us/op 0.91
transfer serialized Avg SignedBeaconBlock (200000 B) 3.1390 us/op 3.6190 us/op 0.87
copy serialized Avg SignedBeaconBlock (200000 B) 20.078 us/op 21.960 us/op 0.91
transfer serialized BlobsSidecar (524380 B) 2.9560 us/op 3.0570 us/op 0.97
copy serialized BlobsSidecar (524380 B) 84.296 us/op 83.662 us/op 1.01
transfer serialized Big SignedBeaconBlock (1000000 B) 2.9880 us/op 3.4120 us/op 0.88
copy serialized Big SignedBeaconBlock (1000000 B) 164.98 us/op 185.77 us/op 0.89
pass gossip attestations to forkchoice per slot 3.8567 ms/op 4.4196 ms/op 0.87
forkChoice updateHead vc 100000 bc 64 eq 0 677.60 us/op 692.21 us/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 0 4.9055 ms/op 4.3305 ms/op 1.13
forkChoice updateHead vc 1000000 bc 64 eq 0 7.3076 ms/op 7.1297 ms/op 1.02
forkChoice updateHead vc 600000 bc 320 eq 0 4.1387 ms/op 4.2475 ms/op 0.97
forkChoice updateHead vc 600000 bc 1200 eq 0 4.2033 ms/op 4.4014 ms/op 0.95
forkChoice updateHead vc 600000 bc 7200 eq 0 5.1464 ms/op 5.3108 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 1000 10.965 ms/op 11.259 ms/op 0.97
forkChoice updateHead vc 600000 bc 64 eq 10000 11.852 ms/op 12.123 ms/op 0.98
forkChoice updateHead vc 600000 bc 64 eq 300000 16.202 ms/op 16.353 ms/op 0.99
computeDeltas 500000 validators 300 proto nodes 6.4840 ms/op 6.9935 ms/op 0.93
computeDeltas 500000 validators 1200 proto nodes 6.5043 ms/op 6.9508 ms/op 0.94
computeDeltas 500000 validators 7200 proto nodes 6.2728 ms/op 6.7475 ms/op 0.93
computeDeltas 750000 validators 300 proto nodes 9.3707 ms/op 11.016 ms/op 0.85
computeDeltas 750000 validators 1200 proto nodes 9.5091 ms/op 11.698 ms/op 0.81
computeDeltas 750000 validators 7200 proto nodes 9.4479 ms/op 11.723 ms/op 0.81
computeDeltas 1400000 validators 300 proto nodes 17.509 ms/op 24.332 ms/op 0.72
computeDeltas 1400000 validators 1200 proto nodes 17.910 ms/op 24.138 ms/op 0.74
computeDeltas 1400000 validators 7200 proto nodes 18.206 ms/op 25.029 ms/op 0.73
computeDeltas 2100000 validators 300 proto nodes 27.084 ms/op 36.897 ms/op 0.73
computeDeltas 2100000 validators 1200 proto nodes 27.463 ms/op 35.176 ms/op 0.78
computeDeltas 2100000 validators 7200 proto nodes 27.894 ms/op 35.324 ms/op 0.79
altair processAttestation - 250000 vs - 7PWei normalcase 2.1904 ms/op 3.1276 ms/op 0.70
altair processAttestation - 250000 vs - 7PWei worstcase 3.2375 ms/op 4.2119 ms/op 0.77
altair processAttestation - setStatus - 1/6 committees join 181.77 us/op 240.31 us/op 0.76
altair processAttestation - setStatus - 1/3 committees join 339.24 us/op 391.49 us/op 0.87
altair processAttestation - setStatus - 1/2 committees join 454.36 us/op 539.31 us/op 0.84
altair processAttestation - setStatus - 2/3 committees join 574.42 us/op 712.40 us/op 0.81
altair processAttestation - setStatus - 4/5 committees join 763.69 us/op 1.0527 ms/op 0.73
altair processAttestation - setStatus - 100% committees join 920.36 us/op 1.1614 ms/op 0.79
altair processBlock - 250000 vs - 7PWei normalcase 9.7756 ms/op 12.267 ms/op 0.80
altair processBlock - 250000 vs - 7PWei normalcase hashState 33.801 ms/op 45.935 ms/op 0.74
altair processBlock - 250000 vs - 7PWei worstcase 42.672 ms/op 43.437 ms/op 0.98
altair processBlock - 250000 vs - 7PWei worstcase hashState 90.784 ms/op 111.30 ms/op 0.82
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3593 ms/op 2.6962 ms/op 0.88
phase0 processBlock - 250000 vs - 7PWei worstcase 28.689 ms/op 32.338 ms/op 0.89
altair processEth1Data - 250000 vs - 7PWei normalcase 569.09 us/op 647.62 us/op 0.88
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.0230 us/op 8.7860 us/op 1.03
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 58.955 us/op 87.842 us/op 0.67
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 18.277 us/op 15.678 us/op 1.17
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 10.302 us/op 8.6810 us/op 1.19
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 159.10 us/op 218.55 us/op 0.73
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.0167 ms/op 2.7726 ms/op 0.37
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.5209 ms/op 2.6536 ms/op 0.57
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.4957 ms/op 2.3903 ms/op 0.63
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 3.1985 ms/op 4.1614 ms/op 0.77
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 2.3935 ms/op 2.6070 ms/op 0.92
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.1147 ms/op 4.8500 ms/op 1.05
Tree 40 250000 create 351.86 ms/op 364.99 ms/op 0.96
Tree 40 250000 get(125000) 194.88 ns/op 217.38 ns/op 0.90
Tree 40 250000 set(125000) 1.0174 us/op 1.0491 us/op 0.97
Tree 40 250000 toArray() 20.286 ms/op 20.208 ms/op 1.00
Tree 40 250000 iterate all - toArray() + loop 19.703 ms/op 20.175 ms/op 0.98
Tree 40 250000 iterate all - get(i) 65.341 ms/op 71.951 ms/op 0.91
MutableVector 250000 create 11.030 ms/op 19.818 ms/op 0.56
MutableVector 250000 get(125000) 6.3830 ns/op 7.0940 ns/op 0.90
MutableVector 250000 set(125000) 269.52 ns/op 268.37 ns/op 1.00
MutableVector 250000 toArray() 3.1281 ms/op 3.3902 ms/op 0.92
MutableVector 250000 iterate all - toArray() + loop 3.5690 ms/op 3.6941 ms/op 0.97
MutableVector 250000 iterate all - get(i) 1.4833 ms/op 1.6695 ms/op 0.89
Array 250000 create 2.9238 ms/op 3.0549 ms/op 0.96
Array 250000 clone - spread 1.4376 ms/op 1.2664 ms/op 1.14
Array 250000 get(125000) 1.1100 ns/op 1.1020 ns/op 1.01
Array 250000 set(125000) 4.0980 ns/op 4.2090 ns/op 0.97
Array 250000 iterate all - loop 160.56 us/op 180.75 us/op 0.89
effectiveBalanceIncrements clone Uint8Array 300000 32.633 us/op 26.372 us/op 1.24
effectiveBalanceIncrements clone MutableVector 300000 451.00 ns/op 368.00 ns/op 1.23
effectiveBalanceIncrements rw all Uint8Array 300000 194.03 us/op 221.73 us/op 0.88
effectiveBalanceIncrements rw all MutableVector 300000 94.916 ms/op 85.053 ms/op 1.12
phase0 afterProcessEpoch - 250000 vs - 7PWei 117.93 ms/op 123.64 ms/op 0.95
phase0 beforeProcessEpoch - 250000 vs - 7PWei 46.981 ms/op 57.312 ms/op 0.82
altair processEpoch - mainnet_e81889 493.51 ms/op 574.60 ms/op 0.86
mainnet_e81889 - altair beforeProcessEpoch 85.010 ms/op 81.793 ms/op 1.04
mainnet_e81889 - altair processJustificationAndFinalization 15.986 us/op 24.624 us/op 0.65
mainnet_e81889 - altair processInactivityUpdates 6.9097 ms/op 6.1472 ms/op 1.12
mainnet_e81889 - altair processRewardsAndPenalties 55.375 ms/op 71.441 ms/op 0.78
mainnet_e81889 - altair processRegistryUpdates 2.3320 us/op 3.7970 us/op 0.61
mainnet_e81889 - altair processSlashings 532.00 ns/op 645.00 ns/op 0.82
mainnet_e81889 - altair processEth1DataReset 445.00 ns/op 821.00 ns/op 0.54
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3950 ms/op 2.6559 ms/op 0.53
mainnet_e81889 - altair processSlashingsReset 3.6120 us/op 6.2680 us/op 0.58
mainnet_e81889 - altair processRandaoMixesReset 11.052 us/op 6.6870 us/op 1.65
mainnet_e81889 - altair processHistoricalRootsUpdate 819.00 ns/op 1.2210 us/op 0.67
mainnet_e81889 - altair processParticipationFlagUpdates 1.7420 us/op 2.5660 us/op 0.68
mainnet_e81889 - altair processSyncCommitteeUpdates 676.00 ns/op 924.00 ns/op 0.73
mainnet_e81889 - altair afterProcessEpoch 123.81 ms/op 131.51 ms/op 0.94
capella processEpoch - mainnet_e217614 2.0071 s/op 1.9922 s/op 1.01
mainnet_e217614 - capella beforeProcessEpoch 465.17 ms/op 502.70 ms/op 0.93
mainnet_e217614 - capella processJustificationAndFinalization 18.501 us/op 22.394 us/op 0.83
mainnet_e217614 - capella processInactivityUpdates 22.322 ms/op 16.795 ms/op 1.33
mainnet_e217614 - capella processRewardsAndPenalties 494.98 ms/op 441.33 ms/op 1.12
mainnet_e217614 - capella processRegistryUpdates 19.246 us/op 29.127 us/op 0.66
mainnet_e217614 - capella processSlashings 577.00 ns/op 913.00 ns/op 0.63
mainnet_e217614 - capella processEth1DataReset 468.00 ns/op 817.00 ns/op 0.57
mainnet_e217614 - capella processEffectiveBalanceUpdates 4.3659 ms/op 4.5999 ms/op 0.95
mainnet_e217614 - capella processSlashingsReset 2.8730 us/op 4.2890 us/op 0.67
mainnet_e217614 - capella processRandaoMixesReset 4.7150 us/op 6.7730 us/op 0.70
mainnet_e217614 - capella processHistoricalRootsUpdate 609.00 ns/op 952.00 ns/op 0.64
mainnet_e217614 - capella processParticipationFlagUpdates 2.2450 us/op 2.2760 us/op 0.99
mainnet_e217614 - capella afterProcessEpoch 358.97 ms/op 305.16 ms/op 1.18
phase0 processEpoch - mainnet_e58758 511.24 ms/op 548.80 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 155.81 ms/op 168.26 ms/op 0.93
mainnet_e58758 - phase0 processJustificationAndFinalization 16.378 us/op 26.104 us/op 0.63
mainnet_e58758 - phase0 processRewardsAndPenalties 67.030 ms/op 66.517 ms/op 1.01
mainnet_e58758 - phase0 processRegistryUpdates 17.598 us/op 15.285 us/op 1.15
mainnet_e58758 - phase0 processSlashings 459.00 ns/op 711.00 ns/op 0.65
mainnet_e58758 - phase0 processEth1DataReset 525.00 ns/op 677.00 ns/op 0.78
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1243 ms/op 2.1472 ms/op 0.52
mainnet_e58758 - phase0 processSlashingsReset 3.3990 us/op 4.0560 us/op 0.84
mainnet_e58758 - phase0 processRandaoMixesReset 4.4970 us/op 6.0060 us/op 0.75
mainnet_e58758 - phase0 processHistoricalRootsUpdate 470.00 ns/op 711.00 ns/op 0.66
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.5620 us/op 5.7830 us/op 0.62
mainnet_e58758 - phase0 afterProcessEpoch 99.265 ms/op 100.79 ms/op 0.98
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.3157 ms/op 1.2779 ms/op 1.03
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.5349 ms/op 1.4694 ms/op 1.04
altair processInactivityUpdates - 250000 normalcase 32.025 ms/op 30.436 ms/op 1.05
altair processInactivityUpdates - 250000 worstcase 33.231 ms/op 37.574 ms/op 0.88
phase0 processRegistryUpdates - 250000 normalcase 11.885 us/op 12.465 us/op 0.95
phase0 processRegistryUpdates - 250000 badcase_full_deposits 441.64 us/op 683.16 us/op 0.65
phase0 processRegistryUpdates - 250000 worstcase 0.5 150.03 ms/op 136.26 ms/op 1.10
altair processRewardsAndPenalties - 250000 normalcase 78.745 ms/op 65.378 ms/op 1.20
altair processRewardsAndPenalties - 250000 worstcase 74.394 ms/op 69.084 ms/op 1.08
phase0 getAttestationDeltas - 250000 normalcase 9.7315 ms/op 8.8860 ms/op 1.10
phase0 getAttestationDeltas - 250000 worstcase 10.184 ms/op 9.1892 ms/op 1.11
phase0 processSlashings - 250000 worstcase 111.09 us/op 129.31 us/op 0.86
altair processSyncCommitteeUpdates - 250000 166.81 ms/op 154.66 ms/op 1.08
BeaconState.hashTreeRoot - No change 490.00 ns/op 378.00 ns/op 1.30
BeaconState.hashTreeRoot - 1 full validator 144.71 us/op 163.63 us/op 0.88
BeaconState.hashTreeRoot - 32 full validator 1.5736 ms/op 1.8040 ms/op 0.87
BeaconState.hashTreeRoot - 512 full validator 16.108 ms/op 18.738 ms/op 0.86
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 189.26 us/op 194.60 us/op 0.97
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.3288 ms/op 2.3396 ms/op 1.00
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 36.508 ms/op 40.615 ms/op 0.90
BeaconState.hashTreeRoot - 1 balances 171.67 us/op 156.41 us/op 1.10
BeaconState.hashTreeRoot - 32 balances 1.5281 ms/op 1.4324 ms/op 1.07
BeaconState.hashTreeRoot - 512 balances 13.542 ms/op 13.554 ms/op 1.00
BeaconState.hashTreeRoot - 250000 balances 213.30 ms/op 219.30 ms/op 0.97
aggregationBits - 2048 els - zipIndexesInBitList 39.819 us/op 27.247 us/op 1.46
byteArrayEquals 32 76.214 ns/op 77.600 ns/op 0.98
Buffer.compare 32 56.632 ns/op 57.958 ns/op 0.98
byteArrayEquals 1024 2.0788 us/op 2.1363 us/op 0.97
Buffer.compare 1024 72.978 ns/op 72.859 ns/op 1.00
byteArrayEquals 16384 32.947 us/op 34.080 us/op 0.97
Buffer.compare 16384 269.50 ns/op 254.88 ns/op 1.06
byteArrayEquals 123687377 289.36 ms/op 247.37 ms/op 1.17
Buffer.compare 123687377 9.6003 ms/op 6.3385 ms/op 1.51
byteArrayEquals 32 - diff last byte 111.57 ns/op 79.206 ns/op 1.41
Buffer.compare 32 - diff last byte 71.471 ns/op 56.620 ns/op 1.26
byteArrayEquals 1024 - diff last byte 3.2149 us/op 2.0584 us/op 1.56
Buffer.compare 1024 - diff last byte 90.042 ns/op 71.566 ns/op 1.26
byteArrayEquals 16384 - diff last byte 48.939 us/op 32.833 us/op 1.49
Buffer.compare 16384 - diff last byte 370.58 ns/op 257.70 ns/op 1.44
byteArrayEquals 123687377 - diff last byte 353.21 ms/op 247.91 ms/op 1.42
Buffer.compare 123687377 - diff last byte 9.6849 ms/op 6.1527 ms/op 1.57
byteArrayEquals 32 - random bytes 6.9270 ns/op 5.3300 ns/op 1.30
Buffer.compare 32 - random bytes 67.649 ns/op 61.117 ns/op 1.11
byteArrayEquals 1024 - random bytes 7.0180 ns/op 5.2700 ns/op 1.33
Buffer.compare 1024 - random bytes 65.569 ns/op 61.664 ns/op 1.06
byteArrayEquals 16384 - random bytes 6.7790 ns/op 5.2480 ns/op 1.29
Buffer.compare 16384 - random bytes 68.943 ns/op 60.744 ns/op 1.13
byteArrayEquals 123687377 - random bytes 10.290 ns/op 8.6300 ns/op 1.19
Buffer.compare 123687377 - random bytes 80.550 ns/op 64.360 ns/op 1.25
regular array get 100000 times 48.460 us/op 44.488 us/op 1.09
wrappedArray get 100000 times 51.254 us/op 43.431 us/op 1.18
arrayWithProxy get 100000 times 15.954 ms/op 14.080 ms/op 1.13
ssz.Root.equals 57.552 ns/op 54.447 ns/op 1.06
byteArrayEquals 56.795 ns/op 54.141 ns/op 1.05
Buffer.compare 12.606 ns/op 11.098 ns/op 1.14
shuffle list - 16384 els 9.0342 ms/op 8.7620 ms/op 1.03
shuffle list - 250000 els 133.20 ms/op 127.84 ms/op 1.04
processSlot - 1 slots 21.284 us/op 21.727 us/op 0.98
processSlot - 32 slots 3.5792 ms/op 3.9996 ms/op 0.89
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 59.990 ms/op 67.688 ms/op 0.89
getCommitteeAssignments - req 1 vs - 250000 vc 2.6703 ms/op 2.6798 ms/op 1.00
getCommitteeAssignments - req 100 vs - 250000 vc 3.8678 ms/op 3.8786 ms/op 1.00
getCommitteeAssignments - req 1000 vs - 250000 vc 4.2370 ms/op 4.1168 ms/op 1.03
findModifiedValidators - 10000 modified validators 522.79 ms/op 535.65 ms/op 0.98
findModifiedValidators - 1000 modified validators 428.84 ms/op 444.86 ms/op 0.96
findModifiedValidators - 100 modified validators 394.19 ms/op 438.48 ms/op 0.90
findModifiedValidators - 10 modified validators 427.49 ms/op 451.37 ms/op 0.95
findModifiedValidators - 1 modified validators 401.85 ms/op 406.77 ms/op 0.99
findModifiedValidators - no difference 404.11 ms/op 431.27 ms/op 0.94
compare ViewDUs 4.5573 s/op 5.2082 s/op 0.88
compare each validator Uint8Array 1.7612 s/op 2.1524 s/op 0.82
compare ViewDU to Uint8Array 1.1378 s/op 1.0896 s/op 1.04
migrate state 1000000 validators, 24 modified, 0 new 865.46 ms/op 914.81 ms/op 0.95
migrate state 1000000 validators, 1700 modified, 1000 new 1.0879 s/op 1.2288 s/op 0.89
migrate state 1000000 validators, 3400 modified, 2000 new 1.3517 s/op 1.4724 s/op 0.92
migrate state 1500000 validators, 24 modified, 0 new 826.87 ms/op 911.45 ms/op 0.91
migrate state 1500000 validators, 1700 modified, 1000 new 1.0481 s/op 1.2338 s/op 0.85
migrate state 1500000 validators, 3400 modified, 2000 new 1.3571 s/op 1.4821 s/op 0.92
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.1500 ns/op 4.3300 ns/op 0.96
state getBlockRootAtSlot - 250000 vs - 7PWei 896.82 ns/op 858.62 ns/op 1.04
computeProposers - vc 250000 8.9594 ms/op 9.3602 ms/op 0.96
computeEpochShuffling - vc 250000 120.85 ms/op 127.05 ms/op 0.95
getNextSyncCommittee - vc 250000 149.00 ms/op 163.01 ms/op 0.91
computeSigningRoot for AttestationData 27.062 us/op 30.513 us/op 0.89
hash AttestationData serialized data then Buffer.toString(base64) 2.2185 us/op 2.2948 us/op 0.97
toHexString serialized data 1.0171 us/op 1.0777 us/op 0.94
Buffer.toString(base64) 216.99 ns/op 211.43 ns/op 1.03

by benchmarkbot/action

@wemeetagain wemeetagain merged commit 534c4cc into unstable Mar 18, 2024
20 checks passed
@wemeetagain wemeetagain deleted the tuyen/ssz_v0.15.1 branch March 18, 2024 15:05
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.18.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.

Miss balances ssz cache in state transition
2 participants