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: resolve state id as checkpoint #6994

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Aug 1, 2024

Motivation

  • When state id is "justified" or "finalized", we need to resolve it to a checkpoint instead of the block root
    • for example, a finalized checkpoint at {root: block_root_31, epoch: 1} should not be the state at block 31, it's the state at block 31 dialed to the next epoch
  • Need to handle different types of state based on n-historicalStates flag

Description

  • resolve state id as checkpoint when it's "finalized" or "justified"
  • implement respective chain apis

part of #5968

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 62.49%. Comparing base (2f9275e) to head (4c0b706).
Report is 1 commits behind head on unstable.

Additional details and impacted files
@@            Coverage Diff            @@
##           unstable    #6994   +/-   ##
=========================================
  Coverage     62.49%   62.49%           
=========================================
  Files           576      576           
  Lines         61199    61199           
  Branches       2137     2142    +5     
=========================================
  Hits          38246    38246           
  Misses        22914    22914           
  Partials         39       39           

Copy link
Contributor

github-actions bot commented Aug 1, 2024

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: fc9a6bd Previous: 42af692 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 1.9405 ms/op 2.3474 ms/op 0.83
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 43.093 us/op 52.393 us/op 0.82
BLS verify - blst 852.86 us/op 1.4026 ms/op 0.61
BLS verifyMultipleSignatures 3 - blst 1.6053 ms/op 1.5308 ms/op 1.05
BLS verifyMultipleSignatures 8 - blst 2.0757 ms/op 2.0324 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst 4.3872 ms/op 6.7691 ms/op 0.65
BLS verifyMultipleSignatures 64 - blst 8.3068 ms/op 12.422 ms/op 0.67
BLS verifyMultipleSignatures 128 - blst 15.957 ms/op 20.296 ms/op 0.79
BLS deserializing 10000 signatures 625.53 ms/op 749.93 ms/op 0.83
BLS deserializing 100000 signatures 6.1653 s/op 7.0843 s/op 0.87
BLS verifyMultipleSignatures - same message - 3 - blst 946.89 us/op 921.74 us/op 1.03
BLS verifyMultipleSignatures - same message - 8 - blst 1.0562 ms/op 1.1458 ms/op 0.92
BLS verifyMultipleSignatures - same message - 32 - blst 1.6842 ms/op 1.8242 ms/op 0.92
BLS verifyMultipleSignatures - same message - 64 - blst 2.5655 ms/op 2.5115 ms/op 1.02
BLS verifyMultipleSignatures - same message - 128 - blst 4.1739 ms/op 4.2574 ms/op 0.98
BLS aggregatePubkeys 32 - blst 18.304 us/op 21.077 us/op 0.87
BLS aggregatePubkeys 128 - blst 61.599 us/op 71.386 us/op 0.86
notSeenSlots=1 numMissedVotes=1 numBadVotes=10 53.887 ms/op 84.149 ms/op 0.64
notSeenSlots=1 numMissedVotes=0 numBadVotes=4 49.344 ms/op 71.233 ms/op 0.69
notSeenSlots=2 numMissedVotes=1 numBadVotes=10 28.556 ms/op 50.245 ms/op 0.57
getSlashingsAndExits - default max 68.493 us/op 105.10 us/op 0.65
getSlashingsAndExits - 2k 260.04 us/op 363.07 us/op 0.72
proposeBlockBody type=full, size=empty 4.9287 ms/op 7.5239 ms/op 0.66
isKnown best case - 1 super set check 469.00 ns/op 586.00 ns/op 0.80
isKnown normal case - 2 super set checks 462.00 ns/op 609.00 ns/op 0.76
isKnown worse case - 16 super set checks 465.00 ns/op 607.00 ns/op 0.77
InMemoryCheckpointStateCache - add get delete 5.2920 us/op 6.5280 us/op 0.81
validate api signedAggregateAndProof - struct 1.5661 ms/op 1.9668 ms/op 0.80
validate gossip signedAggregateAndProof - struct 1.4510 ms/op 1.6802 ms/op 0.86
validate gossip attestation - vc 640000 981.90 us/op 1.1373 ms/op 0.86
batch validate gossip attestation - vc 640000 - chunk 32 122.26 us/op 140.42 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 64 105.12 us/op 120.91 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 128 96.777 us/op 111.35 us/op 0.87
batch validate gossip attestation - vc 640000 - chunk 256 97.283 us/op 107.65 us/op 0.90
pickEth1Vote - no votes 856.66 us/op 1.0206 ms/op 0.84
pickEth1Vote - max votes 7.4119 ms/op 8.3656 ms/op 0.89
pickEth1Vote - Eth1Data hashTreeRoot value x2048 14.424 ms/op 11.973 ms/op 1.20
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 19.895 ms/op 19.490 ms/op 1.02
pickEth1Vote - Eth1Data fastSerialize value x2048 340.90 us/op 480.36 us/op 0.71
pickEth1Vote - Eth1Data fastSerialize tree x2048 6.1879 ms/op 3.6932 ms/op 1.68
bytes32 toHexString 598.00 ns/op 450.00 ns/op 1.33
bytes32 Buffer.toString(hex) 441.00 ns/op 278.00 ns/op 1.59
bytes32 Buffer.toString(hex) from Uint8Array 536.00 ns/op 461.00 ns/op 1.16
bytes32 Buffer.toString(hex) + 0x 428.00 ns/op 270.00 ns/op 1.59
Object access 1 prop 0.30300 ns/op 0.15300 ns/op 1.98
Map access 1 prop 0.31400 ns/op 0.14200 ns/op 2.21
Object get x1000 4.8240 ns/op 6.1230 ns/op 0.79
Map get x1000 5.7940 ns/op 6.7250 ns/op 0.86
Object set x1000 22.295 ns/op 33.281 ns/op 0.67
Map set x1000 18.322 ns/op 24.796 ns/op 0.74
Return object 10000 times 0.28130 ns/op 0.29410 ns/op 0.96
Throw Error 10000 times 2.5629 us/op 3.5235 us/op 0.73
fastMsgIdFn sha256 / 200 bytes 1.9060 us/op 2.2180 us/op 0.86
fastMsgIdFn h32 xxhash / 200 bytes 383.00 ns/op 231.00 ns/op 1.66
fastMsgIdFn h64 xxhash / 200 bytes 453.00 ns/op 270.00 ns/op 1.68
fastMsgIdFn sha256 / 1000 bytes 5.5740 us/op 7.4190 us/op 0.75
fastMsgIdFn h32 xxhash / 1000 bytes 493.00 ns/op 375.00 ns/op 1.31
fastMsgIdFn h64 xxhash / 1000 bytes 499.00 ns/op 350.00 ns/op 1.43
fastMsgIdFn sha256 / 10000 bytes 47.403 us/op 65.725 us/op 0.72
fastMsgIdFn h32 xxhash / 10000 bytes 1.8100 us/op 1.9500 us/op 0.93
fastMsgIdFn h64 xxhash / 10000 bytes 1.2650 us/op 1.2630 us/op 1.00
send data - 1000 256B messages 9.7112 ms/op 13.206 ms/op 0.74
send data - 1000 512B messages 12.830 ms/op 17.560 ms/op 0.73
send data - 1000 1024B messages 20.472 ms/op 25.543 ms/op 0.80
send data - 1000 1200B messages 23.681 ms/op 27.962 ms/op 0.85
send data - 1000 2048B messages 28.939 ms/op 34.855 ms/op 0.83
send data - 1000 4096B messages 26.863 ms/op 32.248 ms/op 0.83
send data - 1000 16384B messages 65.176 ms/op 72.367 ms/op 0.90
send data - 1000 65536B messages 245.55 ms/op 216.48 ms/op 1.13
enrSubnets - fastDeserialize 64 bits 1.1160 us/op 1.4690 us/op 0.76
enrSubnets - ssz BitVector 64 bits 495.00 ns/op 455.00 ns/op 1.09
enrSubnets - fastDeserialize 4 bits 310.00 ns/op 180.00 ns/op 1.72
enrSubnets - ssz BitVector 4 bits 499.00 ns/op 409.00 ns/op 1.22
prioritizePeers score -10:0 att 32-0.1 sync 2-0 121.61 us/op 176.11 us/op 0.69
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 174.66 us/op 187.72 us/op 0.93
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 222.83 us/op 258.82 us/op 0.86
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 443.73 us/op 494.98 us/op 0.90
prioritizePeers score 0:0 att 64-1 sync 4-1 668.89 us/op 793.66 us/op 0.84
array of 16000 items push then shift 1.2601 us/op 1.7206 us/op 0.73
LinkedList of 16000 items push then shift 7.2790 ns/op 7.4030 ns/op 0.98
array of 16000 items push then pop 85.652 ns/op 131.91 ns/op 0.65
LinkedList of 16000 items push then pop 6.3100 ns/op 7.5000 ns/op 0.84
array of 24000 items push then shift 1.8499 us/op 2.5220 us/op 0.73
LinkedList of 24000 items push then shift 6.4020 ns/op 7.6280 ns/op 0.84
array of 24000 items push then pop 110.06 ns/op 178.35 ns/op 0.62
LinkedList of 24000 items push then pop 6.2890 ns/op 7.3390 ns/op 0.86
intersect bitArray bitLen 8 5.3080 ns/op 6.6670 ns/op 0.80
intersect array and set length 8 41.109 ns/op 47.851 ns/op 0.86
intersect bitArray bitLen 128 26.050 ns/op 31.102 ns/op 0.84
intersect array and set length 128 577.60 ns/op 702.80 ns/op 0.82
bitArray.getTrueBitIndexes() bitLen 128 2.4550 us/op 2.2080 us/op 1.11
bitArray.getTrueBitIndexes() bitLen 248 3.7940 us/op 3.4250 us/op 1.11
bitArray.getTrueBitIndexes() bitLen 512 6.7020 us/op 8.5160 us/op 0.79
Buffer.concat 32 items 1.0240 us/op 1.0130 us/op 1.01
Uint8Array.set 32 items 1.8300 us/op 1.7080 us/op 1.07
Buffer.copy 2.0600 us/op 1.8120 us/op 1.14
Uint8Array.set - with subarray 2.8380 us/op 2.8390 us/op 1.00
Uint8Array.set - without subarray 1.9260 us/op 1.7890 us/op 1.08
getUint32 - dataview 389.00 ns/op 260.00 ns/op 1.50
getUint32 - manual 329.00 ns/op 174.00 ns/op 1.89
Set add up to 64 items then delete first 1.8506 us/op 2.2585 us/op 0.82
OrderedSet add up to 64 items then delete first 2.8945 us/op 3.3780 us/op 0.86
Set add up to 64 items then delete last 2.0638 us/op 2.6557 us/op 0.78
OrderedSet add up to 64 items then delete last 3.0594 us/op 4.0242 us/op 0.76
Set add up to 64 items then delete middle 2.0875 us/op 2.6208 us/op 0.80
OrderedSet add up to 64 items then delete middle 4.4716 us/op 5.3505 us/op 0.84
Set add up to 128 items then delete first 4.0714 us/op 5.1427 us/op 0.79
OrderedSet add up to 128 items then delete first 6.3830 us/op 7.5641 us/op 0.84
Set add up to 128 items then delete last 3.8947 us/op 5.1160 us/op 0.76
OrderedSet add up to 128 items then delete last 5.9366 us/op 7.8330 us/op 0.76
Set add up to 128 items then delete middle 3.9148 us/op 4.9549 us/op 0.79
OrderedSet add up to 128 items then delete middle 11.624 us/op 14.612 us/op 0.80
Set add up to 256 items then delete first 7.9413 us/op 10.657 us/op 0.75
OrderedSet add up to 256 items then delete first 12.671 us/op 15.474 us/op 0.82
Set add up to 256 items then delete last 7.7475 us/op 10.441 us/op 0.74
OrderedSet add up to 256 items then delete last 12.051 us/op 15.717 us/op 0.77
Set add up to 256 items then delete middle 7.7339 us/op 10.249 us/op 0.75
OrderedSet add up to 256 items then delete middle 34.644 us/op 41.804 us/op 0.83
transfer serialized Status (84 B) 1.3710 us/op 1.5330 us/op 0.89
copy serialized Status (84 B) 1.1250 us/op 1.3220 us/op 0.85
transfer serialized SignedVoluntaryExit (112 B) 1.4200 us/op 1.5100 us/op 0.94
copy serialized SignedVoluntaryExit (112 B) 1.1460 us/op 1.2190 us/op 0.94
transfer serialized ProposerSlashing (416 B) 1.5940 us/op 1.5850 us/op 1.01
copy serialized ProposerSlashing (416 B) 1.3210 us/op 1.7910 us/op 0.74
transfer serialized Attestation (485 B) 1.5990 us/op 2.3080 us/op 0.69
copy serialized Attestation (485 B) 1.3560 us/op 2.0910 us/op 0.65
transfer serialized AttesterSlashing (33232 B) 1.7770 us/op 1.7820 us/op 1.00
copy serialized AttesterSlashing (33232 B) 4.7600 us/op 6.6230 us/op 0.72
transfer serialized Small SignedBeaconBlock (128000 B) 2.4880 us/op 2.5700 us/op 0.97
copy serialized Small SignedBeaconBlock (128000 B) 14.034 us/op 20.669 us/op 0.68
transfer serialized Avg SignedBeaconBlock (200000 B) 2.7910 us/op 3.2230 us/op 0.87
copy serialized Avg SignedBeaconBlock (200000 B) 21.048 us/op 27.794 us/op 0.76
transfer serialized BlobsSidecar (524380 B) 2.7800 us/op 3.3450 us/op 0.83
copy serialized BlobsSidecar (524380 B) 175.63 us/op 82.259 us/op 2.14
transfer serialized Big SignedBeaconBlock (1000000 B) 2.8530 us/op 3.3280 us/op 0.86
copy serialized Big SignedBeaconBlock (1000000 B) 134.40 us/op 174.34 us/op 0.77
pass gossip attestations to forkchoice per slot 2.7368 ms/op 3.4646 ms/op 0.79
forkChoice updateHead vc 100000 bc 64 eq 0 401.40 us/op 653.93 us/op 0.61
forkChoice updateHead vc 600000 bc 64 eq 0 2.6606 ms/op 3.7951 ms/op 0.70
forkChoice updateHead vc 1000000 bc 64 eq 0 4.2542 ms/op 6.5293 ms/op 0.65
forkChoice updateHead vc 600000 bc 320 eq 0 2.5605 ms/op 3.3919 ms/op 0.75
forkChoice updateHead vc 600000 bc 1200 eq 0 2.5884 ms/op 3.3556 ms/op 0.77
forkChoice updateHead vc 600000 bc 7200 eq 0 3.0831 ms/op 5.1566 ms/op 0.60
forkChoice updateHead vc 600000 bc 64 eq 1000 9.3693 ms/op 11.756 ms/op 0.80
forkChoice updateHead vc 600000 bc 64 eq 10000 9.3433 ms/op 12.740 ms/op 0.73
forkChoice updateHead vc 600000 bc 64 eq 300000 11.675 ms/op 16.545 ms/op 0.71
computeDeltas 500000 validators 300 proto nodes 3.0715 ms/op 4.1842 ms/op 0.73
computeDeltas 500000 validators 1200 proto nodes 2.9836 ms/op 4.3095 ms/op 0.69
computeDeltas 500000 validators 7200 proto nodes 3.0609 ms/op 4.0806 ms/op 0.75
computeDeltas 750000 validators 300 proto nodes 4.5938 ms/op 5.7188 ms/op 0.80
computeDeltas 750000 validators 1200 proto nodes 4.3759 ms/op 5.8281 ms/op 0.75
computeDeltas 750000 validators 7200 proto nodes 4.4999 ms/op 6.2052 ms/op 0.73
computeDeltas 1400000 validators 300 proto nodes 8.3244 ms/op 11.131 ms/op 0.75
computeDeltas 1400000 validators 1200 proto nodes 8.2712 ms/op 11.489 ms/op 0.72
computeDeltas 1400000 validators 7200 proto nodes 8.2520 ms/op 11.110 ms/op 0.74
computeDeltas 2100000 validators 300 proto nodes 12.137 ms/op 17.446 ms/op 0.70
computeDeltas 2100000 validators 1200 proto nodes 12.392 ms/op 17.077 ms/op 0.73
computeDeltas 2100000 validators 7200 proto nodes 12.584 ms/op 17.686 ms/op 0.71
altair processAttestation - 250000 vs - 7PWei normalcase 1.3568 ms/op 2.2936 ms/op 0.59
altair processAttestation - 250000 vs - 7PWei worstcase 2.1889 ms/op 2.8880 ms/op 0.76
altair processAttestation - setStatus - 1/6 committees join 70.860 us/op 103.85 us/op 0.68
altair processAttestation - setStatus - 1/3 committees join 133.95 us/op 204.15 us/op 0.66
altair processAttestation - setStatus - 1/2 committees join 199.99 us/op 267.14 us/op 0.75
altair processAttestation - setStatus - 2/3 committees join 261.02 us/op 361.78 us/op 0.72
altair processAttestation - setStatus - 4/5 committees join 399.25 us/op 541.56 us/op 0.74
altair processAttestation - setStatus - 100% committees join 468.73 us/op 652.58 us/op 0.72
altair processBlock - 250000 vs - 7PWei normalcase 3.7931 ms/op 5.1057 ms/op 0.74
altair processBlock - 250000 vs - 7PWei normalcase hashState 23.735 ms/op 27.529 ms/op 0.86
altair processBlock - 250000 vs - 7PWei worstcase 33.901 ms/op 42.934 ms/op 0.79
altair processBlock - 250000 vs - 7PWei worstcase hashState 81.647 ms/op 80.152 ms/op 1.02
phase0 processBlock - 250000 vs - 7PWei normalcase 1.9838 ms/op 2.9595 ms/op 0.67
phase0 processBlock - 250000 vs - 7PWei worstcase 22.818 ms/op 28.804 ms/op 0.79
altair processEth1Data - 250000 vs - 7PWei normalcase 259.30 us/op 330.27 us/op 0.79
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 7.5390 us/op 7.7840 us/op 0.97
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 17.187 us/op 23.250 us/op 0.74
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 8.3670 us/op 8.8200 us/op 0.95
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 7.3530 us/op 5.4020 us/op 1.36
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 81.728 us/op 122.47 us/op 0.67
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 618.24 us/op 709.91 us/op 0.87
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 695.28 us/op 1.2726 ms/op 0.55
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 1.0941 ms/op 1.4731 ms/op 0.74
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 2.1806 ms/op 2.7460 ms/op 0.79
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 1.1628 ms/op 2.4570 ms/op 0.47
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 3.1683 ms/op 3.7750 ms/op 0.84
Tree 40 250000 create 216.90 ms/op 214.83 ms/op 1.01
Tree 40 250000 get(125000) 119.11 ns/op 147.35 ns/op 0.81
Tree 40 250000 set(125000) 594.11 ns/op 638.34 ns/op 0.93
Tree 40 250000 toArray() 12.790 ms/op 17.340 ms/op 0.74
Tree 40 250000 iterate all - toArray() + loop 11.586 ms/op 17.182 ms/op 0.67
Tree 40 250000 iterate all - get(i) 43.817 ms/op 52.504 ms/op 0.83
MutableVector 250000 create 10.915 ms/op 10.815 ms/op 1.01
MutableVector 250000 get(125000) 5.8300 ns/op 6.7790 ns/op 0.86
MutableVector 250000 set(125000) 176.26 ns/op 183.32 ns/op 0.96
MutableVector 250000 toArray() 2.6523 ms/op 3.3026 ms/op 0.80
MutableVector 250000 iterate all - toArray() + loop 2.7626 ms/op 3.4067 ms/op 0.81
MutableVector 250000 iterate all - get(i) 1.4076 ms/op 1.5456 ms/op 0.91
Array 250000 create 2.4440 ms/op 2.9065 ms/op 0.84
Array 250000 clone - spread 1.2907 ms/op 1.3177 ms/op 0.98
Array 250000 get(125000) 0.57800 ns/op 0.40500 ns/op 1.43
Array 250000 set(125000) 0.58300 ns/op 0.42900 ns/op 1.36
Array 250000 iterate all - loop 76.560 us/op 91.020 us/op 0.84
effectiveBalanceIncrements clone Uint8Array 300000 14.113 us/op 27.830 us/op 0.51
effectiveBalanceIncrements clone MutableVector 300000 313.00 ns/op 123.00 ns/op 2.54
effectiveBalanceIncrements rw all Uint8Array 300000 166.92 us/op 200.01 us/op 0.83
effectiveBalanceIncrements rw all MutableVector 300000 58.619 ms/op 60.339 ms/op 0.97
phase0 afterProcessEpoch - 250000 vs - 7PWei 75.915 ms/op 87.862 ms/op 0.86
Array.fill - length 1000000 2.5841 ms/op 3.4399 ms/op 0.75
Array push - length 1000000 9.3404 ms/op 22.563 ms/op 0.41
Array.get 0.26408 ns/op 0.27748 ns/op 0.95
Uint8Array.get 0.34323 ns/op 0.43480 ns/op 0.79
phase0 beforeProcessEpoch - 250000 vs - 7PWei 18.076 ms/op 21.409 ms/op 0.84
altair processEpoch - mainnet_e81889 330.76 ms/op 348.30 ms/op 0.95
mainnet_e81889 - altair beforeProcessEpoch 26.259 ms/op 28.934 ms/op 0.91
mainnet_e81889 - altair processJustificationAndFinalization 10.924 us/op 17.214 us/op 0.63
mainnet_e81889 - altair processInactivityUpdates 4.4968 ms/op 6.2904 ms/op 0.71
mainnet_e81889 - altair processRewardsAndPenalties 52.465 ms/op 57.680 ms/op 0.91
mainnet_e81889 - altair processRegistryUpdates 2.3510 us/op 2.8890 us/op 0.81
mainnet_e81889 - altair processSlashings 803.00 ns/op 605.00 ns/op 1.33
mainnet_e81889 - altair processEth1DataReset 819.00 ns/op 445.00 ns/op 1.84
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.4412 ms/op 2.5017 ms/op 0.58
mainnet_e81889 - altair processSlashingsReset 3.8010 us/op 4.6780 us/op 0.81
mainnet_e81889 - altair processRandaoMixesReset 4.1020 us/op 5.3970 us/op 0.76
mainnet_e81889 - altair processHistoricalRootsUpdate 898.00 ns/op 478.00 ns/op 1.88
mainnet_e81889 - altair processParticipationFlagUpdates 3.0120 us/op 2.5520 us/op 1.18
mainnet_e81889 - altair processSyncCommitteeUpdates 877.00 ns/op 499.00 ns/op 1.76
mainnet_e81889 - altair afterProcessEpoch 82.275 ms/op 95.986 ms/op 0.86
capella processEpoch - mainnet_e217614 1.3436 s/op 1.4730 s/op 0.91
mainnet_e217614 - capella beforeProcessEpoch 109.34 ms/op 112.29 ms/op 0.97
mainnet_e217614 - capella processJustificationAndFinalization 16.221 us/op 20.552 us/op 0.79
mainnet_e217614 - capella processInactivityUpdates 16.171 ms/op 18.781 ms/op 0.86
mainnet_e217614 - capella processRewardsAndPenalties 254.27 ms/op 264.17 ms/op 0.96
mainnet_e217614 - capella processRegistryUpdates 12.562 us/op 14.085 us/op 0.89
mainnet_e217614 - capella processSlashings 728.00 ns/op 491.00 ns/op 1.48
mainnet_e217614 - capella processEth1DataReset 642.00 ns/op 481.00 ns/op 1.33
mainnet_e217614 - capella processEffectiveBalanceUpdates 13.797 ms/op 8.2658 ms/op 1.67
mainnet_e217614 - capella processSlashingsReset 1.4650 us/op 4.9260 us/op 0.30
mainnet_e217614 - capella processRandaoMixesReset 2.6140 us/op 11.316 us/op 0.23
mainnet_e217614 - capella processHistoricalRootsUpdate 726.00 ns/op 1.0190 us/op 0.71
mainnet_e217614 - capella processParticipationFlagUpdates 5.5750 us/op 2.7090 us/op 2.06
mainnet_e217614 - capella afterProcessEpoch 246.48 ms/op 308.00 ms/op 0.80
phase0 processEpoch - mainnet_e58758 377.22 ms/op 507.08 ms/op 0.74
mainnet_e58758 - phase0 beforeProcessEpoch 75.226 ms/op 119.40 ms/op 0.63
mainnet_e58758 - phase0 processJustificationAndFinalization 12.570 us/op 36.265 us/op 0.35
mainnet_e58758 - phase0 processRewardsAndPenalties 26.860 ms/op 37.605 ms/op 0.71
mainnet_e58758 - phase0 processRegistryUpdates 6.5830 us/op 12.849 us/op 0.51
mainnet_e58758 - phase0 processSlashings 832.00 ns/op 603.00 ns/op 1.38
mainnet_e58758 - phase0 processEth1DataReset 668.00 ns/op 556.00 ns/op 1.20
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.1624 ms/op 1.4158 ms/op 0.82
mainnet_e58758 - phase0 processSlashingsReset 3.5420 us/op 3.5340 us/op 1.00
mainnet_e58758 - phase0 processRandaoMixesReset 3.7740 us/op 4.0600 us/op 0.93
mainnet_e58758 - phase0 processHistoricalRootsUpdate 663.00 ns/op 354.00 ns/op 1.87
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.0880 us/op 4.2150 us/op 0.73
mainnet_e58758 - phase0 afterProcessEpoch 67.321 ms/op 88.266 ms/op 0.76
phase0 processEffectiveBalanceUpdates - 250000 normalcase 764.95 us/op 1.5230 ms/op 0.50
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.0762 ms/op 2.1332 ms/op 0.50
altair processInactivityUpdates - 250000 normalcase 15.804 ms/op 19.576 ms/op 0.81
altair processInactivityUpdates - 250000 worstcase 16.579 ms/op 18.901 ms/op 0.88
phase0 processRegistryUpdates - 250000 normalcase 4.8340 us/op 9.1320 us/op 0.53
phase0 processRegistryUpdates - 250000 badcase_full_deposits 305.84 us/op 364.18 us/op 0.84
phase0 processRegistryUpdates - 250000 worstcase 0.5 116.50 ms/op 124.43 ms/op 0.94
altair processRewardsAndPenalties - 250000 normalcase 46.195 ms/op 43.576 ms/op 1.06
altair processRewardsAndPenalties - 250000 worstcase 51.440 ms/op 47.142 ms/op 1.09
phase0 getAttestationDeltas - 250000 normalcase 5.6381 ms/op 7.8769 ms/op 0.72
phase0 getAttestationDeltas - 250000 worstcase 5.6444 ms/op 8.3871 ms/op 0.67
phase0 processSlashings - 250000 worstcase 80.058 us/op 93.215 us/op 0.86
altair processSyncCommitteeUpdates - 250000 97.575 ms/op 131.57 ms/op 0.74
BeaconState.hashTreeRoot - No change 438.00 ns/op 332.00 ns/op 1.32
BeaconState.hashTreeRoot - 1 full validator 113.05 us/op 103.93 us/op 1.09
BeaconState.hashTreeRoot - 32 full validator 1.2236 ms/op 857.84 us/op 1.43
BeaconState.hashTreeRoot - 512 full validator 11.013 ms/op 8.7488 ms/op 1.26
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 152.73 us/op 115.89 us/op 1.32
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.7998 ms/op 1.3540 ms/op 1.33
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 21.874 ms/op 19.410 ms/op 1.13
BeaconState.hashTreeRoot - 1 balances 127.73 us/op 78.070 us/op 1.64
BeaconState.hashTreeRoot - 32 balances 1.3028 ms/op 772.92 us/op 1.69
BeaconState.hashTreeRoot - 512 balances 12.013 ms/op 7.0051 ms/op 1.71
BeaconState.hashTreeRoot - 250000 balances 165.74 ms/op 153.60 ms/op 1.08
aggregationBits - 2048 els - zipIndexesInBitList 19.300 us/op 24.118 us/op 0.80
byteArrayEquals 32 47.663 ns/op 53.843 ns/op 0.89
Buffer.compare 32 16.746 ns/op 17.783 ns/op 0.94
byteArrayEquals 1024 1.2557 us/op 1.6095 us/op 0.78
Buffer.compare 1024 31.420 ns/op 25.188 ns/op 1.25
byteArrayEquals 16384 19.974 us/op 25.302 us/op 0.79
Buffer.compare 16384 174.69 ns/op 202.24 ns/op 0.86
byteArrayEquals 123687377 149.28 ms/op 203.49 ms/op 0.73
Buffer.compare 123687377 4.1500 ms/op 7.0894 ms/op 0.59
byteArrayEquals 32 - diff last byte 46.083 ns/op 53.647 ns/op 0.86
Buffer.compare 32 - diff last byte 16.308 ns/op 17.545 ns/op 0.93
byteArrayEquals 1024 - diff last byte 1.2464 us/op 1.6195 us/op 0.77
Buffer.compare 1024 - diff last byte 31.366 ns/op 25.946 ns/op 1.21
byteArrayEquals 16384 - diff last byte 19.827 us/op 25.722 us/op 0.77
Buffer.compare 16384 - diff last byte 198.23 ns/op 206.06 ns/op 0.96
byteArrayEquals 123687377 - diff last byte 152.36 ms/op 196.43 ms/op 0.78
Buffer.compare 123687377 - diff last byte 5.3298 ms/op 7.4230 ms/op 0.72
byteArrayEquals 32 - random bytes 4.8050 ns/op 5.5130 ns/op 0.87
Buffer.compare 32 - random bytes 16.237 ns/op 18.080 ns/op 0.90
byteArrayEquals 1024 - random bytes 4.8750 ns/op 5.3980 ns/op 0.90
Buffer.compare 1024 - random bytes 16.191 ns/op 18.013 ns/op 0.90
byteArrayEquals 16384 - random bytes 4.7540 ns/op 5.4160 ns/op 0.88
Buffer.compare 16384 - random bytes 16.161 ns/op 18.156 ns/op 0.89
byteArrayEquals 123687377 - random bytes 7.8400 ns/op 6.8600 ns/op 1.14
Buffer.compare 123687377 - random bytes 19.570 ns/op 19.150 ns/op 1.02
regular array get 100000 times 30.728 us/op 45.311 us/op 0.68
wrappedArray get 100000 times 30.832 us/op 39.131 us/op 0.79
arrayWithProxy get 100000 times 9.8339 ms/op 14.139 ms/op 0.70
ssz.Root.equals 39.116 ns/op 47.853 ns/op 0.82
byteArrayEquals 42.801 ns/op 47.223 ns/op 0.91
Buffer.compare 9.1210 ns/op 10.840 ns/op 0.84
shuffle list - 16384 els 5.9406 ms/op 6.3639 ms/op 0.93
shuffle list - 250000 els 85.626 ms/op 97.067 ms/op 0.88
processSlot - 1 slots 15.932 us/op 14.296 us/op 1.11
processSlot - 32 slots 3.6561 ms/op 2.8610 ms/op 1.28
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.660 ms/op 38.787 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 1.7978 ms/op 2.1821 ms/op 0.82
getCommitteeAssignments - req 100 vs - 250000 vc 3.5190 ms/op 4.3019 ms/op 0.82
getCommitteeAssignments - req 1000 vs - 250000 vc 3.7621 ms/op 4.7134 ms/op 0.80
findModifiedValidators - 10000 modified validators 247.60 ms/op 302.26 ms/op 0.82
findModifiedValidators - 1000 modified validators 149.41 ms/op 204.60 ms/op 0.73
findModifiedValidators - 100 modified validators 149.57 ms/op 204.92 ms/op 0.73
findModifiedValidators - 10 modified validators 149.45 ms/op 182.10 ms/op 0.82
findModifiedValidators - 1 modified validators 135.44 ms/op 169.47 ms/op 0.80
findModifiedValidators - no difference 150.72 ms/op 208.92 ms/op 0.72
compare ViewDUs 2.8324 s/op 3.6014 s/op 0.79
compare each validator Uint8Array 1.3585 s/op 1.2448 s/op 1.09
compare ViewDU to Uint8Array 660.20 ms/op 1.2078 s/op 0.55
migrate state 1000000 validators, 24 modified, 0 new 543.97 ms/op 646.72 ms/op 0.84
migrate state 1000000 validators, 1700 modified, 1000 new 680.38 ms/op 856.40 ms/op 0.79
migrate state 1000000 validators, 3400 modified, 2000 new 882.85 ms/op 973.32 ms/op 0.91
migrate state 1500000 validators, 24 modified, 0 new 527.94 ms/op 643.10 ms/op 0.82
migrate state 1500000 validators, 1700 modified, 1000 new 708.90 ms/op 1.1579 s/op 0.61
migrate state 1500000 validators, 3400 modified, 2000 new 1.0216 s/op 1.3841 s/op 0.74
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 6.5300 ns/op 5.7500 ns/op 1.14
state getBlockRootAtSlot - 250000 vs - 7PWei 599.57 ns/op 704.56 ns/op 0.85
computeProposers - vc 250000 7.6628 ms/op 8.9420 ms/op 0.86
computeEpochShuffling - vc 250000 83.661 ms/op 111.34 ms/op 0.75
getNextSyncCommittee - vc 250000 91.203 ms/op 159.30 ms/op 0.57
computeSigningRoot for AttestationData 15.052 us/op 24.495 us/op 0.61
hash AttestationData serialized data then Buffer.toString(base64) 1.1997 us/op 1.8631 us/op 0.64
toHexString serialized data 778.46 ns/op 1.2931 us/op 0.60
Buffer.toString(base64) 150.46 ns/op 248.91 ns/op 0.60

by benchmarkbot/action

@twoeths twoeths marked this pull request as ready for review August 1, 2024 12:26
@twoeths twoeths requested a review from a team as a code owner August 1, 2024 12:26
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, fix seems sound

@wemeetagain wemeetagain merged commit c5c91f4 into unstable Aug 1, 2024
21 checks passed
@wemeetagain wemeetagain deleted the te/state_id_check_point branch August 1, 2024 17:17
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.21.0 🎉

philknows pushed a commit that referenced this pull request Sep 3, 2024
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.

2 participants