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

refactor: move state getter from API impl to chain #5572

Merged
merged 5 commits into from
May 31, 2023

Conversation

dapplion
Copy link
Contributor

@dapplion dapplion commented May 29, 2023

Motivation

Regenerating states is a very sensitive part of the become node. Currently there's a code path buried deep in /api/impl/utils that can take significant resources from API queries. We want to have a tight control over what and when is reading states from disk and calling regen.

For the reason the api impl should only be concerned in understanding the request of the API consumer and querying the chain class for a state.

Description

Expose two need methods in BeaconChain class to be called from API code

  /** Returns a local state cannonical at `slot` */
  getStateBySlot(
    slot: Slot,
    opts?: StateGetOpts
  ): Promise<{state: BeaconStateAllForks; executionOptimistic: boolean} | null>;
  /** Returns a local state by state root */
  getStateByStateRoot(
    stateRoot: RootHex,
    opts?: StateGetOpts
  ): Promise<{state: BeaconStateAllForks; executionOptimistic: boolean} | null>;

Replace the custom code reading from state cache, db and running potentially unbounded state transitions with calls to regen. This PR surfaces the shortcomings of our API capability to return data at arbitrary states. However those shortcomings do not impact stakers at all and should be handled properly in another PR.

Closes #2491
Closes #3683

@dapplion dapplion requested a review from a team as a code owner May 29, 2023 18:20
@github-actions
Copy link
Contributor

