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

fix: head state regen in n-historical state #6674

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Apr 17, 2024

Motivation

  • There was an error in holesky when I run with 0 epoch checkpoint state and 1 block state:
Apr-16 03:16:15.481[chain]            ^[[33mwarn^[[39m: Head state not available, triggering regen stateRoot=0x122ee97b202ea88964b50370e5ded3a700393ebaeb9003b32672bcc025655841
Apr-16 03:16:16.841[chain]           ^[[34mdebug^[[39m: Error get or reload state epoch=45141, rootHex=0x22f307ee9f83f0b114dff680f8820860975d12871211f4127cd3217b7a1ba1eb - headState does not exist for head root=0x8cd7a19301eef803ceda3dfc51a0758ff348d6f5832d81843949a00b7702ae2f slot=1444579
Apr-16 03:16:16.841[chain]           ^[[31merror^[[39m: Error on head state regen - REGEN_ERROR_NO_SEED_STATE
  • When there is a reorg that caused head state to be regen and reloaded, persistent checkpoint state cache try to load a seed state, and since it was configed as 0 epoch retained, it gets head state for seed state and head state is not available. We need to break this circular dependency

Description

  • New getSeedState() api in block state cache returning 1st state to guarantee we can always get one
  • This is only needed for 0 epoch checkpoint state cache, we can actually get through it by limiting retained epoch to be at least 1. But I'd like to test n-historical flag with only 1 block state in memory to cause the node to reload multiple times in different networks before we go production

part of #5968

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Merging #6674 (799b089) into unstable (2dae605) will decrease coverage by 0.01%.
The diff coverage is 60.00%.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #6674      +/-   ##
============================================
- Coverage     61.80%   61.80%   -0.01%     
============================================
  Files           556      556              
  Lines         59073    59103      +30     
  Branches       1898     1898              
============================================
+ Hits          36508    36526      +18     
- Misses        22522    22534      +12     
  Partials         43       43              

Copy link
Contributor

github-actions bot commented Apr 17, 2024

Performance Report

✔️ no performance regression detected

🚀🚀 Significant benchmark improvement detected

Benchmark suite Current: 7e27164 Previous: 2dae605 Ratio
fastMsgIdFn sha256 / 1000 bytes 5.8680 us/op 21.365 us/op 0.27
fastMsgIdFn sha256 / 10000 bytes 50.712 us/op 165.69 us/op 0.31
send data - 1000 512B messages 18.087 ms/op 56.860 ms/op 0.32
send data - 1000 1024B messages 23.919 ms/op 78.640 ms/op 0.30
Set add up to 64 items then delete first 1.6616 us/op 6.0638 us/op 0.27
OrderedSet add up to 64 items then delete first 2.5263 us/op 8.5510 us/op 0.30
Set add up to 64 items then delete last 1.8843 us/op 6.0770 us/op 0.31
Set add up to 64 items then delete middle 1.8697 us/op 5.7263 us/op 0.33
Set add up to 128 items then delete first 3.6622 us/op 11.726 us/op 0.31
Set add up to 128 items then delete last 3.5946 us/op 12.055 us/op 0.30
OrderedSet add up to 128 items then delete last 5.4348 us/op 16.737 us/op 0.32
Set add up to 128 items then delete middle 3.5846 us/op 11.795 us/op 0.30
Set add up to 256 items then delete first 7.3735 us/op 24.904 us/op 0.30
Set add up to 256 items then delete last 7.1024 us/op 26.453 us/op 0.27
Set add up to 256 items then delete middle 7.0680 us/op 24.836 us/op 0.28
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1477 ms/op 3.7693 ms/op 0.30
phase0 getAttestationDeltas - 250000 normalcase 6.1947 ms/op 19.168 ms/op 0.32
phase0 getAttestationDeltas - 250000 worstcase 5.9499 ms/op 18.380 ms/op 0.32
computeEpochShuffling - vc 250000 82.127 ms/op 248.15 ms/op 0.33
Full benchmark results
Benchmark suite Current: 7e27164 Previous: 2dae605 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 731.34 us/op 1.0150 ms/op 0.72
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 73.701 us/op 96.065 us/op 0.77
BLS verify - blst-native 1.1560 ms/op 1.5204 ms/op 0.76
BLS verifyMultipleSignatures 3 - blst-native 2.4506 ms/op 3.1984 ms/op 0.77
BLS verifyMultipleSignatures 8 - blst-native 5.4305 ms/op 6.9859 ms/op 0.78
BLS verifyMultipleSignatures 32 - blst-native 19.890 ms/op 26.728 ms/op 0.74
BLS verifyMultipleSignatures 64 - blst-native 40.528 ms/op 51.190 ms/op 0.79
BLS verifyMultipleSignatures 128 - blst-native 93.025 ms/op 104.13 ms/op 0.89
BLS deserializing 10000 signatures 846.88 ms/op 1.0891 s/op 0.78
BLS deserializing 100000 signatures 8.1480 s/op 10.512 s/op 0.78
BLS verifyMultipleSignatures - same message - 3 - blst-native 1.1085 ms/op 1.6456 ms/op 0.67
BLS verifyMultipleSignatures - same message - 8 - blst-native 1.2784 ms/op 1.7367 ms/op 0.74
BLS verifyMultipleSignatures - same message - 32 - blst-native 2.4760 ms/op 2.6032 ms/op 0.95
BLS verifyMultipleSignatures - same message - 64 - blst-native 3.9781 ms/op 3.9652 ms/op 1.00
BLS verifyMultipleSignatures - same message - 128 - blst-native 4.9310 ms/op 6.3191 ms/op 0.78
BLS aggregatePubkeys 32 - blst-native 22.456 us/op 27.822 us/op 0.81
BLS aggregatePubkeys 128 - blst-native 88.088 us/op 117.11 us/op 0.75
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 42.248 ms/op 69.618 ms/op 0.61
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 43.514 ms/op 65.155 ms/op 0.67
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 26.028 ms/op 58.821 ms/op 0.44
getSlashingsAndExits - default max 123.27 us/op 174.36 us/op 0.71
getSlashingsAndExits - 2k 326.89 us/op 442.95 us/op 0.74
proposeBlockBody type=full, size=empty 4.0764 ms/op 8.5465 ms/op 0.48
isKnown best case - 1 super set check 355.00 ns/op 507.00 ns/op 0.70
isKnown normal case - 2 super set checks 322.00 ns/op 494.00 ns/op 0.65
isKnown worse case - 16 super set checks 323.00 ns/op 472.00 ns/op 0.68
InMemoryCheckpointStateCache - add get delete 4.4710 us/op 6.1220 us/op 0.73
validate api signedAggregateAndProof - struct 2.4049 ms/op 2.9111 ms/op 0.83
validate gossip signedAggregateAndProof - struct 2.5084 ms/op 3.2857 ms/op 0.76
validate gossip attestation - vc 640000 1.1184 ms/op 1.6321 ms/op 0.69
batch validate gossip attestation - vc 640000 - chunk 32 132.14 us/op 181.01 us/op 0.73
batch validate gossip attestation - vc 640000 - chunk 64 118.23 us/op 166.35 us/op 0.71
batch validate gossip attestation - vc 640000 - chunk 128 113.99 us/op 159.27 us/op 0.72
batch validate gossip attestation - vc 640000 - chunk 256 107.13 us/op 175.93 us/op 0.61
pickEth1Vote - no votes 892.53 us/op 1.4227 ms/op 0.63
pickEth1Vote - max votes 9.0094 ms/op 10.550 ms/op 0.85
pickEth1Vote - Eth1Data hashTreeRoot value x2048 12.096 ms/op 22.341 ms/op 0.54
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 15.622 ms/op 34.028 ms/op 0.46
pickEth1Vote - Eth1Data fastSerialize value x2048 453.39 us/op 903.90 us/op 0.50
pickEth1Vote - Eth1Data fastSerialize tree x2048 3.2649 ms/op 5.9811 ms/op 0.55
bytes32 toHexString 430.00 ns/op 754.00 ns/op 0.57
bytes32 Buffer.toString(hex) 311.00 ns/op 400.00 ns/op 0.78
bytes32 Buffer.toString(hex) from Uint8Array 423.00 ns/op 613.00 ns/op 0.69
bytes32 Buffer.toString(hex) + 0x 306.00 ns/op 359.00 ns/op 0.85
Object access 1 prop 0.19900 ns/op 0.24700 ns/op 0.81
Map access 1 prop 0.21700 ns/op 0.17800 ns/op 1.22
Object get x1000 4.8780 ns/op 8.5440 ns/op 0.57
Map get x1000 0.71300 ns/op 0.94800 ns/op 0.75
Object set x1000 28.156 ns/op 63.211 ns/op 0.45
Map set x1000 17.665 ns/op 48.132 ns/op 0.37
Return object 10000 times 0.21860 ns/op 0.27110 ns/op 0.81
Throw Error 10000 times 2.6565 us/op 4.7553 us/op 0.56
fastMsgIdFn sha256 / 200 bytes 1.8990 us/op 5.6090 us/op 0.34
fastMsgIdFn h32 xxhash / 200 bytes 283.00 ns/op 531.00 ns/op 0.53
fastMsgIdFn h64 xxhash / 200 bytes 337.00 ns/op 606.00 ns/op 0.56
fastMsgIdFn sha256 / 1000 bytes 5.8680 us/op 21.365 us/op 0.27
fastMsgIdFn h32 xxhash / 1000 bytes 399.00 ns/op 815.00 ns/op 0.49
fastMsgIdFn h64 xxhash / 1000 bytes 404.00 ns/op 1.0990 us/op 0.37
fastMsgIdFn sha256 / 10000 bytes 50.712 us/op 165.69 us/op 0.31
fastMsgIdFn h32 xxhash / 10000 bytes 1.7530 us/op 3.1860 us/op 0.55
fastMsgIdFn h64 xxhash / 10000 bytes 1.2060 us/op 1.7150 us/op 0.70
send data - 1000 256B messages 11.804 ms/op 26.598 ms/op 0.44
send data - 1000 512B messages 18.087 ms/op 56.860 ms/op 0.32
send data - 1000 1024B messages 23.919 ms/op 78.640 ms/op 0.30
send data - 1000 1200B messages 31.592 ms/op 50.884 ms/op 0.62
send data - 1000 2048B messages 33.460 ms/op 66.506 ms/op 0.50
send data - 1000 4096B messages 33.245 ms/op 57.605 ms/op 0.58
send data - 1000 16384B messages 79.901 ms/op 142.12 ms/op 0.56
send data - 1000 65536B messages 436.88 ms/op 514.81 ms/op 0.85
enrSubnets - fastDeserialize 64 bits 949.00 ns/op 1.6880 us/op 0.56
enrSubnets - ssz BitVector 64 bits 438.00 ns/op 645.00 ns/op 0.68
enrSubnets - fastDeserialize 4 bits 209.00 ns/op 262.00 ns/op 0.80
enrSubnets - ssz BitVector 4 bits 432.00 ns/op 610.00 ns/op 0.71
prioritizePeers score -10:0 att 32-0.1 sync 2-0 146.56 us/op 263.96 us/op 0.56
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 163.61 us/op 414.16 us/op 0.40
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 238.13 us/op 500.15 us/op 0.48
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 362.11 us/op 831.29 us/op 0.44
prioritizePeers score 0:0 att 64-1 sync 4-1 432.62 us/op 985.31 us/op 0.44
array of 16000 items push then shift 1.2674 us/op 2.0290 us/op 0.62
LinkedList of 16000 items push then shift 7.2390 ns/op 10.853 ns/op 0.67
array of 16000 items push then pop 73.631 ns/op 123.11 ns/op 0.60
LinkedList of 16000 items push then pop 5.7980 ns/op 10.493 ns/op 0.55
array of 24000 items push then shift 1.8518 us/op 3.3183 us/op 0.56
LinkedList of 24000 items push then shift 6.7700 ns/op 12.620 ns/op 0.54
array of 24000 items push then pop 125.88 ns/op 174.40 ns/op 0.72
LinkedList of 24000 items push then pop 5.7580 ns/op 11.093 ns/op 0.52
intersect bitArray bitLen 8 4.7410 ns/op 7.2830 ns/op 0.65
intersect array and set length 8 49.153 ns/op 88.935 ns/op 0.55
intersect bitArray bitLen 128 29.216 ns/op 43.968 ns/op 0.66
intersect array and set length 128 686.78 ns/op 1.3205 us/op 0.52
bitArray.getTrueBitIndexes() bitLen 128 1.1650 us/op 2.3680 us/op 0.49
bitArray.getTrueBitIndexes() bitLen 248 1.9460 us/op 3.6410 us/op 0.53
bitArray.getTrueBitIndexes() bitLen 512 3.5100 us/op 7.1860 us/op 0.49
Buffer.concat 32 items 838.00 ns/op 1.3940 us/op 0.60
Uint8Array.set 32 items 1.9510 us/op 2.5700 us/op 0.76
Set add up to 64 items then delete first 1.6616 us/op 6.0638 us/op 0.27
OrderedSet add up to 64 items then delete first 2.5263 us/op 8.5510 us/op 0.30
Set add up to 64 items then delete last 1.8843 us/op 6.0770 us/op 0.31
OrderedSet add up to 64 items then delete last 2.8214 us/op 7.8513 us/op 0.36
Set add up to 64 items then delete middle 1.8697 us/op 5.7263 us/op 0.33
OrderedSet add up to 64 items then delete middle 3.9868 us/op 9.3414 us/op 0.43
Set add up to 128 items then delete first 3.6622 us/op 11.726 us/op 0.31
OrderedSet add up to 128 items then delete first 5.7684 us/op 16.755 us/op 0.34
Set add up to 128 items then delete last 3.5946 us/op 12.055 us/op 0.30
OrderedSet add up to 128 items then delete last 5.4348 us/op 16.737 us/op 0.32
Set add up to 128 items then delete middle 3.5846 us/op 11.795 us/op 0.30
OrderedSet add up to 128 items then delete middle 10.697 us/op 21.980 us/op 0.49
Set add up to 256 items then delete first 7.3735 us/op 24.904 us/op 0.30
OrderedSet add up to 256 items then delete first 11.670 us/op 33.159 us/op 0.35
Set add up to 256 items then delete last 7.1024 us/op 26.453 us/op 0.27
OrderedSet add up to 256 items then delete last 11.183 us/op 33.354 us/op 0.34
Set add up to 256 items then delete middle 7.0680 us/op 24.836 us/op 0.28
OrderedSet add up to 256 items then delete middle 29.664 us/op 60.362 us/op 0.49
transfer serialized Status (84 B) 1.5670 us/op 2.0340 us/op 0.77
copy serialized Status (84 B) 1.1800 us/op 1.6180 us/op 0.73
transfer serialized SignedVoluntaryExit (112 B) 1.7650 us/op 2.4160 us/op 0.73
copy serialized SignedVoluntaryExit (112 B) 1.3430 us/op 1.7420 us/op 0.77
transfer serialized ProposerSlashing (416 B) 2.0650 us/op 4.0120 us/op 0.51
copy serialized ProposerSlashing (416 B) 1.6330 us/op 3.4060 us/op 0.48
transfer serialized Attestation (485 B) 1.8580 us/op 3.5300 us/op 0.53
copy serialized Attestation (485 B) 2.0290 us/op 2.9710 us/op 0.68
transfer serialized AttesterSlashing (33232 B) 2.5270 us/op 3.0150 us/op 0.84
copy serialized AttesterSlashing (33232 B) 5.7680 us/op 10.062 us/op 0.57
transfer serialized Small SignedBeaconBlock (128000 B) 2.1170 us/op 3.5420 us/op 0.60
copy serialized Small SignedBeaconBlock (128000 B) 18.263 us/op 27.523 us/op 0.66
transfer serialized Avg SignedBeaconBlock (200000 B) 2.4040 us/op 3.7110 us/op 0.65
copy serialized Avg SignedBeaconBlock (200000 B) 24.869 us/op 32.143 us/op 0.77
transfer serialized BlobsSidecar (524380 B) 2.8360 us/op 4.1660 us/op 0.68
copy serialized BlobsSidecar (524380 B) 80.980 us/op 104.21 us/op 0.78
transfer serialized Big SignedBeaconBlock (1000000 B) 3.3650 us/op 3.9180 us/op 0.86
copy serialized Big SignedBeaconBlock (1000000 B) 148.73 us/op 185.93 us/op 0.80
pass gossip attestations to forkchoice per slot 2.8254 ms/op 5.7482 ms/op 0.49
forkChoice updateHead vc 100000 bc 64 eq 0 454.91 us/op 1.0062 ms/op 0.45
forkChoice updateHead vc 600000 bc 64 eq 0 3.8311 ms/op 5.2902 ms/op 0.72
forkChoice updateHead vc 1000000 bc 64 eq 0 4.5259 ms/op 8.9346 ms/op 0.51
forkChoice updateHead vc 600000 bc 320 eq 0 2.6266 ms/op 6.6889 ms/op 0.39
forkChoice updateHead vc 600000 bc 1200 eq 0 2.7092 ms/op 5.7342 ms/op 0.47
forkChoice updateHead vc 600000 bc 7200 eq 0 3.6098 ms/op 7.9181 ms/op 0.46
forkChoice updateHead vc 600000 bc 64 eq 1000 9.5026 ms/op 16.578 ms/op 0.57
forkChoice updateHead vc 600000 bc 64 eq 10000 9.4999 ms/op 15.482 ms/op 0.61
forkChoice updateHead vc 600000 bc 64 eq 300000 11.897 ms/op 19.611 ms/op 0.61
computeDeltas 500000 validators 300 proto nodes 3.4207 ms/op 7.4105 ms/op 0.46
computeDeltas 500000 validators 1200 proto nodes 3.6791 ms/op 7.4659 ms/op 0.49
computeDeltas 500000 validators 7200 proto nodes 3.6120 ms/op 7.4208 ms/op 0.49
computeDeltas 750000 validators 300 proto nodes 5.3320 ms/op 11.870 ms/op 0.45
computeDeltas 750000 validators 1200 proto nodes 5.8069 ms/op 10.689 ms/op 0.54
computeDeltas 750000 validators 7200 proto nodes 5.9028 ms/op 10.646 ms/op 0.55
computeDeltas 1400000 validators 300 proto nodes 11.279 ms/op 21.929 ms/op 0.51
computeDeltas 1400000 validators 1200 proto nodes 10.266 ms/op 22.379 ms/op 0.46
computeDeltas 1400000 validators 7200 proto nodes 10.417 ms/op 22.564 ms/op 0.46
computeDeltas 2100000 validators 300 proto nodes 15.823 ms/op 34.405 ms/op 0.46
computeDeltas 2100000 validators 1200 proto nodes 17.271 ms/op 33.082 ms/op 0.52
computeDeltas 2100000 validators 7200 proto nodes 16.282 ms/op 32.476 ms/op 0.50
altair processAttestation - 250000 vs - 7PWei normalcase 4.4303 ms/op 2.5186 ms/op 1.76
altair processAttestation - 250000 vs - 7PWei worstcase 4.6031 ms/op 3.4951 ms/op 1.32
altair processAttestation - setStatus - 1/6 committees join 105.87 us/op 227.82 us/op 0.46
altair processAttestation - setStatus - 1/3 committees join 214.04 us/op 405.16 us/op 0.53
altair processAttestation - setStatus - 1/2 committees join 287.19 us/op 551.76 us/op 0.52
altair processAttestation - setStatus - 2/3 committees join 417.38 us/op 648.62 us/op 0.64
altair processAttestation - setStatus - 4/5 committees join 457.03 us/op 833.23 us/op 0.55
altair processAttestation - setStatus - 100% committees join 585.28 us/op 1.0023 ms/op 0.58
altair processBlock - 250000 vs - 7PWei normalcase 8.6561 ms/op 8.4441 ms/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase hashState 40.118 ms/op 35.832 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 38.201 ms/op 44.437 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase hashState 93.170 ms/op 104.12 ms/op 0.89
phase0 processBlock - 250000 vs - 7PWei normalcase 2.7171 ms/op 2.7845 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei worstcase 27.861 ms/op 30.920 ms/op 0.90
altair processEth1Data - 250000 vs - 7PWei normalcase 268.51 us/op 499.87 us/op 0.54
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 9.6220 us/op 17.225 us/op 0.56
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 57.957 us/op 96.998 us/op 0.60
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 9.3640 us/op 15.655 us/op 0.60
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 12.491 us/op 9.9430 us/op 1.26
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 162.23 us/op 287.11 us/op 0.57
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 900.34 us/op 2.3363 ms/op 0.39
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 1.3441 ms/op 2.8221 ms/op 0.48
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0545 ms/op 2.8476 ms/op 0.37
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 4.1346 ms/op 3.2481 ms/op 1.27
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.8629 ms/op 2.3481 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 5.0047 ms/op 5.5503 ms/op 0.90
Tree 40 250000 create 277.07 ms/op 381.18 ms/op 0.73
Tree 40 250000 get(125000) 118.39 ns/op 214.27 ns/op 0.55
Tree 40 250000 set(125000) 749.91 ns/op 1.0639 us/op 0.70
Tree 40 250000 toArray() 12.985 ms/op 19.710 ms/op 0.66
Tree 40 250000 iterate all - toArray() + loop 21.139 ms/op 20.286 ms/op 1.04
Tree 40 250000 iterate all - get(i) 48.115 ms/op 71.670 ms/op 0.67
MutableVector 250000 create 14.149 ms/op 18.243 ms/op 0.78
MutableVector 250000 get(125000) 5.7540 ns/op 6.7540 ns/op 0.85
MutableVector 250000 set(125000) 354.40 ns/op 264.76 ns/op 1.34
MutableVector 250000 toArray() 3.9991 ms/op 3.4884 ms/op 1.15
MutableVector 250000 iterate all - toArray() + loop 3.8779 ms/op 3.9021 ms/op 0.99
MutableVector 250000 iterate all - get(i) 1.4104 ms/op 1.6354 ms/op 0.86
Array 250000 create 3.5503 ms/op 3.3386 ms/op 1.06
Array 250000 clone - spread 1.2901 ms/op 1.3772 ms/op 0.94
Array 250000 get(125000) 1.3980 ns/op 1.1390 ns/op 1.23
Array 250000 set(125000) 1.9270 ns/op 4.2810 ns/op 0.45
Array 250000 iterate all - loop 159.03 us/op 186.57 us/op 0.85
effectiveBalanceIncrements clone Uint8Array 300000 29.253 us/op 43.168 us/op 0.68
effectiveBalanceIncrements clone MutableVector 300000 442.00 ns/op 481.00 ns/op 0.92
effectiveBalanceIncrements rw all Uint8Array 300000 182.40 us/op 241.03 us/op 0.76
effectiveBalanceIncrements rw all MutableVector 300000 76.782 ms/op 109.23 ms/op 0.70
phase0 afterProcessEpoch - 250000 vs - 7PWei 84.396 ms/op 131.85 ms/op 0.64
phase0 beforeProcessEpoch - 250000 vs - 7PWei 49.386 ms/op 62.078 ms/op 0.80
altair processEpoch - mainnet_e81889 447.71 ms/op 599.07 ms/op 0.75
mainnet_e81889 - altair beforeProcessEpoch 71.374 ms/op 104.56 ms/op 0.68
mainnet_e81889 - altair processJustificationAndFinalization 11.968 us/op 33.639 us/op 0.36
mainnet_e81889 - altair processInactivityUpdates 4.8329 ms/op 9.3013 ms/op 0.52
mainnet_e81889 - altair processRewardsAndPenalties 68.348 ms/op 75.536 ms/op 0.90
mainnet_e81889 - altair processRegistryUpdates 1.7140 us/op 5.3300 us/op 0.32
mainnet_e81889 - altair processSlashings 731.00 ns/op 1.0830 us/op 0.67
mainnet_e81889 - altair processEth1DataReset 740.00 ns/op 947.00 ns/op 0.78
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.0039 ms/op 2.0591 ms/op 0.49
mainnet_e81889 - altair processSlashingsReset 2.5910 us/op 5.7430 us/op 0.45
mainnet_e81889 - altair processRandaoMixesReset 3.7240 us/op 5.1950 us/op 0.72
mainnet_e81889 - altair processHistoricalRootsUpdate 756.00 ns/op 1.3070 us/op 0.58
mainnet_e81889 - altair processParticipationFlagUpdates 1.4620 us/op 4.1830 us/op 0.35
mainnet_e81889 - altair processSyncCommitteeUpdates 843.00 ns/op 1.2070 us/op 0.70
mainnet_e81889 - altair afterProcessEpoch 81.528 ms/op 160.60 ms/op 0.51
capella processEpoch - mainnet_e217614 1.6786 s/op 3.8050 s/op 0.44
mainnet_e217614 - capella beforeProcessEpoch 384.83 ms/op 910.47 ms/op 0.42
mainnet_e217614 - capella processJustificationAndFinalization 13.039 us/op 40.597 us/op 0.32
mainnet_e217614 - capella processInactivityUpdates 15.124 ms/op 40.853 ms/op 0.37
mainnet_e217614 - capella processRewardsAndPenalties 429.17 ms/op 1.0767 s/op 0.40
mainnet_e217614 - capella processRegistryUpdates 14.143 us/op 40.287 us/op 0.35
mainnet_e217614 - capella processSlashings 783.00 ns/op 1.2280 us/op 0.64
mainnet_e217614 - capella processEth1DataReset 600.00 ns/op 979.00 ns/op 0.61
mainnet_e217614 - capella processEffectiveBalanceUpdates 15.836 ms/op 7.4595 ms/op 2.12
mainnet_e217614 - capella processSlashingsReset 2.5900 us/op 8.3230 us/op 0.31
mainnet_e217614 - capella processRandaoMixesReset 3.8210 us/op 13.754 us/op 0.28
mainnet_e217614 - capella processHistoricalRootsUpdate 774.00 ns/op 1.6280 us/op 0.48
mainnet_e217614 - capella processParticipationFlagUpdates 2.3190 us/op 6.1610 us/op 0.38
mainnet_e217614 - capella afterProcessEpoch 216.57 ms/op 643.05 ms/op 0.34
phase0 processEpoch - mainnet_e58758 379.27 ms/op 601.25 ms/op 0.63
mainnet_e58758 - phase0 beforeProcessEpoch 103.05 ms/op 179.14 ms/op 0.58
mainnet_e58758 - phase0 processJustificationAndFinalization 11.689 us/op 23.191 us/op 0.50
mainnet_e58758 - phase0 processRewardsAndPenalties 53.320 ms/op 89.238 ms/op 0.60
mainnet_e58758 - phase0 processRegistryUpdates 12.032 us/op 22.553 us/op 0.53
mainnet_e58758 - phase0 processSlashings 627.00 ns/op 1.2240 us/op 0.51
mainnet_e58758 - phase0 processEth1DataReset 628.00 ns/op 1.2140 us/op 0.52
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 839.75 us/op 2.0296 ms/op 0.41
mainnet_e58758 - phase0 processSlashingsReset 4.3490 us/op 6.3360 us/op 0.69
mainnet_e58758 - phase0 processRandaoMixesReset 6.7110 us/op 15.414 us/op 0.44
mainnet_e58758 - phase0 processHistoricalRootsUpdate 872.00 ns/op 2.0920 us/op 0.42
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.3480 us/op 7.6050 us/op 0.57
mainnet_e58758 - phase0 afterProcessEpoch 81.144 ms/op 171.18 ms/op 0.47
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.0214 ms/op 2.2512 ms/op 0.45
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.1477 ms/op 3.7693 ms/op 0.30
altair processInactivityUpdates - 250000 normalcase 33.693 ms/op 47.850 ms/op 0.70
altair processInactivityUpdates - 250000 worstcase 39.434 ms/op 57.509 ms/op 0.69
phase0 processRegistryUpdates - 250000 normalcase 12.025 us/op 19.589 us/op 0.61
phase0 processRegistryUpdates - 250000 badcase_full_deposits 486.45 us/op 815.68 us/op 0.60
phase0 processRegistryUpdates - 250000 worstcase 0.5 144.60 ms/op 350.19 ms/op 0.41
altair processRewardsAndPenalties - 250000 normalcase 78.823 ms/op 128.19 ms/op 0.61
altair processRewardsAndPenalties - 250000 worstcase 78.372 ms/op 141.87 ms/op 0.55
phase0 getAttestationDeltas - 250000 normalcase 6.1947 ms/op 19.168 ms/op 0.32
phase0 getAttestationDeltas - 250000 worstcase 5.9499 ms/op 18.380 ms/op 0.32
phase0 processSlashings - 250000 worstcase 94.538 us/op 151.19 us/op 0.63
altair processSyncCommitteeUpdates - 250000 144.65 ms/op 360.98 ms/op 0.40
BeaconState.hashTreeRoot - No change 809.00 ns/op 1.0510 us/op 0.77
BeaconState.hashTreeRoot - 1 full validator 144.28 us/op 272.93 us/op 0.53
BeaconState.hashTreeRoot - 32 full validator 1.2609 ms/op 2.6845 ms/op 0.47
BeaconState.hashTreeRoot - 512 full validator 15.456 ms/op 26.730 ms/op 0.58
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 163.18 us/op 277.42 us/op 0.59
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.9527 ms/op 3.9716 ms/op 0.49
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 29.122 ms/op 55.088 ms/op 0.53
BeaconState.hashTreeRoot - 1 balances 148.27 us/op 272.57 us/op 0.54
BeaconState.hashTreeRoot - 32 balances 1.5573 ms/op 2.0705 ms/op 0.75
BeaconState.hashTreeRoot - 512 balances 14.129 ms/op 15.385 ms/op 0.92
BeaconState.hashTreeRoot - 250000 balances 206.59 ms/op 300.66 ms/op 0.69
aggregationBits - 2048 els - zipIndexesInBitList 28.066 us/op 51.637 us/op 0.54
byteArrayEquals 32 63.202 ns/op 129.92 ns/op 0.49
Buffer.compare 32 35.416 ns/op 97.843 ns/op 0.36
byteArrayEquals 1024 1.8994 us/op 2.5461 us/op 0.75
Buffer.compare 1024 47.352 ns/op 107.50 ns/op 0.44
byteArrayEquals 16384 28.569 us/op 43.840 us/op 0.65
Buffer.compare 16384 211.11 ns/op 434.59 ns/op 0.49
byteArrayEquals 123687377 199.27 ms/op 333.89 ms/op 0.60
Buffer.compare 123687377 5.4331 ms/op 9.0505 ms/op 0.60
byteArrayEquals 32 - diff last byte 61.312 ns/op 137.83 ns/op 0.44
Buffer.compare 32 - diff last byte 38.891 ns/op 104.17 ns/op 0.37
byteArrayEquals 1024 - diff last byte 1.6742 us/op 3.2307 us/op 0.52
Buffer.compare 1024 - diff last byte 43.187 ns/op 99.016 ns/op 0.44
byteArrayEquals 16384 - diff last byte 28.125 us/op 40.872 us/op 0.69
Buffer.compare 16384 - diff last byte 215.08 ns/op 290.68 ns/op 0.74
byteArrayEquals 123687377 - diff last byte 215.71 ms/op 329.83 ms/op 0.65
Buffer.compare 123687377 - diff last byte 4.0838 ms/op 8.8040 ms/op 0.46
byteArrayEquals 32 - random bytes 4.4780 ns/op 7.0580 ns/op 0.63
Buffer.compare 32 - random bytes 33.978 ns/op 80.322 ns/op 0.42
byteArrayEquals 1024 - random bytes 4.3570 ns/op 8.0610 ns/op 0.54
Buffer.compare 1024 - random bytes 36.600 ns/op 99.319 ns/op 0.37
byteArrayEquals 16384 - random bytes 4.4030 ns/op 8.6240 ns/op 0.51
Buffer.compare 16384 - random bytes 36.022 ns/op 101.94 ns/op 0.35
byteArrayEquals 123687377 - random bytes 7.7500 ns/op 12.120 ns/op 0.64
Buffer.compare 123687377 - random bytes 40.600 ns/op 103.32 ns/op 0.39
regular array get 100000 times 40.614 us/op 72.116 us/op 0.56
wrappedArray get 100000 times 40.542 us/op 57.728 us/op 0.70
arrayWithProxy get 100000 times 9.6982 ms/op 18.671 ms/op 0.52
ssz.Root.equals 53.631 ns/op 81.232 ns/op 0.66
byteArrayEquals 53.060 ns/op 89.944 ns/op 0.59
Buffer.compare 9.6880 ns/op 18.338 ns/op 0.53
shuffle list - 16384 els 5.5408 ms/op 10.981 ms/op 0.50
shuffle list - 250000 els 81.084 ms/op 178.82 ms/op 0.45
processSlot - 1 slots 14.349 us/op 24.851 us/op 0.58
processSlot - 32 slots 3.7520 ms/op 5.3111 ms/op 0.71
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 52.718 ms/op 73.044 ms/op 0.72
getCommitteeAssignments - req 1 vs - 250000 vc 2.6708 ms/op 4.2270 ms/op 0.63
getCommitteeAssignments - req 100 vs - 250000 vc 3.7241 ms/op 5.2073 ms/op 0.72
getCommitteeAssignments - req 1000 vs - 250000 vc 4.0245 ms/op 6.3540 ms/op 0.63
findModifiedValidators - 10000 modified validators 335.82 ms/op 499.09 ms/op 0.67
findModifiedValidators - 1000 modified validators 168.63 ms/op 269.74 ms/op 0.63
findModifiedValidators - 100 modified validators 147.89 ms/op 231.46 ms/op 0.64
findModifiedValidators - 10 modified validators 148.27 ms/op 252.66 ms/op 0.59
findModifiedValidators - 1 modified validators 176.78 ms/op 278.10 ms/op 0.64
findModifiedValidators - no difference 226.02 ms/op 271.88 ms/op 0.83
compare ViewDUs 4.3620 s/op 5.7213 s/op 0.76
compare each validator Uint8Array 1.8521 s/op 2.1696 s/op 0.85
compare ViewDU to Uint8Array 1.1668 s/op 1.5887 s/op 0.73
migrate state 1000000 validators, 24 modified, 0 new 657.76 ms/op 984.51 ms/op 0.67
migrate state 1000000 validators, 1700 modified, 1000 new 1.0098 s/op 1.4267 s/op 0.71
migrate state 1000000 validators, 3400 modified, 2000 new 1.2062 s/op 1.4867 s/op 0.81
migrate state 1500000 validators, 24 modified, 0 new 763.52 ms/op 924.52 ms/op 0.83
migrate state 1500000 validators, 1700 modified, 1000 new 1.0385 s/op 1.2331 s/op 0.84
migrate state 1500000 validators, 3400 modified, 2000 new 1.0995 s/op 1.6931 s/op 0.65
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.5300 ns/op 5.8800 ns/op 0.77
state getBlockRootAtSlot - 250000 vs - 7PWei 794.45 ns/op 980.59 ns/op 0.81
computeProposers - vc 250000 7.0869 ms/op 14.842 ms/op 0.48
computeEpochShuffling - vc 250000 82.127 ms/op 248.15 ms/op 0.33
getNextSyncCommittee - vc 250000 112.32 ms/op 275.81 ms/op 0.41
computeSigningRoot for AttestationData 21.647 us/op 50.665 us/op 0.43
hash AttestationData serialized data then Buffer.toString(base64) 1.3127 us/op 3.6679 us/op 0.36
toHexString serialized data 811.32 ns/op 2.2941 us/op 0.35
Buffer.toString(base64) 165.80 ns/op 414.19 ns/op 0.40

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review April 17, 2024 09:10
@twoeths twoeths requested a review from a team as a code owner April 17, 2024 09:10
Copy link
Member

@matthewkeil matthewkeil left a comment

Choose a reason for hiding this comment

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

LGTM!! 🚀

Copy link
Member

@wemeetagain wemeetagain 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 eed85ed into unstable Apr 17, 2024
20 checks passed
@twoeths twoeths deleted the tuyen/fix_head_state_regen branch April 17, 2024 13:24
@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.

3 participants