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 getCheckpointStateOrBytes() api and clone states from cache #6504

Merged
merged 4 commits into from
Mar 5, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Mar 4, 2024

Motivation

  • When a checkpoint state becomes finalized, it could be stored in disk already so we should not deserialize/serialize it again to store to StateArchiveRepository
  • Right now we return cached state to consumers they can mutate them, need to protect cached state
  • Need to make sure we always have head state

Description

  • New getCheckpointStateOrBytes() api and use it in StatesArchiver
  • Before/after a state come to / get from state caches, we clone it. Note that in lodestar, the state clone is very cheap.
  • When regen head state, need to set allowDiskReload = true

part of #5968
cherry picked from #6359

Copy link
Contributor

github-actions bot commented Mar 4, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: aabcbe2 Previous: d10ed38 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 770.90 us/op 955.05 us/op 0.81
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 50.194 us/op 89.329 us/op 0.56
BLS verify - blst-native 1.1198 ms/op 1.3725 ms/op 0.82
BLS verifyMultipleSignatures 3 - blst-native 2.3897 ms/op 2.9165 ms/op 0.82
BLS verifyMultipleSignatures 8 - blst-native 5.2820 ms/op 6.3967 ms/op 0.83
BLS verifyMultipleSignatures 32 - blst-native 19.394 ms/op 22.889 ms/op 0.85
BLS verifyMultipleSignatures 64 - blst-native 38.195 ms/op 45.179 ms/op 0.85
BLS verifyMultipleSignatures 128 - blst-native 75.845 ms/op 89.060 ms/op 0.85
BLS deserializing 10000 signatures 826.95 ms/op 980.84 ms/op 0.84
BLS deserializing 100000 signatures 8.1413 s/op 9.3008 s/op 0.88
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1280 ms/op 1.3795 ms/op 0.82
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.3715 ms/op 1.6326 ms/op 0.84
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.5176 ms/op 2.4226 ms/op 1.04
BLS verifyMultipleSignatures - same message - 64 - blst-native 2.9534 ms/op 3.5513 ms/op 0.83
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.4909 ms/op 5.8294 ms/op 1.11
BLS aggregatePubkeys 32 - blst-native 22.882 us/op 27.097 us/op 0.84
BLS aggregatePubkeys 128 - blst-native 86.475 us/op 104.78 us/op 0.83
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 43.541 ms/op 61.232 ms/op 0.71
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 32.023 ms/op 64.065 ms/op 0.50
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 24.182 ms/op 40.622 ms/op 0.60
getSlashingsAndExits - default max 104.68 us/op 216.84 us/op 0.48
getSlashingsAndExits - 2k 337.32 us/op 409.76 us/op 0.82
proposeBlockBody type=full, size=empty 3.7051 ms/op 5.6267 ms/op 0.66
isKnown best case - 1 super set check 349.00 ns/op 317.00 ns/op 1.10
isKnown normal case - 2 super set checks 346.00 ns/op 319.00 ns/op 1.08
isKnown worse case - 16 super set checks 345.00 ns/op 302.00 ns/op 1.14
CheckpointStateCache - add get delete 4.3530 us/op 5.3650 us/op 0.81
validate api signedAggregateAndProof - struct 2.3558 ms/op 2.8651 ms/op 0.82
validate gossip signedAggregateAndProof - struct 2.3785 ms/op 2.8659 ms/op 0.83
validate gossip attestation - vc 640000 1.1450 ms/op 1.3977 ms/op 0.82
batch validate gossip attestation - vc 640000 - chunk 32 137.91 us/op 163.14 us/op 0.85
batch validate gossip attestation - vc 640000 - chunk 64 125.25 us/op 143.61 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 128 119.15 us/op 142.39 us/op 0.84
batch validate gossip attestation - vc 640000 - chunk 256 113.03 us/op 132.80 us/op 0.85
pickEth1Vote - no votes 914.39 us/op 1.1718 ms/op 0.78
pickEth1Vote - max votes 7.3732 ms/op 10.188 ms/op 0.72
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.098 ms/op 23.250 ms/op 0.56
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.382 ms/op 32.576 ms/op 0.75
pickEth1Vote - Eth1Data fastSerialize value x2048 448.01 us/op 618.20 us/op 0.72
pickEth1Vote - Eth1Data fastSerialize tree x2048 5.7181 ms/op 7.6585 ms/op 0.75
bytes32 toHexString 447.00 ns/op 500.00 ns/op 0.89
bytes32 Buffer.toString(hex) 323.00 ns/op 296.00 ns/op 1.09
bytes32 Buffer.toString(hex) from Uint8Array 432.00 ns/op 418.00 ns/op 1.03
bytes32 Buffer.toString(hex) + 0x 308.00 ns/op 292.00 ns/op 1.05
Object access 1 prop 0.19400 ns/op 0.15600 ns/op 1.24
Map access 1 prop 0.18900 ns/op 0.15200 ns/op 1.24
Object get x1000 4.9780 ns/op 7.2570 ns/op 0.69
Map get x1000 0.78700 ns/op 0.73900 ns/op 1.06
Object set x1000 27.422 ns/op 49.068 ns/op 0.56
Map set x1000 17.980 ns/op 39.631 ns/op 0.45
Return object 10000 times 0.23170 ns/op 0.23570 ns/op 0.98
Throw Error 10000 times 2.8693 us/op 3.8782 us/op 0.74
fastMsgIdFn sha256 / 200 bytes 2.0430 us/op 3.2830 us/op 0.62
fastMsgIdFn h32 xxhash / 200 bytes 336.00 ns/op 279.00 ns/op 1.20
fastMsgIdFn h64 xxhash / 200 bytes 399.00 ns/op 341.00 ns/op 1.17
fastMsgIdFn sha256 / 1000 bytes 6.2560 us/op 11.420 us/op 0.55
fastMsgIdFn h32 xxhash / 1000 bytes 475.00 ns/op 404.00 ns/op 1.18
fastMsgIdFn h64 xxhash / 1000 bytes 454.00 ns/op 414.00 ns/op 1.10
fastMsgIdFn sha256 / 10000 bytes 52.486 us/op 103.64 us/op 0.51
fastMsgIdFn h32 xxhash / 10000 bytes 1.8850 us/op 1.8700 us/op 1.01
fastMsgIdFn h64 xxhash / 10000 bytes 1.2840 us/op 1.2860 us/op 1.00
send data - 1000 256B messages 13.132 ms/op 16.932 ms/op 0.78
send data - 1000 512B messages 16.071 ms/op 26.614 ms/op 0.60
send data - 1000 1024B messages 23.955 ms/op 38.623 ms/op 0.62
send data - 1000 1200B messages 29.892 ms/op 40.084 ms/op 0.75
send data - 1000 2048B messages 37.633 ms/op 49.870 ms/op 0.75
send data - 1000 4096B messages 26.099 ms/op 45.420 ms/op 0.57
send data - 1000 16384B messages 90.343 ms/op 122.49 ms/op 0.74
send data - 1000 65536B messages 379.38 ms/op 470.65 ms/op 0.81
enrSubnets - fastDeserialize 64 bits 965.00 ns/op 1.4460 us/op 0.67
enrSubnets - ssz BitVector 64 bits 435.00 ns/op 432.00 ns/op 1.01
enrSubnets - fastDeserialize 4 bits 243.00 ns/op 172.00 ns/op 1.41
enrSubnets - ssz BitVector 4 bits 465.00 ns/op 434.00 ns/op 1.07
prioritizePeers score -10:0 att 32-0.1 sync 2-0 70.775 us/op 109.67 us/op 0.65
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 80.790 us/op 128.83 us/op 0.63
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 110.30 us/op 172.43 us/op 0.64
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 184.75 us/op 307.95 us/op 0.60
prioritizePeers score 0:0 att 64-1 sync 4-1 206.00 us/op 381.69 us/op 0.54
array of 16000 items push then shift 1.3042 us/op 1.7223 us/op 0.76
LinkedList of 16000 items push then shift 5.9160 ns/op 9.5480 ns/op 0.62
array of 16000 items push then pop 68.362 ns/op 98.414 ns/op 0.69
LinkedList of 16000 items push then pop 5.6970 ns/op 8.9220 ns/op 0.64
array of 24000 items push then shift 1.8910 us/op 2.4635 us/op 0.77
LinkedList of 24000 items push then shift 5.9200 ns/op 9.3100 ns/op 0.64
array of 24000 items push then pop 66.576 ns/op 122.25 ns/op 0.54
LinkedList of 24000 items push then pop 5.7020 ns/op 8.9300 ns/op 0.64
intersect bitArray bitLen 8 4.7990 ns/op 5.9230 ns/op 0.81
intersect array and set length 8 49.489 ns/op 64.033 ns/op 0.77
intersect bitArray bitLen 128 29.107 ns/op 37.410 ns/op 0.78
intersect array and set length 128 693.39 ns/op 959.05 ns/op 0.72
bitArray.getTrueBitIndexes() bitLen 128 1.5010 us/op 1.6580 us/op 0.91
bitArray.getTrueBitIndexes() bitLen 248 2.3910 us/op 3.0570 us/op 0.78
bitArray.getTrueBitIndexes() bitLen 512 4.3390 us/op 5.3910 us/op 0.80
Buffer.concat 32 items 916.00 ns/op 1.2010 us/op 0.76
Uint8Array.set 32 items 2.1540 us/op 1.7790 us/op 1.21
Set add up to 64 items then delete first 1.8060 us/op 4.5065 us/op 0.40
OrderedSet add up to 64 items then delete first 2.7317 us/op 5.8476 us/op 0.47
Set add up to 64 items then delete last 2.1027 us/op 5.0491 us/op 0.42
OrderedSet add up to 64 items then delete last 3.1774 us/op 6.0204 us/op 0.53
Set add up to 64 items then delete middle 2.2003 us/op 5.2447 us/op 0.42
OrderedSet add up to 64 items then delete middle 4.9375 us/op 8.2065 us/op 0.60
Set add up to 128 items then delete first 4.0436 us/op 10.187 us/op 0.40
OrderedSet add up to 128 items then delete first 6.2965 us/op 14.473 us/op 0.44
Set add up to 128 items then delete last 3.7954 us/op 9.5595 us/op 0.40
OrderedSet add up to 128 items then delete last 5.7907 us/op 11.900 us/op 0.49
Set add up to 128 items then delete middle 3.8372 us/op 9.2325 us/op 0.42
OrderedSet add up to 128 items then delete middle 10.811 us/op 17.417 us/op 0.62
Set add up to 256 items then delete first 7.7399 us/op 18.890 us/op 0.41
OrderedSet add up to 256 items then delete first 12.637 us/op 27.016 us/op 0.47
Set add up to 256 items then delete last 7.5548 us/op 19.823 us/op 0.38
OrderedSet add up to 256 items then delete last 11.636 us/op 24.719 us/op 0.47
Set add up to 256 items then delete middle 7.4934 us/op 19.783 us/op 0.38
OrderedSet add up to 256 items then delete middle 32.597 us/op 49.187 us/op 0.66
transfer serialized Status (84 B) 1.5000 us/op 1.7540 us/op 0.86
copy serialized Status (84 B) 1.1380 us/op 1.5530 us/op 0.73
transfer serialized SignedVoluntaryExit (112 B) 1.5020 us/op 2.1770 us/op 0.69
copy serialized SignedVoluntaryExit (112 B) 1.1960 us/op 1.5830 us/op 0.76
transfer serialized ProposerSlashing (416 B) 1.8340 us/op 2.5000 us/op 0.73
copy serialized ProposerSlashing (416 B) 1.6040 us/op 2.1560 us/op 0.74
transfer serialized Attestation (485 B) 1.8150 us/op 2.5600 us/op 0.71
copy serialized Attestation (485 B) 1.8880 us/op 2.1910 us/op 0.86
transfer serialized AttesterSlashing (33232 B) 2.0390 us/op 2.4920 us/op 0.82
copy serialized AttesterSlashing (33232 B) 6.0870 us/op 6.7710 us/op 0.90
transfer serialized Small SignedBeaconBlock (128000 B) 2.6180 us/op 3.3590 us/op 0.78
copy serialized Small SignedBeaconBlock (128000 B) 9.8300 us/op 18.035 us/op 0.55
transfer serialized Avg SignedBeaconBlock (200000 B) 2.4110 us/op 3.8970 us/op 0.62
copy serialized Avg SignedBeaconBlock (200000 B) 13.326 us/op 28.645 us/op 0.47
transfer serialized BlobsSidecar (524380 B) 2.3640 us/op 4.3000 us/op 0.55
copy serialized BlobsSidecar (524380 B) 82.964 us/op 121.67 us/op 0.68
transfer serialized Big SignedBeaconBlock (1000000 B) 2.7650 us/op 4.0710 us/op 0.68
copy serialized Big SignedBeaconBlock (1000000 B) 194.88 us/op 168.94 us/op 1.15
pass gossip attestations to forkchoice per slot 2.8756 ms/op 4.9279 ms/op 0.58
forkChoice updateHead vc 100000 bc 64 eq 0 479.61 us/op 778.09 us/op 0.62
forkChoice updateHead vc 600000 bc 64 eq 0 2.6007 ms/op 5.6894 ms/op 0.46
forkChoice updateHead vc 1000000 bc 64 eq 0 4.5851 ms/op 8.0129 ms/op 0.57
forkChoice updateHead vc 600000 bc 320 eq 0 2.6787 ms/op 4.7852 ms/op 0.56
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7397 ms/op 4.8982 ms/op 0.56
forkChoice updateHead vc 600000 bc 7200 eq 0 4.3229 ms/op 5.9742 ms/op 0.72
forkChoice updateHead vc 600000 bc 64 eq 1000 9.8459 ms/op 12.614 ms/op 0.78
forkChoice updateHead vc 600000 bc 64 eq 10000 9.8723 ms/op 13.483 ms/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 300000 12.810 ms/op 17.561 ms/op 0.73
computeDeltas 500000 validators 300 proto nodes 3.0831 ms/op 7.7936 ms/op 0.40
computeDeltas 500000 validators 1200 proto nodes 3.0300 ms/op 7.9370 ms/op 0.38
computeDeltas 500000 validators 7200 proto nodes 3.0195 ms/op 7.8008 ms/op 0.39
computeDeltas 750000 validators 300 proto nodes 4.5051 ms/op 11.481 ms/op 0.39
computeDeltas 750000 validators 1200 proto nodes 4.5536 ms/op 10.556 ms/op 0.43
computeDeltas 750000 validators 7200 proto nodes 4.4431 ms/op 10.358 ms/op 0.43
computeDeltas 1400000 validators 300 proto nodes 9.0389 ms/op 19.811 ms/op 0.46
computeDeltas 1400000 validators 1200 proto nodes 8.7986 ms/op 20.115 ms/op 0.44
computeDeltas 1400000 validators 7200 proto nodes 8.8202 ms/op 19.999 ms/op 0.44
computeDeltas 2100000 validators 300 proto nodes 13.544 ms/op 30.945 ms/op 0.44
computeDeltas 2100000 validators 1200 proto nodes 13.075 ms/op 31.556 ms/op 0.41
computeDeltas 2100000 validators 7200 proto nodes 12.789 ms/op 31.622 ms/op 0.40
altair processAttestation - 250000 vs - 7PWei normalcase 1.5494 ms/op 2.4314 ms/op 0.64
altair processAttestation - 250000 vs - 7PWei worstcase 2.1586 ms/op 3.5619 ms/op 0.61
altair processAttestation - setStatus - 1/6 committees join 70.103 us/op 203.44 us/op 0.34
altair processAttestation - setStatus - 1/3 committees join 150.65 us/op 408.49 us/op 0.37
altair processAttestation - setStatus - 1/2 committees join 202.45 us/op 551.42 us/op 0.37
altair processAttestation - setStatus - 2/3 committees join 280.99 us/op 637.44 us/op 0.44
altair processAttestation - setStatus - 4/5 committees join 373.04 us/op 901.62 us/op 0.41
altair processAttestation - setStatus - 100% committees join 461.96 us/op 1.0212 ms/op 0.45
altair processBlock - 250000 vs - 7PWei normalcase 6.7878 ms/op 10.847 ms/op 0.63
altair processBlock - 250000 vs - 7PWei normalcase hashState 24.436 ms/op 48.192 ms/op 0.51
altair processBlock - 250000 vs - 7PWei worstcase 30.911 ms/op 46.404 ms/op 0.67
altair processBlock - 250000 vs - 7PWei worstcase hashState 96.888 ms/op 126.39 ms/op 0.77
phase0 processBlock - 250000 vs - 7PWei normalcase 2.6809 ms/op 3.3761 ms/op 0.79
phase0 processBlock - 250000 vs - 7PWei worstcase 28.873 ms/op 38.378 ms/op 0.75
altair processEth1Data - 250000 vs - 7PWei normalcase 399.31 us/op 845.40 us/op 0.47
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.7690 us/op 8.3990 us/op 1.16
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 53.899 us/op 78.395 us/op 0.69
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 17.997 us/op 23.995 us/op 0.75
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 17.432 us/op 10.809 us/op 1.61
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 173.61 us/op 247.40 us/op 0.70
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 948.87 us/op 2.1245 ms/op 0.45
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.4593 ms/op 2.3246 ms/op 0.63
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 860.78 us/op 2.1088 ms/op 0.41
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.6715 ms/op 5.6356 ms/op 0.47
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.4621 ms/op 3.4561 ms/op 0.42
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.4803 ms/op 8.4979 ms/op 0.41
Tree 40 250000 create 269.99 ms/op 630.11 ms/op 0.43
Tree 40 250000 get(125000) 123.39 ns/op 266.73 ns/op 0.46
Tree 40 250000 set(125000) 907.80 ns/op 2.5586 us/op 0.35
Tree 40 250000 toArray() 21.560 ms/op 29.473 ms/op 0.73
Tree 40 250000 iterate all - toArray() + loop 22.213 ms/op 30.341 ms/op 0.73
Tree 40 250000 iterate all - get(i) 54.902 ms/op 102.29 ms/op 0.54
MutableVector 250000 create 14.257 ms/op 22.760 ms/op 0.63
MutableVector 250000 get(125000) 5.8970 ns/op 9.8150 ns/op 0.60
MutableVector 250000 set(125000) 225.13 ns/op 708.12 ns/op 0.32
MutableVector 250000 toArray() 2.2622 ms/op 5.2758 ms/op 0.43
MutableVector 250000 iterate all - toArray() + loop 3.2876 ms/op 6.2215 ms/op 0.53
MutableVector 250000 iterate all - get(i) 1.3661 ms/op 2.3532 ms/op 0.58
Array 250000 create 3.4337 ms/op 4.9106 ms/op 0.70
Array 250000 clone - spread 1.1733 ms/op 2.4369 ms/op 0.48
Array 250000 get(125000) 1.0880 ns/op 1.9460 ns/op 0.56
Array 250000 set(125000) 1.2850 ns/op 8.3550 ns/op 0.15
Array 250000 iterate all - loop 154.53 us/op 234.01 us/op 0.66
effectiveBalanceIncrements clone Uint8Array 300000 34.216 us/op 80.901 us/op 0.42
effectiveBalanceIncrements clone MutableVector 300000 439.00 ns/op 848.00 ns/op 0.52
effectiveBalanceIncrements rw all Uint8Array 300000 177.41 us/op 338.36 us/op 0.52
effectiveBalanceIncrements rw all MutableVector 300000 65.535 ms/op 233.88 ms/op 0.28
phase0 afterProcessEpoch - 250000 vs - 7PWei 72.428 ms/op 215.41 ms/op 0.34
phase0 beforeProcessEpoch - 250000 vs - 7PWei 44.301 ms/op 82.240 ms/op 0.54
altair processEpoch - mainnet_e81889 427.09 ms/op 924.12 ms/op 0.46
mainnet_e81889 - altair beforeProcessEpoch 69.117 ms/op 165.12 ms/op 0.42
mainnet_e81889 - altair processJustificationAndFinalization 8.5690 us/op 28.224 us/op 0.30
mainnet_e81889 - altair processInactivityUpdates 3.7921 ms/op 13.614 ms/op 0.28
mainnet_e81889 - altair processRewardsAndPenalties 65.492 ms/op 69.543 ms/op 0.94
mainnet_e81889 - altair processRegistryUpdates 2.0450 us/op 4.7940 us/op 0.43
mainnet_e81889 - altair processSlashings 554.00 ns/op 920.00 ns/op 0.60
mainnet_e81889 - altair processEth1DataReset 647.00 ns/op 991.00 ns/op 0.65
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.7560 ms/op 2.3769 ms/op 0.74
mainnet_e81889 - altair processSlashingsReset 2.3200 us/op 5.6910 us/op 0.41
mainnet_e81889 - altair processRandaoMixesReset 2.7500 us/op 7.6640 us/op 0.36
mainnet_e81889 - altair processHistoricalRootsUpdate 727.00 ns/op 1.2810 us/op 0.57
mainnet_e81889 - altair processParticipationFlagUpdates 1.5630 us/op 2.7030 us/op 0.58
mainnet_e81889 - altair processSyncCommitteeUpdates 352.00 ns/op 1.0790 us/op 0.33
mainnet_e81889 - altair afterProcessEpoch 78.354 ms/op 220.94 ms/op 0.35
capella processEpoch - mainnet_e217614 1.7487 s/op 2.4567 s/op 0.71
mainnet_e217614 - capella beforeProcessEpoch 421.87 ms/op 557.46 ms/op 0.76
mainnet_e217614 - capella processJustificationAndFinalization 6.9190 us/op 31.554 us/op 0.22
mainnet_e217614 - capella processInactivityUpdates 13.630 ms/op 19.640 ms/op 0.69
mainnet_e217614 - capella processRewardsAndPenalties 343.79 ms/op 433.41 ms/op 0.79
mainnet_e217614 - capella processRegistryUpdates 13.475 us/op 32.481 us/op 0.41
mainnet_e217614 - capella processSlashings 601.00 ns/op 1.1410 us/op 0.53
mainnet_e217614 - capella processEth1DataReset 649.00 ns/op 1.0320 us/op 0.63
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.5527 ms/op 8.0198 ms/op 0.44
mainnet_e217614 - capella processSlashingsReset 2.5990 us/op 5.0080 us/op 0.52
mainnet_e217614 - capella processRandaoMixesReset 3.4930 us/op 7.5880 us/op 0.46
mainnet_e217614 - capella processHistoricalRootsUpdate 753.00 ns/op 978.00 ns/op 0.77
mainnet_e217614 - capella processParticipationFlagUpdates 1.1050 us/op 2.2100 us/op 0.50
mainnet_e217614 - capella afterProcessEpoch 220.15 ms/op 346.71 ms/op 0.63
phase0 processEpoch - mainnet_e58758 381.54 ms/op 491.81 ms/op 0.78
mainnet_e58758 - phase0 beforeProcessEpoch 122.82 ms/op 166.05 ms/op 0.74
mainnet_e58758 - phase0 processJustificationAndFinalization 15.891 us/op 23.234 us/op 0.68
mainnet_e58758 - phase0 processRewardsAndPenalties 43.769 ms/op 67.831 ms/op 0.65
mainnet_e58758 - phase0 processRegistryUpdates 9.6260 us/op 16.951 us/op 0.57
mainnet_e58758 - phase0 processSlashings 614.00 ns/op 912.00 ns/op 0.67
mainnet_e58758 - phase0 processEth1DataReset 632.00 ns/op 636.00 ns/op 0.99
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4363 ms/op 2.1737 ms/op 0.66
mainnet_e58758 - phase0 processSlashingsReset 2.2300 us/op 4.8020 us/op 0.46
mainnet_e58758 - phase0 processRandaoMixesReset 5.1770 us/op 6.3790 us/op 0.81
mainnet_e58758 - phase0 processHistoricalRootsUpdate 651.00 ns/op 652.00 ns/op 1.00
mainnet_e58758 - phase0 processParticipationRecordUpdates 2.9690 us/op 6.0360 us/op 0.49
mainnet_e58758 - phase0 afterProcessEpoch 62.236 ms/op 98.082 ms/op 0.63
phase0 processEffectiveBalanceUpdates - 250000 normalcase 991.21 us/op 2.6052 ms/op 0.38
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1163 ms/op 1.4684 ms/op 0.76
altair processInactivityUpdates - 250000 normalcase 22.995 ms/op 35.368 ms/op 0.65
altair processInactivityUpdates - 250000 worstcase 25.850 ms/op 39.041 ms/op 0.66
phase0 processRegistryUpdates - 250000 normalcase 9.0430 us/op 13.204 us/op 0.68
phase0 processRegistryUpdates - 250000 badcase_full_deposits 448.75 us/op 746.28 us/op 0.60
phase0 processRegistryUpdates - 250000 worstcase 0.5 124.82 ms/op 157.20 ms/op 0.79
altair processRewardsAndPenalties - 250000 normalcase 53.612 ms/op 72.057 ms/op 0.74
altair processRewardsAndPenalties - 250000 worstcase 55.129 ms/op 64.390 ms/op 0.86
phase0 getAttestationDeltas - 250000 normalcase 6.8954 ms/op 9.1979 ms/op 0.75
phase0 getAttestationDeltas - 250000 worstcase 5.8955 ms/op 12.539 ms/op 0.47
phase0 processSlashings - 250000 worstcase 90.455 us/op 132.44 us/op 0.68
altair processSyncCommitteeUpdates - 250000 123.88 ms/op 162.99 ms/op 0.76
BeaconState.hashTreeRoot - No change 605.00 ns/op 392.00 ns/op 1.54
BeaconState.hashTreeRoot - 1 full validator 121.69 us/op 160.35 us/op 0.76
BeaconState.hashTreeRoot - 32 full validator 1.2389 ms/op 1.6325 ms/op 0.76
BeaconState.hashTreeRoot - 512 full validator 15.318 ms/op 19.104 ms/op 0.80
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 157.98 us/op 220.83 us/op 0.72
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1310 ms/op 2.8710 ms/op 0.74
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.167 ms/op 37.223 ms/op 0.86
BeaconState.hashTreeRoot - 1 balances 118.93 us/op 161.86 us/op 0.73
BeaconState.hashTreeRoot - 32 balances 1.0568 ms/op 1.3922 ms/op 0.76
BeaconState.hashTreeRoot - 512 balances 7.7752 ms/op 14.015 ms/op 0.55
BeaconState.hashTreeRoot - 250000 balances 159.54 ms/op 236.02 ms/op 0.68
aggregationBits - 2048 els - zipIndexesInBitList 10.320 us/op 17.217 us/op 0.60
byteArrayEquals 32 64.967 ns/op 77.232 ns/op 0.84
Buffer.compare 32 38.311 ns/op 57.772 ns/op 0.66
byteArrayEquals 1024 1.7492 us/op 2.1068 us/op 0.83
Buffer.compare 1024 46.673 ns/op 74.152 ns/op 0.63
byteArrayEquals 16384 28.781 us/op 33.566 us/op 0.86
Buffer.compare 16384 228.66 ns/op 274.36 ns/op 0.83
byteArrayEquals 123687377 205.39 ms/op 253.74 ms/op 0.81
Buffer.compare 123687377 5.0525 ms/op 6.1743 ms/op 0.82
byteArrayEquals 32 - diff last byte 59.190 ns/op 74.452 ns/op 0.80
Buffer.compare 32 - diff last byte 37.188 ns/op 58.105 ns/op 0.64
byteArrayEquals 1024 - diff last byte 1.6307 us/op 2.1046 us/op 0.77
Buffer.compare 1024 - diff last byte 42.120 ns/op 73.946 ns/op 0.57
byteArrayEquals 16384 - diff last byte 26.069 us/op 33.582 us/op 0.78
Buffer.compare 16384 - diff last byte 198.07 ns/op 291.14 ns/op 0.68
byteArrayEquals 123687377 - diff last byte 210.18 ms/op 252.20 ms/op 0.83
Buffer.compare 123687377 - diff last byte 5.8583 ms/op 6.2903 ms/op 0.93
byteArrayEquals 32 - random bytes 5.0400 ns/op 5.5490 ns/op 0.91
Buffer.compare 32 - random bytes 39.761 ns/op 63.124 ns/op 0.63
byteArrayEquals 1024 - random bytes 4.9660 ns/op 5.3200 ns/op 0.93
Buffer.compare 1024 - random bytes 36.818 ns/op 62.445 ns/op 0.59
byteArrayEquals 16384 - random bytes 4.6660 ns/op 5.3090 ns/op 0.88
Buffer.compare 16384 - random bytes 36.419 ns/op 62.180 ns/op 0.59
byteArrayEquals 123687377 - random bytes 7.9500 ns/op 8.6200 ns/op 0.92
Buffer.compare 123687377 - random bytes 38.720 ns/op 65.860 ns/op 0.59
regular array get 100000 times 40.320 us/op 45.218 us/op 0.89
wrappedArray get 100000 times 41.056 us/op 45.106 us/op 0.91
arrayWithProxy get 100000 times 9.9095 ms/op 14.834 ms/op 0.67
ssz.Root.equals 53.631 ns/op 55.703 ns/op 0.96
byteArrayEquals 52.557 ns/op 54.463 ns/op 0.97
Buffer.compare 8.8610 ns/op 11.232 ns/op 0.79
shuffle list - 16384 els 4.4232 ms/op 7.1594 ms/op 0.62
shuffle list - 250000 els 65.624 ms/op 105.12 ms/op 0.62
processSlot - 1 slots 18.975 us/op 20.793 us/op 0.91
processSlot - 32 slots 3.1849 ms/op 4.0494 ms/op 0.79
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 48.856 ms/op 63.966 ms/op 0.76
getCommitteeAssignments - req 1 vs - 250000 vc 2.2033 ms/op 2.5891 ms/op 0.85
getCommitteeAssignments - req 100 vs - 250000 vc 3.3402 ms/op 3.7976 ms/op 0.88
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6493 ms/op 4.1641 ms/op 0.88
findModifiedValidators - 10000 modified validators 414.39 ms/op 554.51 ms/op 0.75
findModifiedValidators - 1000 modified validators 308.68 ms/op 443.92 ms/op 0.70
findModifiedValidators - 100 modified validators 336.04 ms/op 428.09 ms/op 0.78
findModifiedValidators - 10 modified validators 296.37 ms/op 459.16 ms/op 0.65
findModifiedValidators - 1 modified validators 299.78 ms/op 442.61 ms/op 0.68
findModifiedValidators - no difference 322.20 ms/op 453.56 ms/op 0.71
compare ViewDUs 3.8930 s/op 4.9754 s/op 0.78
compare each validator Uint8Array 1.1147 s/op 1.8697 s/op 0.60
compare ViewDU to Uint8Array 1.0676 s/op 1.3963 s/op 0.76
migrate state 1000000 validators, 24 modified, 0 new 751.63 ms/op 905.84 ms/op 0.83
migrate state 1000000 validators, 1700 modified, 1000 new 999.66 ms/op 1.2511 s/op 0.80
migrate state 1000000 validators, 3400 modified, 2000 new 1.0191 s/op 1.4840 s/op 0.69
migrate state 1500000 validators, 24 modified, 0 new 711.78 ms/op 929.77 ms/op 0.77
migrate state 1500000 validators, 1700 modified, 1000 new 894.21 ms/op 1.2525 s/op 0.71
migrate state 1500000 validators, 3400 modified, 2000 new 1.1918 s/op 1.4817 s/op 0.80
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.6700 ns/op 4.4900 ns/op 1.04
state getBlockRootAtSlot - 250000 vs - 7PWei 1.0229 us/op 538.29 ns/op 1.90
computeProposers - vc 250000 7.2058 ms/op 9.5945 ms/op 0.75
computeEpochShuffling - vc 250000 69.328 ms/op 113.82 ms/op 0.61
getNextSyncCommittee - vc 250000 120.91 ms/op 162.96 ms/op 0.74
computeSigningRoot for AttestationData 27.369 us/op 31.288 us/op 0.87
hash AttestationData serialized data then Buffer.toString(base64) 1.2411 us/op 2.4432 us/op 0.51
toHexString serialized data 768.21 ns/op 1.1219 us/op 0.68
Buffer.toString(base64) 149.60 ns/op 230.20 ns/op 0.65

by benchmarkbot/action

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Merging #6504 (ef5022c) into unstable (d10ed38) will decrease coverage by 0.01%.
The diff coverage is 26.31%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6504      +/-   ##
============================================
- Coverage     61.69%   61.68%   -0.01%     
============================================
  Files           555      555              
  Lines         58255    58268      +13     
  Branches       1844     1844              
============================================
+ Hits          35939    35943       +4     
- Misses        22277    22286       +9     
  Partials         39       39              

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

@g11tech g11tech left a comment

Choose a reason for hiding this comment

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

lgtm

@twoeths twoeths merged commit 918924e into unstable Mar 5, 2024
21 checks passed
@twoeths twoeths deleted the tuyen/clone_states_from_cache branch March 5, 2024 14:54
@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.

3 participants