github-actions bot commented May 29, 2023

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: d3efe3c Previous: cef8562 Ratio
phase0 getAttestationDeltas - 250000 worstcase 26.903 ms/op 7.3780 ms/op 3.65
phase0 processSlashings - 250000 worstcase 15.117 ms/op 3.5296 ms/op 4.28
altair processSyncCommitteeUpdates - 250000 666.72 ms/op 188.86 ms/op 3.53
BeaconState.hashTreeRoot - No change 1.9800 us/op 423.00 ns/op 4.68
BeaconState.hashTreeRoot - 512 full validator 25.811 ms/op 6.0889 ms/op 4.24
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 42.849 ms/op 12.788 ms/op 3.35
BeaconState.hashTreeRoot - 512 balances 17.194 ms/op 4.6234 ms/op 3.72
BeaconState.hashTreeRoot - 250000 balances 307.36 ms/op 78.717 ms/op 3.90
regular array get 100000 times 129.17 us/op 34.297 us/op 3.77
wrappedArray get 100000 times 169.02 us/op 40.857 us/op 4.14
arrayWithProxy get 100000 times 57.803 ms/op 18.394 ms/op 3.14
shuffle list - 16384 els 27.760 ms/op 7.2747 ms/op 3.82
shuffle list - 250000 els 402.06 ms/op 102.94 ms/op 3.91
getCommitteeAssignments - req 1000 vs - 250000 vc 15.806 ms/op 4.5020 ms/op 3.51
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 17.630 ns/op 4.7600 ns/op 3.70
computeProposers - vc 250000 50.265 ms/op 10.895 ms/op 4.61
computeEpochShuffling - vc 250000 395.24 ms/op 103.74 ms/op 3.81
getNextSyncCommittee - vc 250000 764.00 ms/op 184.93 ms/op 4.13
computeSigningRoot for AttestationData 53.822 us/op 13.341 us/op 4.03
hash AttestationData serialized data then Buffer.toString(base64) 9.6260 us/op 2.4449 us/op 3.94
toHexString serialized data 5.0867 us/op 1.1197 us/op 4.54
Buffer.toString(base64) 1.3326 us/op 344.07 ns/op 3.87
Full benchmark results
Benchmark suite Current: d3efe3c Previous: cef8562 Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 944.39 us/op 695.66 us/op 1.36
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 74.737 us/op 68.981 us/op 1.08
BLS verify - blst-native 2.0048 ms/op 1.2605 ms/op 1.59
BLS verifyMultipleSignatures 3 - blst-native 4.2897 ms/op 2.5793 ms/op 1.66
BLS verifyMultipleSignatures 8 - blst-native 6.6724 ms/op 6.5128 ms/op 1.02
BLS verifyMultipleSignatures 32 - blst-native 29.617 ms/op 20.195 ms/op 1.47
BLS aggregatePubkeys 32 - blst-native 36.060 us/op 27.639 us/op 1.30
BLS aggregatePubkeys 128 - blst-native 175.38 us/op 106.41 us/op 1.65
getAttestationsForBlock 91.290 ms/op 91.922 ms/op 0.99
isKnown best case - 1 super set check 484.00 ns/op 290.00 ns/op 1.67
isKnown normal case - 2 super set checks 423.00 ns/op 264.00 ns/op 1.60
isKnown worse case - 16 super set checks 395.00 ns/op 319.00 ns/op 1.24
CheckpointStateCache - add get delete 8.0380 us/op 6.3810 us/op 1.26
validate gossip signedAggregateAndProof - struct 3.6120 ms/op 3.3195 ms/op 1.09
validate gossip attestation - struct 1.6896 ms/op 1.3789 ms/op 1.23
pickEth1Vote - no votes 1.6763 ms/op 1.7017 ms/op 0.99
pickEth1Vote - max votes 15.562 ms/op 26.095 ms/op 0.60
pickEth1Vote - Eth1Data hashTreeRoot value x2048 15.167 ms/op 12.163 ms/op 1.25
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 22.596 ms/op 19.987 ms/op 1.13
pickEth1Vote - Eth1Data fastSerialize value x2048 1.1535 ms/op 909.49 us/op 1.27
pickEth1Vote - Eth1Data fastSerialize tree x2048 7.2389 ms/op 11.234 ms/op 0.64
bytes32 toHexString 973.00 ns/op 1.0100 us/op 0.96
bytes32 Buffer.toString(hex) 609.00 ns/op 627.00 ns/op 0.97
bytes32 Buffer.toString(hex) from Uint8Array 854.00 ns/op 944.00 ns/op 0.90
bytes32 Buffer.toString(hex) + 0x 635.00 ns/op 726.00 ns/op 0.87
Object access 1 prop 0.32200 ns/op 0.27100 ns/op 1.19
Map access 1 prop 0.25200 ns/op 0.22700 ns/op 1.11
Object get x1000 11.159 ns/op 10.052 ns/op 1.11
Map get x1000 0.98000 ns/op 0.80500 ns/op 1.22
Object set x1000 105.31 ns/op 118.03 ns/op 0.89
Map set x1000 86.113 ns/op 84.302 ns/op 1.02
Return object 10000 times 0.42250 ns/op 0.53250 ns/op 0.79
Throw Error 10000 times 7.6020 us/op 6.0211 us/op 1.26
fastMsgIdFn sha256 / 200 bytes 5.2620 us/op 4.1840 us/op 1.26
fastMsgIdFn h32 xxhash / 200 bytes 462.00 ns/op 413.00 ns/op 1.12
fastMsgIdFn h64 xxhash / 200 bytes 708.00 ns/op 608.00 ns/op 1.16
fastMsgIdFn sha256 / 1000 bytes 21.010 us/op 13.375 us/op 1.57
fastMsgIdFn h32 xxhash / 1000 bytes 684.00 ns/op 472.00 ns/op 1.45
fastMsgIdFn h64 xxhash / 1000 bytes 835.00 ns/op 605.00 ns/op 1.38
fastMsgIdFn sha256 / 10000 bytes 205.23 us/op 107.76 us/op 1.90
fastMsgIdFn h32 xxhash / 10000 bytes 3.3940 us/op 2.1040 us/op 1.61
fastMsgIdFn h64 xxhash / 10000 bytes 2.3330 us/op 1.5880 us/op 1.47
enrSubnets - fastDeserialize 64 bits 2.4620 us/op 2.1870 us/op 1.13
enrSubnets - ssz BitVector 64 bits 820.00 ns/op 699.00 ns/op 1.17
enrSubnets - fastDeserialize 4 bits 337.00 ns/op 222.00 ns/op 1.52
enrSubnets - ssz BitVector 4 bits 844.00 ns/op 673.00 ns/op 1.25
prioritizePeers score -10:0 att 32-0.1 sync 2-0 226.16 us/op 169.89 us/op 1.33
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 285.42 us/op 196.62 us/op 1.45
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 329.51 us/op 240.00 us/op 1.37
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 617.01 us/op 477.74 us/op 1.29
prioritizePeers score 0:0 att 64-1 sync 4-1 744.37 us/op 474.62 us/op 1.57
array of 16000 items push then shift 2.7951 us/op 1.8015 us/op 1.55
LinkedList of 16000 items push then shift 15.662 ns/op 10.529 ns/op 1.49
array of 16000 items push then pop 183.03 ns/op 120.09 ns/op 1.52
LinkedList of 16000 items push then pop 14.884 ns/op 9.4210 ns/op 1.58
array of 24000 items push then shift 4.8349 us/op 2.4618 us/op 1.96
LinkedList of 24000 items push then shift 20.533 ns/op 11.580 ns/op 1.77
array of 24000 items push then pop 162.29 ns/op 117.01 ns/op 1.39
LinkedList of 24000 items push then pop 17.981 ns/op 9.4140 ns/op 1.91
intersect bitArray bitLen 8 31.488 ns/op 14.470 ns/op 2.18
intersect array and set length 8 226.45 ns/op 102.71 ns/op 2.20
intersect bitArray bitLen 128 99.373 ns/op 48.514 ns/op 2.05
intersect array and set length 128 1.8645 us/op 1.3583 us/op 1.37
Buffer.concat 32 items 6.9050 us/op 2.8550 us/op 2.42
Uint8Array.set 32 items 4.1400 us/op 3.1020 us/op 1.33
transfer serialized Status (84 B) 3.3550 us/op 2.5320 us/op 1.33
copy serialized Status (84 B) 3.0480 us/op 2.0750 us/op 1.47
transfer serialized SignedVoluntaryExit (112 B) 3.8750 us/op 2.5800 us/op 1.50
copy serialized SignedVoluntaryExit (112 B) 3.2700 us/op 2.3000 us/op 1.42
transfer serialized ProposerSlashing (416 B) 4.8590 us/op 3.1960 us/op 1.52
copy serialized ProposerSlashing (416 B) 4.7380 us/op 3.1730 us/op 1.49
transfer serialized Attestation (485 B) 4.5700 us/op 3.2170 us/op 1.42
copy serialized Attestation (485 B) 4.4250 us/op 3.2590 us/op 1.36
transfer serialized AttesterSlashing (33232 B) 5.7460 us/op 3.4080 us/op 1.69
copy serialized AttesterSlashing (33232 B) 12.696 us/op 17.092 us/op 0.74
transfer serialized Small SignedBeaconBlock (128000 B) 5.8400 us/op 3.3960 us/op 1.72
copy serialized Small SignedBeaconBlock (128000 B) 39.707 us/op 36.713 us/op 1.08
transfer serialized Avg SignedBeaconBlock (200000 B) 8.1480 us/op 3.6070 us/op 2.26
copy serialized Avg SignedBeaconBlock (200000 B) 133.02 us/op 61.591 us/op 2.16
transfer serialized BlobsSidecar (524380 B) 7.2680 us/op 5.6230 us/op 1.29
copy serialized BlobsSidecar (524380 B) 199.19 us/op 245.34 us/op 0.81
transfer serialized Big SignedBeaconBlock (1000000 B) 8.6010 us/op 6.3910 us/op 1.35
copy serialized Big SignedBeaconBlock (1000000 B) 466.04 us/op 467.89 us/op 1.00
pass gossip attestations to forkchoice per slot 7.5582 ms/op 3.7209 ms/op 2.03
forkChoice updateHead vc 100000 bc 64 eq 0 4.7475 ms/op
forkChoice updateHead vc 600000 bc 64 eq 0 24.615 ms/op
forkChoice updateHead vc 1000000 bc 64 eq 0 50.013 ms/op
forkChoice updateHead vc 600000 bc 320 eq 0 43.203 ms/op
forkChoice updateHead vc 600000 bc 1200 eq 0 156.74 ms/op
forkChoice updateHead vc 600000 bc 64 eq 1000 38.544 ms/op
forkChoice updateHead vc 600000 bc 64 eq 10000 47.126 ms/op
forkChoice updateHead vc 600000 bc 64 eq 300000 87.284 ms/op
computeDeltas 7.8508 ms/op 3.8875 ms/op 2.02
computeProposerBoostScoreFromBalances 3.1850 ms/op 2.1255 ms/op 1.50
altair processAttestation - 250000 vs - 7PWei normalcase 7.6509 ms/op 4.3520 ms/op 1.76
altair processAttestation - 250000 vs - 7PWei worstcase 11.315 ms/op 5.6208 ms/op 2.01
altair processAttestation - setStatus - 1/6 committees join 327.42 us/op 151.22 us/op 2.17
altair processAttestation - setStatus - 1/3 committees join 840.25 us/op 452.65 us/op 1.86
altair processAttestation - setStatus - 1/2 committees join 1.1064 ms/op 493.00 us/op 2.24
altair processAttestation - setStatus - 2/3 committees join 1.2210 ms/op 528.14 us/op 2.31
altair processAttestation - setStatus - 4/5 committees join 1.9172 ms/op 970.63 us/op 1.98
altair processAttestation - setStatus - 100% committees join 2.0565 ms/op 877.98 us/op 2.34
altair processBlock - 250000 vs - 7PWei normalcase 42.872 ms/op 22.101 ms/op 1.94
altair processBlock - 250000 vs - 7PWei normalcase hashState 60.992 ms/op 37.042 ms/op 1.65
altair processBlock - 250000 vs - 7PWei worstcase 152.18 ms/op 67.818 ms/op 2.24
altair processBlock - 250000 vs - 7PWei worstcase hashState 184.64 ms/op 102.54 ms/op 1.80
phase0 processBlock - 250000 vs - 7PWei normalcase 6.6128 ms/op 4.5267 ms/op 1.46
phase0 processBlock - 250000 vs - 7PWei worstcase 99.569 ms/op 39.687 ms/op 2.51
altair processEth1Data - 250000 vs - 7PWei normalcase 1.5921 ms/op 1.0207 ms/op 1.56
getExpectedWithdrawals 250000 eb:1,eth1:1,we:0,wn:0,smpl:15 23.695 us/op 16.739 us/op 1.42
getExpectedWithdrawals 250000 eb:0.95,eth1:0.1,we:0.05,wn:0,smpl:219 72.298 us/op 35.354 us/op 2.04
getExpectedWithdrawals 250000 eb:0.95,eth1:0.3,we:0.05,wn:0,smpl:42 21.968 us/op 16.606 us/op 1.32
getExpectedWithdrawals 250000 eb:0.95,eth1:0.7,we:0.05,wn:0,smpl:18 28.818 us/op 10.771 us/op 2.68
getExpectedWithdrawals 250000 eb:0.1,eth1:0.1,we:0,wn:0,smpl:1020 244.00 us/op 115.59 us/op 2.11
getExpectedWithdrawals 250000 eb:0.03,eth1:0.03,we:0,wn:0,smpl:11777 1.9089 ms/op 773.06 us/op 2.47
getExpectedWithdrawals 250000 eb:0.01,eth1:0.01,we:0,wn:0,smpl:16384 2.8553 ms/op 1.5846 ms/op 1.80
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,smpl:16384 2.4690 ms/op 1.4532 ms/op 1.70
getExpectedWithdrawals 250000 eb:0,eth1:0,we:0,wn:0,nocache,smpl:16384 6.4974 ms/op 3.2900 ms/op 1.97
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,smpl:16384 4.4683 ms/op 2.0958 ms/op 2.13
getExpectedWithdrawals 250000 eb:0,eth1:1,we:0,wn:0,nocache,smpl:16384 11.947 ms/op 6.4566 ms/op 1.85
Tree 40 250000 create 1.2582 s/op 585.95 ms/op 2.15
Tree 40 250000 get(125000) 564.82 ns/op 200.09 ns/op 2.82
Tree 40 250000 set(125000) 2.8914 us/op 1.9940 us/op 1.45
Tree 40 250000 toArray() 44.959 ms/op 25.321 ms/op 1.78
Tree 40 250000 iterate all - toArray() + loop 42.399 ms/op 33.849 ms/op 1.25
Tree 40 250000 iterate all - get(i) 186.61 ms/op 97.322 ms/op 1.92
MutableVector 250000 create 27.339 ms/op 12.338 ms/op 2.22
MutableVector 250000 get(125000) 21.483 ns/op 6.8630 ns/op 3.13
MutableVector 250000 set(125000) 932.86 ns/op 471.26 ns/op 1.98
MutableVector 250000 toArray() 8.4225 ms/op 6.0828 ms/op 1.38
MutableVector 250000 iterate all - toArray() + loop 8.4548 ms/op 6.3203 ms/op 1.34
MutableVector 250000 iterate all - get(i) 4.2151 ms/op 1.6694 ms/op 2.52
Array 250000 create 8.0573 ms/op 5.3636 ms/op 1.50
Array 250000 clone - spread 3.2935 ms/op 5.6017 ms/op 0.59
Array 250000 get(125000) 1.6420 ns/op 2.1760 ns/op 0.75
Array 250000 set(125000) 2.6600 ns/op 1.3280 ns/op 2.00
Array 250000 iterate all - loop 313.68 us/op 91.776 us/op 3.42
effectiveBalanceIncrements clone Uint8Array 300000 71.185 us/op 74.901 us/op 0.95
effectiveBalanceIncrements clone MutableVector 300000 973.00 ns/op 480.00 ns/op 2.03
effectiveBalanceIncrements rw all Uint8Array 300000 586.94 us/op 191.80 us/op 3.06
effectiveBalanceIncrements rw all MutableVector 300000 259.38 ms/op 132.34 ms/op 1.96
phase0 afterProcessEpoch - 250000 vs - 7PWei 335.92 ms/op 134.04 ms/op 2.51
phase0 beforeProcessEpoch - 250000 vs - 7PWei 96.410 ms/op 67.327 ms/op 1.43
altair processEpoch - mainnet_e81889 1.1249 s/op 425.76 ms/op 2.64
mainnet_e81889 - altair beforeProcessEpoch 174.82 ms/op 89.272 ms/op 1.96
mainnet_e81889 - altair processJustificationAndFinalization 86.040 us/op 27.960 us/op 3.08
mainnet_e81889 - altair processInactivityUpdates 20.563 ms/op 7.6566 ms/op 2.69
mainnet_e81889 - altair processRewardsAndPenalties 192.71 ms/op 88.035 ms/op 2.19
mainnet_e81889 - altair processRegistryUpdates 15.288 us/op 6.3200 us/op 2.42
mainnet_e81889 - altair processSlashings 3.4860 us/op 1.4170 us/op 2.46
mainnet_e81889 - altair processEth1DataReset 3.5150 us/op 1.2300 us/op 2.86
mainnet_e81889 - altair processEffectiveBalanceUpdates 3.8050 ms/op 4.5459 ms/op 0.84
mainnet_e81889 - altair processSlashingsReset 23.494 us/op 10.372 us/op 2.27
mainnet_e81889 - altair processRandaoMixesReset 22.075 us/op 11.642 us/op 1.90
mainnet_e81889 - altair processHistoricalRootsUpdate 4.0030 us/op 1.5930 us/op 2.51
mainnet_e81889 - altair processParticipationFlagUpdates 14.515 us/op 5.2180 us/op 2.78
mainnet_e81889 - altair processSyncCommitteeUpdates 2.9390 us/op 1.1100 us/op 2.65
mainnet_e81889 - altair afterProcessEpoch 399.69 ms/op 132.32 ms/op 3.02
phase0 processEpoch - mainnet_e58758 933.28 ms/op 352.65 ms/op 2.65
mainnet_e58758 - phase0 beforeProcessEpoch 303.66 ms/op 168.00 ms/op 1.81
mainnet_e58758 - phase0 processJustificationAndFinalization 50.704 us/op 31.805 us/op 1.59
mainnet_e58758 - phase0 processRewardsAndPenalties 130.52 ms/op 52.866 ms/op 2.47
mainnet_e58758 - phase0 processRegistryUpdates 26.021 us/op 14.934 us/op 1.74
mainnet_e58758 - phase0 processSlashings 2.1230 us/op 1.4800 us/op 1.43
mainnet_e58758 - phase0 processEth1DataReset 2.1730 us/op 1.0750 us/op 2.02
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 2.4103 ms/op 1.0414 ms/op 2.31
mainnet_e58758 - phase0 processSlashingsReset 11.360 us/op 4.5030 us/op 2.52
mainnet_e58758 - phase0 processRandaoMixesReset 19.272 us/op 10.631 us/op 1.81
mainnet_e58758 - phase0 processHistoricalRootsUpdate 2.7620 us/op 2.1750 us/op 1.27
mainnet_e58758 - phase0 processParticipationRecordUpdates 24.467 us/op 10.535 us/op 2.32
mainnet_e58758 - phase0 afterProcessEpoch 278.90 ms/op 109.54 ms/op 2.55
phase0 processEffectiveBalanceUpdates - 250000 normalcase 3.8628 ms/op 1.3507 ms/op 2.86
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 4.0533 ms/op 1.5600 ms/op 2.60
altair processInactivityUpdates - 250000 normalcase 72.665 ms/op 26.307 ms/op 2.76
altair processInactivityUpdates - 250000 worstcase 65.593 ms/op 37.815 ms/op 1.73
phase0 processRegistryUpdates - 250000 normalcase 15.172 us/op 11.632 us/op 1.30
phase0 processRegistryUpdates - 250000 badcase_full_deposits 584.82 us/op 347.19 us/op 1.68
phase0 processRegistryUpdates - 250000 worstcase 0.5 308.64 ms/op 127.63 ms/op 2.42
altair processRewardsAndPenalties - 250000 normalcase 137.21 ms/op 84.567 ms/op 1.62
altair processRewardsAndPenalties - 250000 worstcase 192.96 ms/op 73.744 ms/op 2.62
phase0 getAttestationDeltas - 250000 normalcase 25.622 ms/op 8.9029 ms/op 2.88
phase0 getAttestationDeltas - 250000 worstcase 26.903 ms/op 7.3780 ms/op 3.65
phase0 processSlashings - 250000 worstcase 15.117 ms/op 3.5296 ms/op 4.28
altair processSyncCommitteeUpdates - 250000 666.72 ms/op 188.86 ms/op 3.53
BeaconState.hashTreeRoot - No change 1.9800 us/op 423.00 ns/op 4.68
BeaconState.hashTreeRoot - 1 full validator 184.14 us/op 59.044 us/op 3.12
BeaconState.hashTreeRoot - 32 full validator 2.0321 ms/op 510.14 us/op 3.98
BeaconState.hashTreeRoot - 512 full validator 25.811 ms/op 6.0889 ms/op 4.24
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 245.88 us/op 66.861 us/op 3.68
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 3.9562 ms/op 976.32 us/op 4.05
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 42.849 ms/op 12.788 ms/op 3.35
BeaconState.hashTreeRoot - 1 balances 185.08 us/op 52.965 us/op 3.49
BeaconState.hashTreeRoot - 32 balances 1.9401 ms/op 538.89 us/op 3.60
BeaconState.hashTreeRoot - 512 balances 17.194 ms/op 4.6234 ms/op 3.72
BeaconState.hashTreeRoot - 250000 balances 307.36 ms/op 78.717 ms/op 3.90
aggregationBits - 2048 els - zipIndexesInBitList 81.816 us/op 16.618 us/op 4.92
regular array get 100000 times 129.17 us/op 34.297 us/op 3.77
wrappedArray get 100000 times 169.02 us/op 40.857 us/op 4.14
arrayWithProxy get 100000 times 57.803 ms/op 18.394 ms/op 3.14
ssz.Root.equals 2.1860 us/op 598.00 ns/op 3.66
byteArrayEquals 1.9660 us/op 556.00 ns/op 3.54
shuffle list - 16384 els 27.760 ms/op 7.2747 ms/op 3.82
shuffle list - 250000 els 402.06 ms/op 102.94 ms/op 3.91
processSlot - 1 slots 29.423 us/op 10.748 us/op 2.74
processSlot - 32 slots 4.4612 ms/op 1.5718 ms/op 2.84
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 106.35 ms/op 36.626 ms/op 2.90
getCommitteeAssignments - req 1 vs - 250000 vc 9.7226 ms/op 2.9939 ms/op 3.25
getCommitteeAssignments - req 100 vs - 250000 vc 13.803 ms/op 4.1181 ms/op 3.35
getCommitteeAssignments - req 1000 vs - 250000 vc 15.806 ms/op 4.5020 ms/op 3.51
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 17.630 ns/op 4.7600 ns/op 3.70
state getBlockRootAtSlot - 250000 vs - 7PWei 2.3976 us/op 853.52 ns/op 2.81
computeProposers - vc 250000 50.265 ms/op 10.895 ms/op 4.61
computeEpochShuffling - vc 250000 395.24 ms/op 103.74 ms/op 3.81
getNextSyncCommittee - vc 250000 764.00 ms/op 184.93 ms/op 4.13
computeSigningRoot for AttestationData 53.822 us/op 13.341 us/op 4.03
hash AttestationData serialized data then Buffer.toString(base64) 9.6260 us/op 2.4449 us/op 3.94
toHexString serialized data 5.0867 us/op 1.1197 us/op 4.54
Buffer.toString(base64) 1.3326 us/op 344.07 ns/op 3.87

by benchmarkbot/action

@dapplion dapplion force-pushed the dapplion/state-api-to-chain branch from b51349f to d6aa070 Compare May 31, 2023 09:40
@wemeetagain wemeetagain merged commit aee17f8 into unstable May 31, 2023
10 of 11 checks passed
@wemeetagain wemeetagain deleted the dapplion/state-api-to-chain branch May 31, 2023 19:15
@wemeetagain
Copy link
Member

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

Move pseudo-regen code from beacon API to regen Move API consumer code to chain class
2 participants