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: regen to use different state caches based on nHistoricalStates flag #6359

Closed
wants to merge 12 commits into from

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jan 27, 2024

Motivation

  • Experiment n-historical states by adding nHistoricalStates flag, by default leave it false

Description

  • Consume state caches based on the new chain.nHistoricalStates flag
    • We can configure chain.maxBlockStates (default to 32) for the new block state and chain.maxCPStateEpochsInMemory (default to 2) for the persistent cp state
  • By default, do not turn on this flag. Need a lot of time to test this feature on mainnet
  • Regen: add "shouldReload" option to allow to reload state from data store, which is only true for block processing
  • Finalized state may not be available as a state anymore, we only have finalized state bytes instead
  • Add e2e for different reorg scenarios where checkpoint states are reloaded
  • Clone state when getting it from cache

Tradeoff of this approach:

  • at the last 1/3 slot of slot 0 of every epoch, we have to persist state to DB/data store
  • on holesky it takes <=1.2s to do that

part of #5968

Copy link
Contributor

github-actions bot commented Jan 27, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: f8aed32 Previous: ed43a98 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 968.08 us/op 578.74 us/op 1.67
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 63.232 us/op 123.11 us/op 0.51
BLS verify - blst-native 1.1059 ms/op 1.3391 ms/op 0.83
BLS verifyMultipleSignatures 3 - blst-native 2.3682 ms/op 2.7858 ms/op 0.85
BLS verifyMultipleSignatures 8 - blst-native 5.2224 ms/op 6.1180 ms/op 0.85
BLS verifyMultipleSignatures 32 - blst-native 19.240 ms/op 22.196 ms/op 0.87
BLS verifyMultipleSignatures 64 - blst-native 37.827 ms/op 43.883 ms/op 0.86
BLS verifyMultipleSignatures 128 - blst-native 74.981 ms/op 87.836 ms/op 0.85
BLS deserializing 10000 signatures 805.41 ms/op 951.16 ms/op 0.85
BLS deserializing 100000 signatures 8.0046 s/op 9.2077 s/op 0.87
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1379 ms/op 1.3800 ms/op 0.82
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.3557 ms/op 1.5968 ms/op 0.85
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.3022 ms/op 2.3782 ms/op 0.97
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.8385 ms/op 3.5077 ms/op 1.09
BLS verifyMultipleSignatures - same message - 128 - blst-native 6.8455 ms/op 5.7801 ms/op 1.18
BLS aggregatePubkeys 32 - blst-native 22.154 us/op 26.442 us/op 0.84
BLS aggregatePubkeys 128 - blst-native 84.540 us/op 102.77 us/op 0.82
getAttestationsForBlock 46.305 ms/op 57.168 ms/op 0.81
getSlashingsAndExits - default max 107.00 us/op 150.22 us/op 0.71
getSlashingsAndExits - 2k 307.75 us/op 537.38 us/op 0.57
proposeBlockBody type=full, size=empty 4.3960 ms/op 5.3949 ms/op 0.81
isKnown best case - 1 super set check 342.00 ns/op 324.00 ns/op 1.06
isKnown normal case - 2 super set checks 340.00 ns/op 324.00 ns/op 1.05
isKnown worse case - 16 super set checks 340.00 ns/op 339.00 ns/op 1.00
CheckpointStateCache - add get delete 3.8990 us/op 6.0090 us/op 0.65
validate api signedAggregateAndProof - struct 2.4377 ms/op 2.8199 ms/op 0.86
validate gossip signedAggregateAndProof - struct 2.5022 ms/op 2.8096 ms/op 0.89
validate gossip attestation - vc 640000 1.1186 ms/op 1.3771 ms/op 0.81
batch validate gossip attestation - vc 640000 - chunk 32 133.24 us/op 167.40 us/op 0.80
batch validate gossip attestation - vc 640000 - chunk 64 118.37 us/op 146.44 us/op 0.81
batch validate gossip attestation - vc 640000 - chunk 128 116.41 us/op 133.74 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 256 110.51 us/op 130.03 us/op 0.85
pickEth1Vote - no votes 849.36 us/op 1.2819 ms/op 0.66
pickEth1Vote - max votes 9.8406 ms/op 7.8639 ms/op 1.25
pickEth1Vote - Eth1Data hashTreeRoot value x2048 19.547 ms/op 17.378 ms/op 1.12
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.540 ms/op 33.090 ms/op 0.68
pickEth1Vote - Eth1Data fastSerialize value x2048 404.02 us/op 614.39 us/op 0.66
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.5078 ms/op 4.5916 ms/op 0.98
bytes32 toHexString 429.00 ns/op 537.00 ns/op 0.80
bytes32 Buffer.toString(hex) 292.00 ns/op 298.00 ns/op 0.98
bytes32 Buffer.toString(hex) from Uint8Array 410.00 ns/op 444.00 ns/op 0.92
bytes32 Buffer.toString(hex) + 0x 295.00 ns/op 296.00 ns/op 1.00
Object access 1 prop 0.19200 ns/op 0.15900 ns/op 1.21
Map access 1 prop 0.19800 ns/op 0.15500 ns/op 1.28
Object get x1000 5.4170 ns/op 7.7870 ns/op 0.70
Map get x1000 0.72800 ns/op 0.87200 ns/op 0.83
Object set x1000 24.558 ns/op 59.082 ns/op 0.42
Map set x1000 17.111 ns/op 45.448 ns/op 0.38
Return object 10000 times 0.22800 ns/op 0.24760 ns/op 0.92
Throw Error 10000 times 2.7459 us/op 3.8709 us/op 0.71
fastMsgIdFn sha256 / 200 bytes 1.9540 us/op 3.3990 us/op 0.57
fastMsgIdFn h32 xxhash / 200 bytes 287.00 ns/op 293.00 ns/op 0.98
fastMsgIdFn h64 xxhash / 200 bytes 342.00 ns/op 346.00 ns/op 0.99
fastMsgIdFn sha256 / 1000 bytes 6.1980 us/op 11.627 us/op 0.53
fastMsgIdFn h32 xxhash / 1000 bytes 403.00 ns/op 447.00 ns/op 0.90
fastMsgIdFn h64 xxhash / 1000 bytes 415.00 ns/op 444.00 ns/op 0.93
fastMsgIdFn sha256 / 10000 bytes 53.365 us/op 103.00 us/op 0.52
fastMsgIdFn h32 xxhash / 10000 bytes 1.7820 us/op 2.0000 us/op 0.89
fastMsgIdFn h64 xxhash / 10000 bytes 1.2270 us/op 1.3540 us/op 0.91
send data - 1000 256B messages 11.541 ms/op 19.166 ms/op 0.60
send data - 1000 512B messages 13.754 ms/op 27.931 ms/op 0.49
send data - 1000 1024B messages 22.758 ms/op 40.623 ms/op 0.56
send data - 1000 1200B messages 29.482 ms/op 38.023 ms/op 0.78
send data - 1000 2048B messages 39.448 ms/op 47.976 ms/op 0.82
send data - 1000 4096B messages 34.382 ms/op 43.221 ms/op 0.80
send data - 1000 16384B messages 88.285 ms/op 121.25 ms/op 0.73
send data - 1000 65536B messages 451.38 ms/op 450.15 ms/op 1.00
enrSubnets - fastDeserialize 64 bits 1.0270 us/op 1.3180 us/op 0.78
enrSubnets - ssz BitVector 64 bits 422.00 ns/op 435.00 ns/op 0.97
enrSubnets - fastDeserialize 4 bits 196.00 ns/op 170.00 ns/op 1.15
enrSubnets - ssz BitVector 4 bits 420.00 ns/op 476.00 ns/op 0.88
prioritizePeers score -10:0 att 32-0.1 sync 2-0 67.737 us/op 106.48 us/op 0.64
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 81.658 us/op 134.85 us/op 0.61
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 103.49 us/op 190.10 us/op 0.54
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 182.30 us/op 325.39 us/op 0.56
prioritizePeers score 0:0 att 64-1 sync 4-1 204.58 us/op 366.94 us/op 0.56
array of 16000 items push then shift 1.2977 us/op 1.6773 us/op 0.77
LinkedList of 16000 items push then shift 5.9220 ns/op 9.1230 ns/op 0.65
array of 16000 items push then pop 49.018 ns/op 101.46 ns/op 0.48
LinkedList of 16000 items push then pop 5.7000 ns/op 8.8190 ns/op 0.65
array of 24000 items push then shift 1.9117 us/op 2.5267 us/op 0.76
LinkedList of 24000 items push then shift 6.6390 ns/op 9.2090 ns/op 0.72
array of 24000 items push then pop 123.17 ns/op 112.84 ns/op 1.09
LinkedList of 24000 items push then pop 5.6460 ns/op 9.2360 ns/op 0.61
intersect bitArray bitLen 8 5.0930 ns/op 6.5410 ns/op 0.78
intersect array and set length 8 49.593 ns/op 65.140 ns/op 0.76
intersect bitArray bitLen 128 27.270 ns/op 34.419 ns/op 0.79
intersect array and set length 128 671.26 ns/op 895.84 ns/op 0.75
bitArray.getTrueBitIndexes() bitLen 128 1.1520 us/op 1.6030 us/op 0.72
bitArray.getTrueBitIndexes() bitLen 248 1.9720 us/op 2.4420 us/op 0.81
bitArray.getTrueBitIndexes() bitLen 512 3.9560 us/op 5.0640 us/op 0.78
Buffer.concat 32 items 821.00 ns/op 1.0940 us/op 0.75
Uint8Array.set 32 items 1.5600 us/op 1.9700 us/op 0.79
Set add up to 64 items then delete first 1.6661 us/op 4.9905 us/op 0.33
OrderedSet add up to 64 items then delete first 2.5259 us/op 6.1921 us/op 0.41
Set add up to 64 items then delete last 1.9867 us/op 5.0000 us/op 0.40
OrderedSet add up to 64 items then delete last 2.9806 us/op 6.1881 us/op 0.48
Set add up to 64 items then delete middle 1.9863 us/op 4.6460 us/op 0.43
OrderedSet add up to 64 items then delete middle 4.2934 us/op 7.2685 us/op 0.59
Set add up to 128 items then delete first 3.9882 us/op 9.3606 us/op 0.43
OrderedSet add up to 128 items then delete first 6.3279 us/op 12.577 us/op 0.50
Set add up to 128 items then delete last 3.8317 us/op 9.2721 us/op 0.41
OrderedSet add up to 128 items then delete last 5.8119 us/op 11.756 us/op 0.49
Set add up to 128 items then delete middle 3.8040 us/op 9.2847 us/op 0.41
OrderedSet add up to 128 items then delete middle 10.802 us/op 17.072 us/op 0.63
Set add up to 256 items then delete first 7.6805 us/op 19.531 us/op 0.39
OrderedSet add up to 256 items then delete first 12.281 us/op 25.885 us/op 0.47
Set add up to 256 items then delete last 7.4997 us/op 18.663 us/op 0.40
OrderedSet add up to 256 items then delete last 11.846 us/op 23.459 us/op 0.50
Set add up to 256 items then delete middle 7.6282 us/op 18.434 us/op 0.41
OrderedSet add up to 256 items then delete middle 31.204 us/op 46.073 us/op 0.68
transfer serialized Status (84 B) 1.3990 us/op 1.7540 us/op 0.80
copy serialized Status (84 B) 1.1480 us/op 1.2460 us/op 0.92
transfer serialized SignedVoluntaryExit (112 B) 1.4840 us/op 1.8540 us/op 0.80
copy serialized SignedVoluntaryExit (112 B) 1.1270 us/op 1.3280 us/op 0.85
transfer serialized ProposerSlashing (416 B) 1.9260 us/op 2.0740 us/op 0.93
copy serialized ProposerSlashing (416 B) 1.6460 us/op 1.7710 us/op 0.93
transfer serialized Attestation (485 B) 1.8840 us/op 2.1280 us/op 0.89
copy serialized Attestation (485 B) 1.7100 us/op 1.9510 us/op 0.88
transfer serialized AttesterSlashing (33232 B) 1.9790 us/op 2.0740 us/op 0.95
copy serialized AttesterSlashing (33232 B) 5.5040 us/op 6.2360 us/op 0.88
transfer serialized Small SignedBeaconBlock (128000 B) 2.0500 us/op 3.3620 us/op 0.61
copy serialized Small SignedBeaconBlock (128000 B) 14.637 us/op 19.557 us/op 0.75
transfer serialized Avg SignedBeaconBlock (200000 B) 2.2710 us/op 3.7370 us/op 0.61
copy serialized Avg SignedBeaconBlock (200000 B) 19.883 us/op 27.306 us/op 0.73
transfer serialized BlobsSidecar (524380 B) 2.2020 us/op 2.9740 us/op 0.74
copy serialized BlobsSidecar (524380 B) 68.826 us/op 106.39 us/op 0.65
transfer serialized Big SignedBeaconBlock (1000000 B) 2.6540 us/op 3.7080 us/op 0.72
copy serialized Big SignedBeaconBlock (1000000 B) 145.01 us/op 270.58 us/op 0.54
pass gossip attestations to forkchoice per slot 2.6630 ms/op 4.5160 ms/op 0.59
forkChoice updateHead vc 100000 bc 64 eq 0 481.96 us/op 692.33 us/op 0.70
forkChoice updateHead vc 600000 bc 64 eq 0 3.2063 ms/op 4.5256 ms/op 0.71
forkChoice updateHead vc 1000000 bc 64 eq 0 4.8134 ms/op 7.3672 ms/op 0.65
forkChoice updateHead vc 600000 bc 320 eq 0 2.8139 ms/op 4.3301 ms/op 0.65
forkChoice updateHead vc 600000 bc 1200 eq 0 2.8154 ms/op 4.4835 ms/op 0.63
forkChoice updateHead vc 600000 bc 7200 eq 0 3.8403 ms/op 5.6148 ms/op 0.68
forkChoice updateHead vc 600000 bc 64 eq 1000 9.8902 ms/op 12.063 ms/op 0.82
forkChoice updateHead vc 600000 bc 64 eq 10000 9.6575 ms/op 12.205 ms/op 0.79
forkChoice updateHead vc 600000 bc 64 eq 300000 11.810 ms/op 16.509 ms/op 0.72
computeDeltas 500000 validators 300 proto nodes 3.0602 ms/op 7.2644 ms/op 0.42
computeDeltas 500000 validators 1200 proto nodes 2.9107 ms/op 7.0790 ms/op 0.41
computeDeltas 500000 validators 7200 proto nodes 2.9684 ms/op 6.7170 ms/op 0.44
computeDeltas 750000 validators 300 proto nodes 4.4255 ms/op 10.255 ms/op 0.43
computeDeltas 750000 validators 1200 proto nodes 4.4535 ms/op 9.8883 ms/op 0.45
computeDeltas 750000 validators 7200 proto nodes 4.5463 ms/op 10.175 ms/op 0.45
computeDeltas 1400000 validators 300 proto nodes 9.0079 ms/op 19.385 ms/op 0.46
computeDeltas 1400000 validators 1200 proto nodes 9.0094 ms/op 19.990 ms/op 0.45
computeDeltas 1400000 validators 7200 proto nodes 8.9206 ms/op 20.817 ms/op 0.43
computeDeltas 2100000 validators 300 proto nodes 13.083 ms/op 30.793 ms/op 0.42
computeDeltas 2100000 validators 1200 proto nodes 12.828 ms/op 28.865 ms/op 0.44
computeDeltas 2100000 validators 7200 proto nodes 12.944 ms/op 29.728 ms/op 0.44
altair processAttestation - 250000 vs - 7PWei normalcase 1.5760 ms/op 3.5391 ms/op 0.45
altair processAttestation - 250000 vs - 7PWei worstcase 2.3201 ms/op 5.0751 ms/op 0.46
altair processAttestation - setStatus - 1/6 committees join 78.108 us/op 161.70 us/op 0.48
altair processAttestation - setStatus - 1/3 committees join 152.59 us/op 282.36 us/op 0.54
altair processAttestation - setStatus - 1/2 committees join 215.69 us/op 392.89 us/op 0.55
altair processAttestation - setStatus - 2/3 committees join 285.75 us/op 475.54 us/op 0.60
altair processAttestation - setStatus - 4/5 committees join 385.24 us/op 721.47 us/op 0.53
altair processAttestation - setStatus - 100% committees join 483.19 us/op 794.52 us/op 0.61
altair processBlock - 250000 vs - 7PWei normalcase 9.3178 ms/op 11.194 ms/op 0.83
altair processBlock - 250000 vs - 7PWei normalcase hashState 31.720 ms/op 44.829 ms/op 0.71
altair processBlock - 250000 vs - 7PWei worstcase 30.448 ms/op 42.933 ms/op 0.71
altair processBlock - 250000 vs - 7PWei worstcase hashState 81.200 ms/op 114.30 ms/op 0.71
phase0 processBlock - 250000 vs - 7PWei normalcase 2.3125 ms/op 3.2319 ms/op 0.72
phase0 processBlock - 250000 vs - 7PWei worstcase 27.036 ms/op 35.322 ms/op 0.77
altair processEth1Data - 250000 vs - 7PWei normalcase 425.40 us/op 705.00 us/op 0.60
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.9850 us/op 18.556 us/op 0.43
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 53.553 us/op 59.278 us/op 0.90
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 12.887 us/op 26.068 us/op 0.49
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.935 us/op 18.346 us/op 0.71
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 148.13 us/op 223.85 us/op 0.66
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.1184 ms/op 1.6376 ms/op 0.68
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.6433 ms/op 2.0279 ms/op 0.81
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.8133 ms/op 1.9046 ms/op 0.95
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.5588 ms/op 4.2016 ms/op 0.61
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.6310 ms/op 3.0264 ms/op 0.54
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.7431 ms/op 6.4870 ms/op 0.58
Tree 40 250000 create 246.18 ms/op 478.30 ms/op 0.51
Tree 40 250000 get(125000) 106.39 ns/op 224.69 ns/op 0.47
Tree 40 250000 set(125000) 758.53 ns/op 1.3882 us/op 0.55
Tree 40 250000 toArray() 16.946 ms/op 26.413 ms/op 0.64
Tree 40 250000 iterate all - toArray() + loop 18.754 ms/op 26.006 ms/op 0.72
Tree 40 250000 iterate all - get(i) 48.946 ms/op 81.027 ms/op 0.60
MutableVector 250000 create 13.850 ms/op 15.339 ms/op 0.90
MutableVector 250000 get(125000) 5.6590 ns/op 6.8570 ns/op 0.83
MutableVector 250000 set(125000) 212.15 ns/op 555.39 ns/op 0.38
MutableVector 250000 toArray() 2.1703 ms/op 4.9517 ms/op 0.44
MutableVector 250000 iterate all - toArray() + loop 2.1845 ms/op 5.0667 ms/op 0.43
MutableVector 250000 iterate all - get(i) 1.4513 ms/op 1.5956 ms/op 0.91
Array 250000 create 2.1284 ms/op 4.6289 ms/op 0.46
Array 250000 clone - spread 1.0927 ms/op 1.7595 ms/op 0.62
Array 250000 get(125000) 1.0260 ns/op 1.9020 ns/op 0.54
Array 250000 set(125000) 1.2370 ns/op 5.6420 ns/op 0.22
Array 250000 iterate all - loop 154.44 us/op 175.16 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 13.772 us/op 70.213 us/op 0.20
effectiveBalanceIncrements clone MutableVector 300000 415.00 ns/op 508.00 ns/op 0.82
effectiveBalanceIncrements rw all Uint8Array 300000 185.17 us/op 204.58 us/op 0.91
effectiveBalanceIncrements rw all MutableVector 300000 66.562 ms/op 171.28 ms/op 0.39
phase0 afterProcessEpoch - 250000 vs - 7PWei 77.019 ms/op 132.30 ms/op 0.58
phase0 beforeProcessEpoch - 250000 vs - 7PWei 46.139 ms/op 47.557 ms/op 0.97
altair processEpoch - mainnet_e81889 427.70 ms/op 563.96 ms/op 0.76
mainnet_e81889 - altair beforeProcessEpoch 73.536 ms/op 94.742 ms/op 0.78
mainnet_e81889 - altair processJustificationAndFinalization 6.9710 us/op 17.674 us/op 0.39
mainnet_e81889 - altair processInactivityUpdates 5.3139 ms/op 5.9791 ms/op 0.89
mainnet_e81889 - altair processRewardsAndPenalties 48.503 ms/op 43.043 ms/op 1.13
mainnet_e81889 - altair processRegistryUpdates 1.6400 us/op 2.6080 us/op 0.63
mainnet_e81889 - altair processSlashings 515.00 ns/op 530.00 ns/op 0.97
mainnet_e81889 - altair processEth1DataReset 534.00 ns/op 522.00 ns/op 1.02
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.8058 ms/op 1.4473 ms/op 1.25
mainnet_e81889 - altair processSlashingsReset 2.8090 us/op 3.4870 us/op 0.81
mainnet_e81889 - altair processRandaoMixesReset 2.7710 us/op 7.2750 us/op 0.38
mainnet_e81889 - altair processHistoricalRootsUpdate 586.00 ns/op 1.0420 us/op 0.56
mainnet_e81889 - altair processParticipationFlagUpdates 1.4210 us/op 2.1650 us/op 0.66
mainnet_e81889 - altair processSyncCommitteeUpdates 571.00 ns/op 1.3480 us/op 0.42
mainnet_e81889 - altair afterProcessEpoch 79.669 ms/op 123.33 ms/op 0.65
capella processEpoch - mainnet_e217614 1.8316 s/op 2.5325 s/op 0.72
mainnet_e217614 - capella beforeProcessEpoch 454.06 ms/op 617.58 ms/op 0.74
mainnet_e217614 - capella processJustificationAndFinalization 14.963 us/op 31.018 us/op 0.48
mainnet_e217614 - capella processInactivityUpdates 15.960 ms/op 31.802 ms/op 0.50
mainnet_e217614 - capella processRewardsAndPenalties 367.73 ms/op 447.85 ms/op 0.82
mainnet_e217614 - capella processRegistryUpdates 8.2220 us/op 32.475 us/op 0.25
mainnet_e217614 - capella processSlashings 532.00 ns/op 1.0660 us/op 0.50
mainnet_e217614 - capella processEth1DataReset 640.00 ns/op 1.1550 us/op 0.55
mainnet_e217614 - capella processEffectiveBalanceUpdates 3.8241 ms/op 6.4566 ms/op 0.59
mainnet_e217614 - capella processSlashingsReset 2.3090 us/op 5.3090 us/op 0.43
mainnet_e217614 - capella processRandaoMixesReset 3.5780 us/op 8.6010 us/op 0.42
mainnet_e217614 - capella processHistoricalRootsUpdate 690.00 ns/op 1.4180 us/op 0.49
mainnet_e217614 - capella processParticipationFlagUpdates 1.7570 us/op 2.4530 us/op 0.72
mainnet_e217614 - capella afterProcessEpoch 198.67 ms/op 322.09 ms/op 0.62
phase0 processEpoch - mainnet_e58758 384.81 ms/op 534.80 ms/op 0.72
mainnet_e58758 - phase0 beforeProcessEpoch 108.19 ms/op 163.00 ms/op 0.66
mainnet_e58758 - phase0 processJustificationAndFinalization 11.120 us/op 24.980 us/op 0.45
mainnet_e58758 - phase0 processRewardsAndPenalties 44.620 ms/op 60.148 ms/op 0.74
mainnet_e58758 - phase0 processRegistryUpdates 8.3730 us/op 14.460 us/op 0.58
mainnet_e58758 - phase0 processSlashings 606.00 ns/op 786.00 ns/op 0.77
mainnet_e58758 - phase0 processEth1DataReset 503.00 ns/op 676.00 ns/op 0.74
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.3918 ms/op 1.2370 ms/op 1.13
mainnet_e58758 - phase0 processSlashingsReset 3.1600 us/op 3.7970 us/op 0.83
mainnet_e58758 - phase0 processRandaoMixesReset 2.7160 us/op 8.8600 us/op 0.31
mainnet_e58758 - phase0 processHistoricalRootsUpdate 519.00 ns/op 700.00 ns/op 0.74
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.0840 us/op 4.1050 us/op 0.75
mainnet_e58758 - phase0 afterProcessEpoch 61.416 ms/op 96.744 ms/op 0.63
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0011 ms/op 1.4392 ms/op 0.70
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1654 ms/op 1.6247 ms/op 0.72
altair processInactivityUpdates - 250000 normalcase 22.803 ms/op 30.786 ms/op 0.74
altair processInactivityUpdates - 250000 worstcase 22.300 ms/op 27.200 ms/op 0.82
phase0 processRegistryUpdates - 250000 normalcase 3.3540 us/op 11.395 us/op 0.29
phase0 processRegistryUpdates - 250000 badcase_full_deposits 358.06 us/op 434.61 us/op 0.82
phase0 processRegistryUpdates - 250000 worstcase 0.5 109.01 ms/op 159.28 ms/op 0.68
altair processRewardsAndPenalties - 250000 normalcase 55.228 ms/op 52.897 ms/op 1.04
altair processRewardsAndPenalties - 250000 worstcase 54.780 ms/op 62.662 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 5.6951 ms/op 11.167 ms/op 0.51
phase0 getAttestationDeltas - 250000 worstcase 5.0227 ms/op 12.481 ms/op 0.40
phase0 processSlashings - 250000 worstcase 85.908 us/op 128.00 us/op 0.67
altair processSyncCommitteeUpdates - 250000 97.809 ms/op 173.97 ms/op 0.56
BeaconState.hashTreeRoot - No change 380.00 ns/op 736.00 ns/op 0.52
BeaconState.hashTreeRoot - 1 full validator 82.807 us/op 151.26 us/op 0.55
BeaconState.hashTreeRoot - 32 full validator 841.24 us/op 1.5728 ms/op 0.53
BeaconState.hashTreeRoot - 512 full validator 9.0392 ms/op 22.116 ms/op 0.41
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 100.56 us/op 195.42 us/op 0.51
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.3924 ms/op 2.3697 ms/op 0.59
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 17.478 ms/op 33.906 ms/op 0.52
BeaconState.hashTreeRoot - 1 balances 79.312 us/op 128.58 us/op 0.62
BeaconState.hashTreeRoot - 32 balances 720.75 us/op 1.3087 ms/op 0.55
BeaconState.hashTreeRoot - 512 balances 6.8567 ms/op 16.927 ms/op 0.41
BeaconState.hashTreeRoot - 250000 balances 137.66 ms/op 218.23 ms/op 0.63
aggregationBits - 2048 els - zipIndexesInBitList 10.217 us/op 21.281 us/op 0.48
byteArrayEquals 32 64.162 ns/op 77.793 ns/op 0.82
Buffer.compare 32 38.595 ns/op 58.565 ns/op 0.66
byteArrayEquals 1024 1.7556 us/op 2.1320 us/op 0.82
Buffer.compare 1024 46.716 ns/op 73.747 ns/op 0.63
byteArrayEquals 16384 27.907 us/op 33.912 us/op 0.82
Buffer.compare 16384 219.74 ns/op 285.68 ns/op 0.77
byteArrayEquals 123687377 211.38 ms/op 251.40 ms/op 0.84
Buffer.compare 123687377 3.6324 ms/op 6.2332 ms/op 0.58
byteArrayEquals 32 - diff last byte 61.853 ns/op 73.700 ns/op 0.84
Buffer.compare 32 - diff last byte 39.020 ns/op 56.404 ns/op 0.69
byteArrayEquals 1024 - diff last byte 1.7390 us/op 2.0849 us/op 0.83
Buffer.compare 1024 - diff last byte 46.344 ns/op 72.042 ns/op 0.64
byteArrayEquals 16384 - diff last byte 27.948 us/op 32.407 us/op 0.86
Buffer.compare 16384 - diff last byte 227.35 ns/op 276.79 ns/op 0.82
byteArrayEquals 123687377 - diff last byte 189.56 ms/op 249.76 ms/op 0.76
Buffer.compare 123687377 - diff last byte 5.3605 ms/op 7.9721 ms/op 0.67
byteArrayEquals 32 - random bytes 4.3770 ns/op 5.9150 ns/op 0.74
Buffer.compare 32 - random bytes 35.435 ns/op 62.913 ns/op 0.56
byteArrayEquals 1024 - random bytes 4.1470 ns/op 5.6050 ns/op 0.74
Buffer.compare 1024 - random bytes 33.418 ns/op 62.140 ns/op 0.54
byteArrayEquals 16384 - random bytes 4.1300 ns/op 5.4970 ns/op 0.75
Buffer.compare 16384 - random bytes 33.601 ns/op 62.345 ns/op 0.54
byteArrayEquals 123687377 - random bytes 7.2100 ns/op 9.4500 ns/op 0.76
Buffer.compare 123687377 - random bytes 35.610 ns/op 69.530 ns/op 0.51
regular array get 100000 times 38.346 us/op 46.253 us/op 0.83
wrappedArray get 100000 times 38.154 us/op 46.262 us/op 0.82
arrayWithProxy get 100000 times 10.360 ms/op 14.345 ms/op 0.72
ssz.Root.equals 55.090 ns/op 55.168 ns/op 1.00
byteArrayEquals 52.007 ns/op 54.205 ns/op 0.96
Buffer.compare 8.4900 ns/op 12.276 ns/op 0.69
shuffle list - 16384 els 4.5518 ms/op 7.1604 ms/op 0.64
shuffle list - 250000 els 66.793 ms/op 105.01 ms/op 0.64
processSlot - 1 slots 16.008 us/op 17.471 us/op 0.92
processSlot - 32 slots 3.2038 ms/op 3.5126 ms/op 0.91
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 51.807 ms/op 60.058 ms/op 0.86
getCommitteeAssignments - req 1 vs - 250000 vc 2.1959 ms/op 2.5045 ms/op 0.88
getCommitteeAssignments - req 100 vs - 250000 vc 3.3158 ms/op 3.7498 ms/op 0.88
getCommitteeAssignments - req 1000 vs - 250000 vc 3.6611 ms/op 4.0164 ms/op 0.91
findModifiedValidators - 10000 modified validators 405.82 ms/op 546.18 ms/op 0.74
findModifiedValidators - 1000 modified validators 305.74 ms/op 436.85 ms/op 0.70
findModifiedValidators - 100 modified validators 306.82 ms/op 404.82 ms/op 0.76
findModifiedValidators - 10 modified validators 321.17 ms/op 464.56 ms/op 0.69
findModifiedValidators - 1 modified validators 302.91 ms/op 430.69 ms/op 0.70
findModifiedValidators - no difference 331.04 ms/op 454.20 ms/op 0.73
compare ViewDUs 4.1925 s/op 4.7274 s/op 0.89
compare each validator Uint8Array 1.6872 s/op 1.8256 s/op 0.92
compare ViewDU to Uint8Array 1.0999 s/op 1.3148 s/op 0.84
migrate state 1000000 validators, 24 modified, 0 new 766.09 ms/op 827.61 ms/op 0.93
migrate state 1000000 validators, 1700 modified, 1000 new 954.95 ms/op 1.1480 s/op 0.83
migrate state 1000000 validators, 3400 modified, 2000 new 1.3212 s/op 1.3755 s/op 0.96
migrate state 1500000 validators, 24 modified, 0 new 741.55 ms/op 839.32 ms/op 0.88
migrate state 1500000 validators, 1700 modified, 1000 new 1.5163 s/op 1.1903 s/op 1.27
migrate state 1500000 validators, 3400 modified, 2000 new 1.2596 s/op 1.4908 s/op 0.84
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.4000 ns/op 5.3500 ns/op 0.82
state getBlockRootAtSlot - 250000 vs - 7PWei 708.68 ns/op 689.17 ns/op 1.03
computeProposers - vc 250000 6.3348 ms/op 10.183 ms/op 0.62
computeEpochShuffling - vc 250000 72.885 ms/op 108.06 ms/op 0.67
getNextSyncCommittee - vc 250000 113.89 ms/op 174.60 ms/op 0.65
computeSigningRoot for AttestationData 26.799 us/op 30.940 us/op 0.87
hash AttestationData serialized data then Buffer.toString(base64) 1.2769 us/op 2.4678 us/op 0.52
toHexString serialized data 821.66 ns/op 1.4613 us/op 0.56
Buffer.toString(base64) 161.67 ns/op 285.94 ns/op 0.57

by benchmarkbot/action

Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Merging #6359 (2cca29f) into unstable (ed43a98) will decrease coverage by 0.20%.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6359      +/-   ##
============================================
- Coverage     60.15%   59.95%   -0.20%     
============================================
  Files           407      399       -8     
  Lines         46511    43592    -2919     
  Branches       1550     1382     -168     
============================================
- Hits          27980    26137    -1843     
+ Misses        18499    17426    -1073     
+ Partials         32       29       -3     

@twoeths
Copy link
Contributor Author

twoeths commented Jan 29, 2024

e2e tests are stable, passed 6 times. The key thing is to use useWorker=false, it works nice with vitest. I suppose we could/should do the same thing for other failed e2e tests in #6358

@twoeths twoeths marked this pull request as ready for review January 29, 2024 07:46
@twoeths twoeths requested a review from a team as a code owner January 29, 2024 07:46
@twoeths twoeths force-pushed the tuyen/n_historical_states_regen branch from 8c18c82 to 0b90609 Compare January 30, 2024 02:19
@twoeths twoeths marked this pull request as draft February 20, 2024 03:45
@twoeths
Copy link
Contributor Author

twoeths commented Feb 20, 2024

decide to separate this PR to multiple PRs to make it easier to review

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