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

Optimistic payload import condition update #3855

Merged
merged 1 commit into from
Mar 14, 2022

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Mar 14, 2022

Motivation
As part of the Kiln spec v2.1, the optimistic import condition was updated in #2844

This PR updates the lodestar verify block's optimistic safe import condition to the same.

@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #3855 (b343783) into master (e30eca0) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3855      +/-   ##
==========================================
- Coverage   36.12%   36.11%   -0.01%     
==========================================
  Files         325      325              
  Lines        9041     9043       +2     
  Branches     1419     1419              
==========================================
  Hits         3266     3266              
- Misses       5632     5634       +2     
  Partials      143      143              

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 7b3aca1 Previous: fbeacde Ratio
BeaconState.hashTreeRoot - No change 661.00 ns/op 680.00 ns/op 0.97
BeaconState.hashTreeRoot - 1 full validator 149.27 us/op 155.72 us/op 0.96
BeaconState.hashTreeRoot - 32 full validator 2.2136 ms/op 2.3121 ms/op 0.96
BeaconState.hashTreeRoot - 512 full validator 30.262 ms/op 31.036 ms/op 0.98
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 150.99 us/op 149.93 us/op 1.01
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.7815 ms/op 2.9048 ms/op 0.96
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 32.844 ms/op 33.348 ms/op 0.98
BeaconState.hashTreeRoot - 1 balances 112.19 us/op 110.66 us/op 1.01
BeaconState.hashTreeRoot - 32 balances 924.11 us/op 939.45 us/op 0.98
BeaconState.hashTreeRoot - 512 balances 8.7817 ms/op 8.9166 ms/op 0.98
BeaconState.hashTreeRoot - 250000 balances 161.09 ms/op 192.52 ms/op 0.84
processSlot - 1 slots 59.040 us/op 55.246 us/op 1.07
processSlot - 32 slots 3.4644 ms/op 3.5799 ms/op 0.97
getCommitteeAssignments - req 1 vs - 250000 vc 6.3134 ms/op 6.4888 ms/op 0.97
getCommitteeAssignments - req 100 vs - 250000 vc 8.8222 ms/op 9.0659 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 9.3508 ms/op 9.7967 ms/op 0.95
computeProposers - vc 250000 25.096 ms/op 25.568 ms/op 0.98
computeEpochShuffling - vc 250000 218.36 ms/op 222.54 ms/op 0.98
getNextSyncCommittee - vc 250000 409.32 ms/op 416.71 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 41.848 ms/op 41.781 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 46.308 ms/op 39.005 ms/op 1.19
altair processAttestation - setStatus - 1/6 committees join 13.591 ms/op 13.162 ms/op 1.03
altair processAttestation - setStatus - 1/3 committees join 28.294 ms/op 28.388 ms/op 1.00
altair processAttestation - setStatus - 1/2 committees join 43.772 ms/op 42.290 ms/op 1.04
altair processAttestation - setStatus - 2/3 committees join 55.318 ms/op 55.862 ms/op 0.99
altair processAttestation - setStatus - 4/5 committees join 68.068 ms/op 68.083 ms/op 1.00
altair processAttestation - setStatus - 100% committees join 81.879 ms/op 85.957 ms/op 0.95
altair processAttestation - updateEpochParticipants - 1/6 committees join 13.886 ms/op 14.492 ms/op 0.96
altair processAttestation - updateEpochParticipants - 1/3 committees join 31.209 ms/op 29.831 ms/op 1.05
altair processAttestation - updateEpochParticipants - 1/2 committees join 29.081 ms/op 24.250 ms/op 1.20
altair processAttestation - updateEpochParticipants - 2/3 committees join 27.602 ms/op 29.475 ms/op 0.94
altair processAttestation - updateEpochParticipants - 4/5 committees join 27.470 ms/op 27.197 ms/op 1.01
altair processAttestation - updateEpochParticipants - 100% committees join 29.310 ms/op 27.620 ms/op 1.06
altair processAttestation - updateAllStatus 22.709 ms/op 22.142 ms/op 1.03
altair processBlock - 250000 vs - 7PWei normalcase 43.670 ms/op 39.393 ms/op 1.11
altair processBlock - 250000 vs - 7PWei worstcase 123.12 ms/op 134.99 ms/op 0.91
altair processEpoch - mainnet_e81889 916.91 ms/op 917.58 ms/op 1.00
mainnet_e81889 - altair beforeProcessEpoch 350.62 ms/op 364.93 ms/op 0.96
mainnet_e81889 - altair processJustificationAndFinalization 70.508 us/op 74.964 us/op 0.94
mainnet_e81889 - altair processInactivityUpdates 22.113 ms/op 21.199 ms/op 1.04
mainnet_e81889 - altair processRewardsAndPenalties 138.05 ms/op 111.49 ms/op 1.24
mainnet_e81889 - altair processRegistryUpdates 10.520 us/op 10.355 us/op 1.02
mainnet_e81889 - altair processSlashings 3.5010 us/op 2.8910 us/op 1.21
mainnet_e81889 - altair processEth1DataReset 3.1410 us/op 3.4020 us/op 0.92
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.5691 ms/op 7.5133 ms/op 1.01
mainnet_e81889 - altair processSlashingsReset 16.966 us/op 18.286 us/op 0.93
mainnet_e81889 - altair processRandaoMixesReset 22.912 us/op 17.627 us/op 1.30
mainnet_e81889 - altair processHistoricalRootsUpdate 4.1130 us/op 4.0290 us/op 1.02
mainnet_e81889 - altair processParticipationFlagUpdates 94.729 ms/op 82.680 ms/op 1.15
mainnet_e81889 - altair processSyncCommitteeUpdates 2.8540 us/op 2.3990 us/op 1.19
mainnet_e81889 - altair afterProcessEpoch 272.26 ms/op 291.64 ms/op 0.93
altair processInactivityUpdates - 250000 normalcase 85.981 ms/op 93.332 ms/op 0.92
altair processInactivityUpdates - 250000 worstcase 82.677 ms/op 86.776 ms/op 0.95
altair processParticipationFlagUpdates - 250000 anycase 65.275 ms/op 70.584 ms/op 0.92
altair processRewardsAndPenalties - 250000 normalcase 98.387 ms/op 105.26 ms/op 0.93
altair processRewardsAndPenalties - 250000 worstcase 95.014 ms/op 113.69 ms/op 0.84
altair processSyncCommitteeUpdates - 250000 419.69 ms/op 424.35 ms/op 0.99
Tree 40 250000 create 806.43 ms/op 839.25 ms/op 0.96
Tree 40 250000 get(125000) 380.96 ns/op 390.48 ns/op 0.98
Tree 40 250000 set(125000) 2.2433 us/op 2.8352 us/op 0.79
Tree 40 250000 toArray() 45.018 ms/op 48.714 ms/op 0.92
Tree 40 250000 iterate all - toArray() + loop 44.727 ms/op 47.994 ms/op 0.93
Tree 40 250000 iterate all - get(i) 141.38 ms/op 142.65 ms/op 0.99
MutableVector 250000 create 25.146 ms/op 28.745 ms/op 0.87
MutableVector 250000 get(125000) 15.706 ns/op 15.767 ns/op 1.00
MutableVector 250000 set(125000) 626.04 ns/op 639.86 ns/op 0.98
MutableVector 250000 toArray() 10.553 ms/op 10.449 ms/op 1.01
MutableVector 250000 iterate all - toArray() + loop 10.547 ms/op 10.508 ms/op 1.00
MutableVector 250000 iterate all - get(i) 3.9463 ms/op 4.0023 ms/op 0.99
Array 250000 create 6.7624 ms/op 6.7965 ms/op 0.99
Array 250000 clone - spread 2.6352 ms/op 2.6205 ms/op 1.01
Array 250000 get(125000) 1.2780 ns/op 1.2640 ns/op 1.01
Array 250000 set(125000) 1.2670 ns/op 1.2680 ns/op 1.00
Array 250000 iterate all - loop 200.63 us/op 201.06 us/op 1.00
effectiveBalanceIncrements clone Uint8Array 300000 97.302 us/op 94.662 us/op 1.03
effectiveBalanceIncrements clone MutableVector 300000 613.00 ns/op 662.00 ns/op 0.93
effectiveBalanceIncrements rw all Uint8Array 300000 358.57 us/op 360.77 us/op 0.99
effectiveBalanceIncrements rw all MutableVector 300000 193.71 ms/op 212.67 ms/op 0.91
aggregationBits - 2048 els - readonlyValues 215.54 us/op 216.33 us/op 1.00
aggregationBits - 2048 els - zipIndexesInBitList 37.341 us/op 40.794 us/op 0.92
regular array get 100000 times 80.424 us/op 80.614 us/op 1.00
wrappedArray get 100000 times 80.261 us/op 80.600 us/op 1.00
arrayWithProxy get 100000 times 43.635 ms/op 40.386 ms/op 1.08
ssz.Root.equals 1.3180 us/op 1.3160 us/op 1.00
ssz.Root.equals with valueOf() 1.5620 us/op 1.6030 us/op 0.97
byteArrayEquals with valueOf() 1.5680 us/op 1.5470 us/op 1.01
phase0 processBlock - 250000 vs - 7PWei normalcase 9.4223 ms/op 9.5692 ms/op 0.98
phase0 processBlock - 250000 vs - 7PWei worstcase 86.604 ms/op 85.489 ms/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 252.37 ms/op 245.24 ms/op 1.03
phase0 beforeProcessEpoch - 250000 vs - 7PWei 625.69 ms/op 635.73 ms/op 0.98
phase0 processEpoch - mainnet_e58758 888.32 ms/op 904.96 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 482.02 ms/op 497.89 ms/op 0.97
mainnet_e58758 - phase0 processJustificationAndFinalization 80.096 us/op 63.058 us/op 1.27
mainnet_e58758 - phase0 processRewardsAndPenalties 127.97 ms/op 90.771 ms/op 1.41
mainnet_e58758 - phase0 processRegistryUpdates 50.993 us/op 42.018 us/op 1.21
mainnet_e58758 - phase0 processSlashings 3.1970 us/op 2.8670 us/op 1.12
mainnet_e58758 - phase0 processEth1DataReset 3.1870 us/op 2.9100 us/op 1.10
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.1568 ms/op 6.3871 ms/op 0.96
mainnet_e58758 - phase0 processSlashingsReset 16.462 us/op 11.656 us/op 1.41
mainnet_e58758 - phase0 processRandaoMixesReset 19.583 us/op 17.105 us/op 1.14
mainnet_e58758 - phase0 processHistoricalRootsUpdate 4.2860 us/op 3.6130 us/op 1.19
mainnet_e58758 - phase0 processParticipationRecordUpdates 14.389 us/op 14.688 us/op 0.98
mainnet_e58758 - phase0 afterProcessEpoch 204.38 ms/op 219.73 ms/op 0.93
phase0 processEffectiveBalanceUpdates - 250000 normalcase 7.0729 ms/op 7.1693 ms/op 0.99
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 7.3412 ms/op 7.7266 ms/op 0.95
phase0 processRegistryUpdates - 250000 normalcase 57.732 us/op 51.508 us/op 1.12
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.4799 ms/op 3.4258 ms/op 1.02
phase0 processRegistryUpdates - 250000 worstcase 0.5 1.8315 s/op 2.0310 s/op 0.90
phase0 getAttestationDeltas - 250000 normalcase 14.859 ms/op 15.089 ms/op 0.98
phase0 getAttestationDeltas - 250000 worstcase 15.244 ms/op 15.375 ms/op 0.99
phase0 processSlashings - 250000 worstcase 40.412 ms/op 45.275 ms/op 0.89
shuffle list - 16384 els 14.885 ms/op 15.601 ms/op 0.95
shuffle list - 250000 els 210.15 ms/op 222.63 ms/op 0.94
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 555.19 us/op 573.93 us/op 0.97
pass gossip attestations to forkchoice per slot 21.264 ms/op 16.991 ms/op 1.25
computeDeltas 3.8755 ms/op 3.7707 ms/op 1.03
computeProposerBoostScoreFromBalances 585.01 us/op 601.58 us/op 0.97
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.2193 ms/op 2.7121 ms/op 0.82
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 837.11 us/op 873.17 us/op 0.96
BLS verify - blst-native 2.1275 ms/op 2.2013 ms/op 0.97
BLS verifyMultipleSignatures 3 - blst-native 4.3709 ms/op 4.5378 ms/op 0.96
BLS verifyMultipleSignatures 8 - blst-native 9.7651 ms/op 9.7448 ms/op 1.00
BLS verifyMultipleSignatures 32 - blst-native 34.705 ms/op 35.288 ms/op 0.98
BLS aggregatePubkeys 32 - blst-native 46.148 us/op 48.009 us/op 0.96
BLS aggregatePubkeys 128 - blst-native 179.25 us/op 184.38 us/op 0.97
getAttestationsForBlock 68.134 ms/op 70.435 ms/op 0.97
CheckpointStateCache - add get delete 21.591 us/op 21.959 us/op 0.98
validate gossip signedAggregateAndProof - struct 5.1578 ms/op 5.2704 ms/op 0.98
validate gossip signedAggregateAndProof - treeBacked 5.0858 ms/op 5.1899 ms/op 0.98
validate gossip attestation - struct 2.4410 ms/op 2.4850 ms/op 0.98
validate gossip attestation - treeBacked 2.4752 ms/op 2.4924 ms/op 0.99
pickEth1Vote - no votes 11.023 ms/op 11.594 ms/op 0.95
pickEth1Vote - max votes 59.904 ms/op 60.038 ms/op 1.00
pickEth1Vote - Eth1Data hashTreeRoot value x2048 29.233 ms/op 29.023 ms/op 1.01
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 11.240 ms/op 11.221 ms/op 1.00
pickEth1Vote - Eth1Data fastSerialize value x2048 5.7438 ms/op 6.4578 ms/op 0.89
pickEth1Vote - Eth1Data fastSerialize tree x2048 29.506 ms/op 28.219 ms/op 1.05
bytes32 toHexString 1.9540 us/op 2.0960 us/op 0.93
bytes32 Buffer.toString(hex) 825.00 ns/op 815.00 ns/op 1.01
bytes32 Buffer.toString(hex) from Uint8Array 1.0060 us/op 1.1050 us/op 0.91
bytes32 Buffer.toString(hex) + 0x 764.00 ns/op 823.00 ns/op 0.93
Object access 1 prop 0.38100 ns/op 0.41100 ns/op 0.93
Map access 1 prop 0.33600 ns/op 0.34900 ns/op 0.96
Object get x1000 19.490 ns/op 20.868 ns/op 0.93
Map get x1000 1.1240 ns/op 1.1720 ns/op 0.96
Object set x1000 117.67 ns/op 126.75 ns/op 0.93
Map set x1000 73.376 ns/op 78.265 ns/op 0.94
Return object 10000 times 0.42670 ns/op 0.44370 ns/op 0.96
Throw Error 10000 times 6.6633 us/op 6.8207 us/op 0.98
enrSubnets - fastDeserialize 64 bits 1.4480 us/op 1.5350 us/op 0.94
enrSubnets - ssz BitVector 64 bits 18.810 us/op 19.621 us/op 0.96
enrSubnets - fastDeserialize 4 bits 503.00 ns/op 550.00 ns/op 0.91
enrSubnets - ssz BitVector 4 bits 3.2690 us/op 3.4550 us/op 0.95
RateTracker 1000000 limit, 1 obj count per request 207.49 ns/op 213.35 ns/op 0.97
RateTracker 1000000 limit, 2 obj count per request 156.21 ns/op 160.52 ns/op 0.97
RateTracker 1000000 limit, 4 obj count per request 127.21 ns/op 132.94 ns/op 0.96
RateTracker 1000000 limit, 8 obj count per request 115.53 ns/op 119.61 ns/op 0.97
RateTracker with prune 4.1920 us/op 4.8400 us/op 0.87
array of 16000 items push then shift 3.6405 us/op 3.6658 us/op 0.99
LinkedList of 16000 items push then shift 19.846 ns/op 20.216 ns/op 0.98
array of 16000 items push then pop 229.21 ns/op 238.90 ns/op 0.96
LinkedList of 16000 items push then pop 19.154 ns/op 18.183 ns/op 1.05
array of 24000 items push then shift 5.3652 us/op 5.4386 us/op 0.99
LinkedList of 24000 items push then shift 21.472 ns/op 23.328 ns/op 0.92
array of 24000 items push then pop 206.01 ns/op 237.05 ns/op 0.87
LinkedList of 24000 items push then pop 19.432 ns/op 19.608 ns/op 0.99

by benchmarkbot/action

@g11tech g11tech merged commit 94c8e12 into master Mar 14, 2022
@g11tech g11tech deleted the g11tech/optimisticimportcondition branch March 14, 2022 20:31
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