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

Ignore attestations voting for the wrong finalized checkpoint #3916

Merged

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Apr 13, 2022

Motivation

We don't want to penalize syncing peers, so we IGNORE instead of REJECT attestations with wrong finalized checkpoint. Refer to ethereum/consensus-specs#2846 and ethereum/consensus-specs#2830

Description

  • No code change required for lodestar, just change comments and rename variables to follow the spec

@twoeths twoeths requested a review from a team as a code owner April 13, 2022 06:09
@github-actions
Copy link
Contributor

github-actions bot commented Apr 13, 2022

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: e446855 Previous: a81bf84 Ratio
BeaconState.hashTreeRoot - No change 685.00 ns/op 388.00 ns/op 1.77
BeaconState.hashTreeRoot - 1 full validator 67.799 us/op 49.936 us/op 1.36
BeaconState.hashTreeRoot - 32 full validator 653.15 us/op 480.94 us/op 1.36
BeaconState.hashTreeRoot - 512 full validator 7.0560 ms/op 5.9342 ms/op 1.19
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 82.324 us/op 69.030 us/op 1.19
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 1.1340 ms/op 961.50 us/op 1.18
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 15.653 ms/op 13.712 ms/op 1.14
BeaconState.hashTreeRoot - 1 balances 63.480 us/op 53.512 us/op 1.19
BeaconState.hashTreeRoot - 32 balances 567.74 us/op 467.04 us/op 1.22
BeaconState.hashTreeRoot - 512 balances 5.5417 ms/op 4.1727 ms/op 1.33
BeaconState.hashTreeRoot - 250000 balances 115.67 ms/op 94.450 ms/op 1.22
processSlot - 1 slots 11.550 us/op 9.1160 us/op 1.27
processSlot - 32 slots 1.9811 ms/op 1.4394 ms/op 1.38
getCommitteeAssignments - req 1 vs - 250000 vc 6.1464 ms/op 5.2825 ms/op 1.16
getCommitteeAssignments - req 100 vs - 250000 vc 8.5390 ms/op 7.4078 ms/op 1.15
getCommitteeAssignments - req 1000 vs - 250000 vc 9.2822 ms/op 7.2135 ms/op 1.29
computeProposers - vc 250000 19.421 ms/op 15.950 ms/op 1.22
computeEpochShuffling - vc 250000 185.69 ms/op 148.97 ms/op 1.25
getNextSyncCommittee - vc 250000 326.23 ms/op 258.83 ms/op 1.26
altair processAttestation - 250000 vs - 7PWei normalcase 4.5007 ms/op 4.5174 ms/op 1.00
altair processAttestation - 250000 vs - 7PWei worstcase 6.6959 ms/op 5.9770 ms/op 1.12
altair processAttestation - setStatus - 1/6 committees join 219.90 us/op 196.82 us/op 1.12
altair processAttestation - setStatus - 1/3 committees join 435.22 us/op 337.02 us/op 1.29
altair processAttestation - setStatus - 1/2 committees join 595.23 us/op 522.52 us/op 1.14
altair processAttestation - setStatus - 2/3 committees join 777.82 us/op 604.76 us/op 1.29
altair processAttestation - setStatus - 4/5 committees join 1.0775 ms/op 940.17 us/op 1.15
altair processAttestation - setStatus - 100% committees join 1.2698 ms/op 1.0100 ms/op 1.26
altair processBlock - 250000 vs - 7PWei normalcase 32.399 ms/op 24.285 ms/op 1.33
altair processBlock - 250000 vs - 7PWei normalcase hashState 39.426 ms/op 35.264 ms/op 1.12
altair processBlock - 250000 vs - 7PWei worstcase 83.047 ms/op 77.980 ms/op 1.06
altair processBlock - 250000 vs - 7PWei worstcase hashState 110.26 ms/op 93.880 ms/op 1.17
altair processEth1Data - 250000 vs - 7PWei normalcase 1.0124 ms/op 871.74 us/op 1.16
altair processEpoch - mainnet_e81889 540.40 ms/op 540.45 ms/op 1.00
mainnet_e81889 - altair beforeProcessEpoch 164.84 ms/op 134.92 ms/op 1.22
mainnet_e81889 - altair processJustificationAndFinalization 39.698 us/op 25.809 us/op 1.54
mainnet_e81889 - altair processInactivityUpdates 11.491 ms/op 11.230 ms/op 1.02
mainnet_e81889 - altair processRewardsAndPenalties 95.015 ms/op 81.624 ms/op 1.16
mainnet_e81889 - altair processRegistryUpdates 8.5840 us/op 3.6080 us/op 2.38
mainnet_e81889 - altair processSlashings 3.5500 us/op 1.1400 us/op 3.11
mainnet_e81889 - altair processEth1DataReset 3.4200 us/op 1.1280 us/op 3.03
mainnet_e81889 - altair processEffectiveBalanceUpdates 7.3548 ms/op 6.4589 ms/op 1.14
mainnet_e81889 - altair processSlashingsReset 10.740 us/op 5.1500 us/op 2.09
mainnet_e81889 - altair processRandaoMixesReset 13.212 us/op 6.2200 us/op 2.12
mainnet_e81889 - altair processHistoricalRootsUpdate 4.0880 us/op 1.3800 us/op 2.96
mainnet_e81889 - altair processParticipationFlagUpdates 7.8050 us/op 8.3110 us/op 0.94
mainnet_e81889 - altair processSyncCommitteeUpdates 3.2410 us/op 2.7970 us/op 1.16
mainnet_e81889 - altair afterProcessEpoch 220.84 ms/op 203.21 ms/op 1.09
altair processInactivityUpdates - 250000 normalcase 38.529 ms/op 40.973 ms/op 0.94
altair processInactivityUpdates - 250000 worstcase 30.969 ms/op 51.839 ms/op 0.60
altair processRewardsAndPenalties - 250000 normalcase 91.769 ms/op 144.23 ms/op 0.64
altair processRewardsAndPenalties - 250000 worstcase 127.63 ms/op 144.42 ms/op 0.88
altair processSyncCommitteeUpdates - 250000 333.53 ms/op 299.08 ms/op 1.12
Tree 40 250000 create 702.34 ms/op 797.08 ms/op 0.88
Tree 40 250000 get(125000) 325.49 ns/op 279.98 ns/op 1.16
Tree 40 250000 set(125000) 2.2868 us/op 2.2929 us/op 1.00
Tree 40 250000 toArray() 34.787 ms/op 32.659 ms/op 1.07
Tree 40 250000 iterate all - toArray() + loop 34.800 ms/op 33.717 ms/op 1.03
Tree 40 250000 iterate all - get(i) 124.94 ms/op 99.526 ms/op 1.26
MutableVector 250000 create 16.652 ms/op 24.142 ms/op 0.69
MutableVector 250000 get(125000) 15.196 ns/op 15.325 ns/op 0.99
MutableVector 250000 set(125000) 596.89 ns/op 619.50 ns/op 0.96
MutableVector 250000 toArray() 7.2715 ms/op 6.4916 ms/op 1.12
MutableVector 250000 iterate all - toArray() + loop 7.3924 ms/op 6.8700 ms/op 1.08
MutableVector 250000 iterate all - get(i) 3.8249 ms/op 3.4455 ms/op 1.11
Array 250000 create 6.1328 ms/op 6.0012 ms/op 1.02
Array 250000 clone - spread 2.7126 ms/op 1.9079 ms/op 1.42
Array 250000 get(125000) 1.2220 ns/op 0.88000 ns/op 1.39
Array 250000 set(125000) 1.2510 ns/op 0.87000 ns/op 1.44
Array 250000 iterate all - loop 192.90 us/op 148.10 us/op 1.30
effectiveBalanceIncrements clone Uint8Array 300000 79.193 us/op 73.897 us/op 1.07
effectiveBalanceIncrements clone MutableVector 300000 811.00 ns/op 546.00 ns/op 1.49
effectiveBalanceIncrements rw all Uint8Array 300000 340.49 us/op 266.42 us/op 1.28
effectiveBalanceIncrements rw all MutableVector 300000 195.09 ms/op 182.86 ms/op 1.07
aggregationBits - 2048 els - zipIndexesInBitList 30.378 us/op 30.884 us/op 0.98
regular array get 100000 times 78.246 us/op 59.480 us/op 1.32
wrappedArray get 100000 times 78.596 us/op 59.595 us/op 1.32
arrayWithProxy get 100000 times 33.419 ms/op 26.235 ms/op 1.27
ssz.Root.equals 527.00 ns/op 422.00 ns/op 1.25
byteArrayEquals 513.00 ns/op 410.00 ns/op 1.25
phase0 processBlock - 250000 vs - 7PWei normalcase 3.9260 ms/op 3.5218 ms/op 1.11
phase0 processBlock - 250000 vs - 7PWei worstcase 51.459 ms/op 41.943 ms/op 1.23
phase0 afterProcessEpoch - 250000 vs - 7PWei 224.67 ms/op 161.65 ms/op 1.39
phase0 beforeProcessEpoch - 250000 vs - 7PWei 78.364 ms/op 148.67 ms/op 0.53
phase0 processEpoch - mainnet_e58758 641.48 ms/op 691.22 ms/op 0.93
mainnet_e58758 - phase0 beforeProcessEpoch 229.93 ms/op 320.84 ms/op 0.72
mainnet_e58758 - phase0 processJustificationAndFinalization 44.080 us/op 26.694 us/op 1.65
mainnet_e58758 - phase0 processRewardsAndPenalties 88.338 ms/op 135.97 ms/op 0.65
mainnet_e58758 - phase0 processRegistryUpdates 20.421 us/op 9.8550 us/op 2.07
mainnet_e58758 - phase0 processSlashings 4.7890 us/op 1.1060 us/op 4.33
mainnet_e58758 - phase0 processEth1DataReset 3.6490 us/op 1.0320 us/op 3.54
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 6.3524 ms/op 4.7450 ms/op 1.34
mainnet_e58758 - phase0 processSlashingsReset 13.991 us/op 5.8540 us/op 2.39
mainnet_e58758 - phase0 processRandaoMixesReset 16.600 us/op 6.4500 us/op 2.57
mainnet_e58758 - phase0 processHistoricalRootsUpdate 4.0930 us/op 1.1560 us/op 3.54
mainnet_e58758 - phase0 processParticipationRecordUpdates 15.178 us/op 5.2930 us/op 2.87
mainnet_e58758 - phase0 afterProcessEpoch 181.22 ms/op 148.11 ms/op 1.22
phase0 processEffectiveBalanceUpdates - 250000 normalcase 7.3666 ms/op 6.4705 ms/op 1.14
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 7.9152 ms/op 6.8433 ms/op 1.16
phase0 processRegistryUpdates - 250000 normalcase 22.386 us/op 8.4030 us/op 2.66
phase0 processRegistryUpdates - 250000 badcase_full_deposits 563.93 us/op 370.78 us/op 1.52
phase0 processRegistryUpdates - 250000 worstcase 0.5 238.94 ms/op 275.25 ms/op 0.87
phase0 getAttestationDeltas - 250000 normalcase 16.872 ms/op 13.835 ms/op 1.22
phase0 getAttestationDeltas - 250000 worstcase 16.388 ms/op 14.421 ms/op 1.14
phase0 processSlashings - 250000 worstcase 6.5903 ms/op 5.6902 ms/op 1.16
shuffle list - 16384 els 12.111 ms/op 9.4780 ms/op 1.28
shuffle list - 250000 els 175.07 ms/op 136.68 ms/op 1.28
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 443.04 us/op 363.39 us/op 1.22
pass gossip attestations to forkchoice per slot 3.9298 ms/op 3.7293 ms/op 1.05
computeDeltas 4.0467 ms/op 5.1460 ms/op 0.79
computeProposerBoostScoreFromBalances 574.99 us/op 503.12 us/op 1.14
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 2.3114 ms/op 2.4644 ms/op 0.94
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 84.326 us/op 74.321 us/op 1.13
BLS verify - blst-native 2.1681 ms/op 1.6407 ms/op 1.32
BLS verifyMultipleSignatures 3 - blst-native 4.4099 ms/op 3.3599 ms/op 1.31
BLS verifyMultipleSignatures 8 - blst-native 9.4041 ms/op 7.2256 ms/op 1.30
BLS verifyMultipleSignatures 32 - blst-native 34.160 ms/op 26.193 ms/op 1.30
BLS aggregatePubkeys 32 - blst-native 45.160 us/op 35.109 us/op 1.29
BLS aggregatePubkeys 128 - blst-native 173.38 us/op 135.50 us/op 1.28
getAttestationsForBlock 67.295 ms/op 58.601 ms/op 1.15
CheckpointStateCache - add get delete 11.696 us/op 10.810 us/op 1.08
validate gossip signedAggregateAndProof - struct 4.8318 ms/op 4.2866 ms/op 1.13
validate gossip attestation - struct 2.3637 ms/op 2.0279 ms/op 1.17
pickEth1Vote - no votes 2.7667 ms/op 2.2395 ms/op 1.24
pickEth1Vote - max votes 20.918 ms/op 21.184 ms/op 0.99
pickEth1Vote - Eth1Data hashTreeRoot value x2048 13.727 ms/op 10.967 ms/op 1.25
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 24.285 ms/op 28.587 ms/op 0.85
pickEth1Vote - Eth1Data fastSerialize value x2048 2.0258 ms/op 1.7358 ms/op 1.17
pickEth1Vote - Eth1Data fastSerialize tree x2048 13.957 ms/op 14.370 ms/op 0.97
bytes32 toHexString 1.0890 us/op 926.00 ns/op 1.18
bytes32 Buffer.toString(hex) 764.00 ns/op 647.00 ns/op 1.18
bytes32 Buffer.toString(hex) from Uint8Array 955.00 ns/op 840.00 ns/op 1.14
bytes32 Buffer.toString(hex) + 0x 757.00 ns/op 653.00 ns/op 1.16
Object access 1 prop 0.37300 ns/op 0.31600 ns/op 1.18
Map access 1 prop 0.33800 ns/op 0.27300 ns/op 1.24
Object get x1000 19.920 ns/op 15.405 ns/op 1.29
Map get x1000 1.1160 ns/op 0.90600 ns/op 1.23
Object set x1000 120.93 ns/op 99.225 ns/op 1.22
Map set x1000 73.011 ns/op 60.164 ns/op 1.21
Return object 10000 times 0.43190 ns/op 0.32800 ns/op 1.32
Throw Error 10000 times 6.8947 us/op 5.1339 us/op 1.34
enrSubnets - fastDeserialize 64 bits 978.00 ns/op 864.00 ns/op 1.13
enrSubnets - ssz BitVector 64 bits 670.00 ns/op 548.00 ns/op 1.22
enrSubnets - fastDeserialize 4 bits 457.00 ns/op 384.00 ns/op 1.19
enrSubnets - ssz BitVector 4 bits 665.00 ns/op 544.00 ns/op 1.22
RateTracker 1000000 limit, 1 obj count per request 202.08 ns/op 164.53 ns/op 1.23
RateTracker 1000000 limit, 2 obj count per request 157.69 ns/op 123.74 ns/op 1.27
RateTracker 1000000 limit, 4 obj count per request 128.16 ns/op 104.11 ns/op 1.23
RateTracker 1000000 limit, 8 obj count per request 114.04 ns/op 95.234 ns/op 1.20
RateTracker with prune 4.1200 us/op 4.0590 us/op 1.02
array of 16000 items push then shift 3.5531 us/op 2.7927 us/op 1.27
LinkedList of 16000 items push then shift 18.500 ns/op 17.333 ns/op 1.07
array of 16000 items push then pop 231.97 ns/op 200.38 ns/op 1.16
LinkedList of 16000 items push then pop 16.927 ns/op 15.817 ns/op 1.07
array of 24000 items push then shift 5.2229 us/op 4.0458 us/op 1.29
LinkedList of 24000 items push then shift 20.807 ns/op 22.439 ns/op 0.93
array of 24000 items push then pop 207.45 ns/op 204.94 ns/op 1.01
LinkedList of 24000 items push then pop 18.796 ns/op 19.944 ns/op 0.94

by benchmarkbot/action

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #3916 (fd133a0) into master (a81bf84) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3916      +/-   ##
==========================================
- Coverage   36.63%   36.63%   -0.01%     
==========================================
  Files         324      324              
  Lines        8952     8954       +2     
  Branches     1407     1409       +2     
==========================================
  Hits         3280     3280              
- Misses       5528     5530       +2     
  Partials      144      144              

@wemeetagain wemeetagain merged commit 053f76a into master Apr 13, 2022
@wemeetagain wemeetagain deleted the tuyen/ignore-attestations-not-follow-finalized-checkpoint branch April 13, 2022 16:16
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