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 getCanonicalBlockSummaryAtSlot at future slot #3757

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

wemeetagain
Copy link
Member

Motivation

getCanonicalBlockSummaryAtSlot should return the block summary at the slot and never return a block summary at a different slot.

Description

Resolves #3332

@codecov
Copy link

codecov bot commented Feb 15, 2022

Codecov Report

Merging #3757 (dd8a912) into master (e12bcd1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3757   +/-   ##
=======================================
  Coverage   36.84%   36.84%           
=======================================
  Files         320      320           
  Lines        8772     8772           
  Branches     1365     1365           
=======================================
  Hits         3232     3232           
  Misses       5398     5398           
  Partials      142      142           

@github-actions
Copy link
Contributor

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 4956949 Previous: e12bcd1 Ratio
BeaconState.hashTreeRoot - No change 538.00 ns/op 625.00 ns/op 0.86
BeaconState.hashTreeRoot - 1 full validator 139.26 us/op 145.96 us/op 0.95
BeaconState.hashTreeRoot - 32 full validator 2.0604 ms/op 2.2319 ms/op 0.92
BeaconState.hashTreeRoot - 512 full validator 27.059 ms/op 30.367 ms/op 0.89
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 142.89 us/op 144.71 us/op 0.99
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 2.1936 ms/op 2.4120 ms/op 0.91
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 31.279 ms/op 31.739 ms/op 0.99
BeaconState.hashTreeRoot - 1 balances 96.047 us/op 105.63 us/op 0.91
BeaconState.hashTreeRoot - 32 balances 836.96 us/op 867.90 us/op 0.96
BeaconState.hashTreeRoot - 512 balances 7.8355 ms/op 8.3350 ms/op 0.94
BeaconState.hashTreeRoot - 250000 balances 163.08 ms/op 153.77 ms/op 1.06
processSlot - 1 slots 68.958 us/op 54.120 us/op 1.27
processSlot - 32 slots 3.5301 ms/op 3.3431 ms/op 1.06
getCommitteeAssignments - req 1 vs - 250000 vc 4.8397 ms/op 6.0620 ms/op 0.80
getCommitteeAssignments - req 100 vs - 250000 vc 6.6432 ms/op 8.6622 ms/op 0.77
getCommitteeAssignments - req 1000 vs - 250000 vc 7.4828 ms/op 8.9274 ms/op 0.84
computeProposers - vc 250000 24.707 ms/op 24.445 ms/op 1.01
computeEpochShuffling - vc 250000 187.34 ms/op 213.40 ms/op 0.88
getNextSyncCommittee - vc 250000 370.45 ms/op 406.84 ms/op 0.91
altair processAttestation - 250000 vs - 7PWei normalcase 38.377 ms/op 40.615 ms/op 0.94
altair processAttestation - 250000 vs - 7PWei worstcase 45.886 ms/op 38.437 ms/op 1.19
altair processAttestation - setStatus - 1/6 committees join 11.618 ms/op 12.189 ms/op 0.95
altair processAttestation - setStatus - 1/3 committees join 26.473 ms/op 25.641 ms/op 1.03
altair processAttestation - setStatus - 1/2 committees join 49.206 ms/op 38.197 ms/op 1.29
altair processAttestation - setStatus - 2/3 committees join 69.308 ms/op 52.050 ms/op 1.33
altair processAttestation - setStatus - 4/5 committees join 67.924 ms/op 59.230 ms/op 1.15
altair processAttestation - setStatus - 100% committees join 82.319 ms/op 73.638 ms/op 1.12
altair processAttestation - updateEpochParticipants - 1/6 committees join 14.482 ms/op 12.748 ms/op 1.14
altair processAttestation - updateEpochParticipants - 1/3 committees join 29.089 ms/op 26.141 ms/op 1.11
altair processAttestation - updateEpochParticipants - 1/2 committees join 25.177 ms/op 23.437 ms/op 1.07
altair processAttestation - updateEpochParticipants - 2/3 committees join 22.433 ms/op 29.608 ms/op 0.76
altair processAttestation - updateEpochParticipants - 4/5 committees join 23.939 ms/op 25.433 ms/op 0.94
altair processAttestation - updateEpochParticipants - 100% committees join 31.041 ms/op 27.112 ms/op 1.14
altair processAttestation - updateAllStatus 18.733 ms/op 22.331 ms/op 0.84
altair processBlock - 250000 vs - 7PWei normalcase 35.232 ms/op 44.043 ms/op 0.80
altair processBlock - 250000 vs - 7PWei worstcase 116.81 ms/op 115.22 ms/op 1.01
altair processEpoch - mainnet_e81889 944.41 ms/op 1.0318 s/op 0.92
mainnet_e81889 - altair beforeProcessEpoch 375.18 ms/op 285.01 ms/op 1.32
mainnet_e81889 - altair processJustificationAndFinalization 104.15 us/op 73.637 us/op 1.41
mainnet_e81889 - altair processInactivityUpdates 16.469 ms/op 20.144 ms/op 0.82
mainnet_e81889 - altair processRewardsAndPenalties 109.96 ms/op 134.28 ms/op 0.82
mainnet_e81889 - altair processRegistryUpdates 19.099 us/op 11.498 us/op 1.66
mainnet_e81889 - altair processSlashings 7.1750 us/op 3.8450 us/op 1.87
mainnet_e81889 - altair processEth1DataReset 6.2890 us/op 3.4030 us/op 1.85
mainnet_e81889 - altair processEffectiveBalanceUpdates 5.7654 ms/op 7.8513 ms/op 0.73
mainnet_e81889 - altair processSlashingsReset 34.580 us/op 17.424 us/op 1.98
mainnet_e81889 - altair processRandaoMixesReset 38.053 us/op 20.309 us/op 1.87
mainnet_e81889 - altair processHistoricalRootsUpdate 6.7890 us/op 3.6660 us/op 1.85
mainnet_e81889 - altair processParticipationFlagUpdates 67.401 ms/op 76.457 ms/op 0.88
mainnet_e81889 - altair processSyncCommitteeUpdates 4.7810 us/op 3.1960 us/op 1.50
mainnet_e81889 - altair afterProcessEpoch 239.11 ms/op 251.58 ms/op 0.95
altair processInactivityUpdates - 250000 normalcase 84.824 ms/op 76.674 ms/op 1.11
altair processInactivityUpdates - 250000 worstcase 68.796 ms/op 76.240 ms/op 0.90
altair processParticipationFlagUpdates - 250000 anycase 57.791 ms/op 68.274 ms/op 0.85
altair processRewardsAndPenalties - 250000 normalcase 96.831 ms/op 90.780 ms/op 1.07
altair processRewardsAndPenalties - 250000 worstcase 118.28 ms/op 112.68 ms/op 1.05
altair processSyncCommitteeUpdates - 250000 411.69 ms/op 414.24 ms/op 0.99
Tree 40 250000 create 951.05 ms/op 670.31 ms/op 1.42
Tree 40 250000 get(125000) 290.21 ns/op 375.23 ns/op 0.77
Tree 40 250000 set(125000) 1.9684 us/op 2.1183 us/op 0.93
Tree 40 250000 toArray() 49.237 ms/op 46.336 ms/op 1.06
Tree 40 250000 iterate all - toArray() + loop 41.951 ms/op 47.059 ms/op 0.89
Tree 40 250000 iterate all - get(i) 126.14 ms/op 141.86 ms/op 0.89
MutableVector 250000 create 24.570 ms/op 23.127 ms/op 1.06
MutableVector 250000 get(125000) 18.852 ns/op 15.012 ns/op 1.26
MutableVector 250000 set(125000) 572.17 ns/op 563.46 ns/op 1.02
MutableVector 250000 toArray() 8.5852 ms/op 10.017 ms/op 0.86
MutableVector 250000 iterate all - toArray() + loop 7.3852 ms/op 10.073 ms/op 0.73
MutableVector 250000 iterate all - get(i) 3.2300 ms/op 4.3913 ms/op 0.74
Array 250000 create 4.6999 ms/op 5.8871 ms/op 0.80
Array 250000 clone - spread 2.0658 ms/op 2.4137 ms/op 0.86
Array 250000 get(125000) 1.0100 ns/op 1.1730 ns/op 0.86
Array 250000 set(125000) 1.0260 ns/op 1.1700 ns/op 0.88
Array 250000 iterate all - loop 128.75 us/op 193.96 us/op 0.66
effectiveBalanceIncrements clone Uint8Array 300000 66.140 us/op 79.845 us/op 0.83
effectiveBalanceIncrements clone MutableVector 300000 668.00 ns/op 751.00 ns/op 0.89
effectiveBalanceIncrements rw all Uint8Array 300000 160.96 us/op 350.20 us/op 0.46
effectiveBalanceIncrements rw all MutableVector 300000 183.00 ms/op 195.43 ms/op 0.94
aggregationBits - 2048 els - readonlyValues 185.55 us/op 207.22 us/op 0.90
aggregationBits - 2048 els - zipIndexesInBitList 37.752 us/op 39.445 us/op 0.96
regular array get 100000 times 53.981 us/op 77.958 us/op 0.69
wrappedArray get 100000 times 48.605 us/op 77.891 us/op 0.62
arrayWithProxy get 100000 times 29.836 ms/op 32.633 ms/op 0.91
ssz.Root.equals 1.1600 us/op 1.2580 us/op 0.92
ssz.Root.equals with valueOf() 1.5430 us/op 1.4760 us/op 1.05
byteArrayEquals with valueOf() 1.5140 us/op 1.4610 us/op 1.04
phase0 processBlock - 250000 vs - 7PWei normalcase 9.4709 ms/op 8.8693 ms/op 1.07
phase0 processBlock - 250000 vs - 7PWei worstcase 85.964 ms/op 84.731 ms/op 1.01
phase0 afterProcessEpoch - 250000 vs - 7PWei 201.25 ms/op 238.55 ms/op 0.84
phase0 beforeProcessEpoch - 250000 vs - 7PWei 697.65 ms/op 660.71 ms/op 1.06
phase0 processEpoch - mainnet_e58758 951.77 ms/op 953.78 ms/op 1.00
mainnet_e58758 - phase0 beforeProcessEpoch 522.85 ms/op 475.54 ms/op 1.10
mainnet_e58758 - phase0 processJustificationAndFinalization 101.61 us/op 67.560 us/op 1.50
mainnet_e58758 - phase0 processRewardsAndPenalties 91.627 ms/op 136.08 ms/op 0.67
mainnet_e58758 - phase0 processRegistryUpdates 76.369 us/op 40.443 us/op 1.89
mainnet_e58758 - phase0 processSlashings 6.2430 us/op 3.8270 us/op 1.63
mainnet_e58758 - phase0 processEth1DataReset 5.2580 us/op 3.2260 us/op 1.63
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 4.7855 ms/op 6.3987 ms/op 0.75
mainnet_e58758 - phase0 processSlashingsReset 27.362 us/op 13.699 us/op 2.00
mainnet_e58758 - phase0 processRandaoMixesReset 36.383 us/op 20.404 us/op 1.78
mainnet_e58758 - phase0 processHistoricalRootsUpdate 6.8690 us/op 4.0390 us/op 1.70
mainnet_e58758 - phase0 processParticipationRecordUpdates 25.546 us/op 14.577 us/op 1.75
mainnet_e58758 - phase0 afterProcessEpoch 169.55 ms/op 207.46 ms/op 0.82
phase0 processEffectiveBalanceUpdates - 250000 normalcase 5.4545 ms/op 7.2919 ms/op 0.75
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 6.8377 ms/op 8.0001 ms/op 0.85
phase0 processRegistryUpdates - 250000 normalcase 82.584 us/op 40.771 us/op 2.03
phase0 processRegistryUpdates - 250000 badcase_full_deposits 3.3598 ms/op 3.2298 ms/op 1.04
phase0 processRegistryUpdates - 250000 worstcase 0.5 2.2304 s/op 1.9181 s/op 1.16
phase0 getAttestationDeltas - 250000 normalcase 13.055 ms/op 15.190 ms/op 0.86
phase0 getAttestationDeltas - 250000 worstcase 12.829 ms/op 14.964 ms/op 0.86
phase0 processSlashings - 250000 worstcase 34.413 ms/op 34.527 ms/op 1.00
shuffle list - 16384 els 15.568 ms/op 14.401 ms/op 1.08
shuffle list - 250000 els 172.95 ms/op 209.91 ms/op 0.82
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 433.46 us/op 487.31 us/op 0.89
pass gossip attestations to forkchoice per slot 16.881 ms/op 18.832 ms/op 0.90
computeDeltas 3.1946 ms/op 4.0282 ms/op 0.79
computeProposerBoostScoreFromBalances 427.83 us/op 580.42 us/op 0.74
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.0787 ms/op 2.2655 ms/op 0.92
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 661.71 us/op 818.48 us/op 0.81
BLS verify - blst-native 1.9365 ms/op 2.1296 ms/op 0.91
BLS verifyMultipleSignatures 3 - blst-native 4.4076 ms/op 4.3753 ms/op 1.01
BLS verifyMultipleSignatures 8 - blst-native 9.2607 ms/op 9.3912 ms/op 0.99
BLS verifyMultipleSignatures 32 - blst-native 32.288 ms/op 34.196 ms/op 0.94
BLS aggregatePubkeys 32 - blst-native 42.745 us/op 45.861 us/op 0.93
BLS aggregatePubkeys 128 - blst-native 166.69 us/op 178.50 us/op 0.93
getAttestationsForBlock 68.352 ms/op 65.704 ms/op 1.04
CheckpointStateCache - add get delete 19.367 us/op 21.095 us/op 0.92
validate gossip signedAggregateAndProof - struct 4.4932 ms/op 5.2211 ms/op 0.86
validate gossip signedAggregateAndProof - treeBacked 4.5498 ms/op 5.2419 ms/op 0.87
validate gossip attestation - struct 2.2359 ms/op 2.3916 ms/op 0.93
validate gossip attestation - treeBacked 2.2477 ms/op 2.4974 ms/op 0.90
pickEth1Vote - no votes 8.1935 ms/op 9.5532 ms/op 0.86
pickEth1Vote - max votes 49.478 ms/op 57.375 ms/op 0.86
pickEth1Vote - Eth1Data hashTreeRoot value x2048 29.411 ms/op 28.180 ms/op 1.04
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 9.5527 ms/op 10.838 ms/op 0.88
pickEth1Vote - Eth1Data fastSerialize value x2048 4.6189 ms/op 5.7757 ms/op 0.80
pickEth1Vote - Eth1Data fastSerialize tree x2048 25.523 ms/op 26.895 ms/op 0.95
bytes32 toHexString 1.8040 us/op 1.7990 us/op 1.00
bytes32 Buffer.toString(hex) 730.00 ns/op 760.00 ns/op 0.96
bytes32 Buffer.toString(hex) from Uint8Array 961.00 ns/op 1.0660 us/op 0.90
bytes32 Buffer.toString(hex) + 0x 822.00 ns/op 781.00 ns/op 1.05
Object access 1 prop 0.41100 ns/op 0.37300 ns/op 1.10
Map access 1 prop 0.32000 ns/op 0.32700 ns/op 0.98
Object get x1000 15.788 ns/op 21.522 ns/op 0.73
Map get x1000 0.90500 ns/op 1.1860 ns/op 0.76
Object set x1000 106.79 ns/op 125.96 ns/op 0.85
Map set x1000 66.296 ns/op 71.175 ns/op 0.93
Return object 10000 times 0.40370 ns/op 0.41750 ns/op 0.97
Throw Error 10000 times 6.5299 us/op 6.6539 us/op 0.98
enrSubnets - fastDeserialize 64 bits 1.6010 us/op 1.3670 us/op 1.17
enrSubnets - ssz BitVector 64 bits 17.472 us/op 18.758 us/op 0.93
enrSubnets - fastDeserialize 4 bits 467.00 ns/op 517.00 ns/op 0.90
enrSubnets - ssz BitVector 4 bits 3.0920 us/op 3.4180 us/op 0.90
RateTracker 1000000 limit, 1 obj count per request 177.66 ns/op 204.68 ns/op 0.87
RateTracker 1000000 limit, 2 obj count per request 127.37 ns/op 150.09 ns/op 0.85
RateTracker 1000000 limit, 4 obj count per request 114.95 ns/op 122.54 ns/op 0.94
RateTracker 1000000 limit, 8 obj count per request 95.536 ns/op 112.04 ns/op 0.85
RateTracker with prune 3.9460 us/op 3.9900 us/op 0.99
array of 16000 items push then shift 4.9101 us/op 3.6506 us/op 1.35
LinkedList of 16000 items push then shift 16.423 ns/op 18.106 ns/op 0.91
array of 16000 items push then pop 224.83 ns/op 227.13 ns/op 0.99
LinkedList of 16000 items push then pop 14.729 ns/op 17.070 ns/op 0.86
array of 24000 items push then shift 6.6264 us/op 5.2787 us/op 1.26
LinkedList of 24000 items push then shift 15.555 ns/op 21.186 ns/op 0.73
array of 24000 items push then pop 177.24 ns/op 212.75 ns/op 0.83
LinkedList of 24000 items push then pop 14.480 ns/op 18.732 ns/op 0.77

by benchmarkbot/action

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.

Header API returns incorrect block
3 participants