Skip to content

Ignore attestation messages if cannot regen head states - #5375

Merged
wemeetagain merged 1 commit into
unstablefrom
tuyen/rejected_attestation_messages
Apr 20, 2023
Merged

Ignore attestation messages if cannot regen head states#5375
wemeetagain merged 1 commit into
unstablefrom
tuyen/rejected_attestation_messages

Conversation

@twoeths

@twoeths twoeths commented Apr 18, 2023

Copy link
Copy Markdown
Member

Motivation

We validate gossip attestations, they have correct head and target root in forkchoice but we cannot regen head states and we rejected them. As a result we applied p4 penalties to our peers and peer score dropped, see #5373

Description

  • In this case it's our bad that we cannot regen states, should not reject messages (and then apply p4 penalties to our peers)
  • Change to IGNORE instead

Closes #5373

@twoeths
twoeths requested a review from a team as a code owner April 18, 2023 08:44
@github-actions

Copy link
Copy Markdown
Contributor

Performance Report

鉁旓笍 no performance regression detected

Full benchmark results
Benchmark suite Current: 4d6c2c5 Previous: 3ee1d8a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 684.71 us/op 658.68 us/op 1.04
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 44.911 us/op 73.017 us/op 0.62
BLS verify - blst-native 1.2125 ms/op 1.5452 ms/op 0.78
BLS verifyMultipleSignatures 3 - blst-native 2.5177 ms/op 2.8105 ms/op 0.90
BLS verifyMultipleSignatures 8 - blst-native 5.3800 ms/op 6.1640 ms/op 0.87
BLS verifyMultipleSignatures 32 - blst-native 19.254 ms/op 21.703 ms/op 0.89
BLS aggregatePubkeys 32 - blst-native 25.804 us/op 31.925 us/op 0.81
BLS aggregatePubkeys 128 - blst-native 100.75 us/op 123.56 us/op 0.82
getAttestationsForBlock 55.768 ms/op 85.264 ms/op 0.65
isKnown best case - 1 super set check 250.00 ns/op 360.00 ns/op 0.69
isKnown normal case - 2 super set checks 240.00 ns/op 315.00 ns/op 0.76
isKnown worse case - 16 super set checks 244.00 ns/op 287.00 ns/op 0.85
CheckpointStateCache - add get delete 5.4560 us/op 6.6350 us/op 0.82
validate gossip signedAggregateAndProof - struct 2.7931 ms/op 3.0157 ms/op 0.93
validate gossip attestation - struct 1.3297 ms/op 1.4512 ms/op 0.92
pickEth1Vote - no votes 1.2787 ms/op 1.7514 ms/op 0.73
pickEth1Vote - max votes 9.9933 ms/op 18.516 ms/op 0.54
pickEth1Vote - Eth1Data hashTreeRoot value x2048 9.1206 ms/op 11.406 ms/op 0.80
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 14.064 ms/op 23.227 ms/op 0.61
pickEth1Vote - Eth1Data fastSerialize value x2048 649.60 us/op 883.92 us/op 0.73
pickEth1Vote - Eth1Data fastSerialize tree x2048 4.5975 ms/op 7.1139 ms/op 0.65
bytes32 toHexString 526.00 ns/op 1.1280 us/op 0.47
bytes32 Buffer.toString(hex) 371.00 ns/op 802.00 ns/op 0.46
bytes32 Buffer.toString(hex) from Uint8Array 582.00 ns/op 1.0850 us/op 0.54
bytes32 Buffer.toString(hex) + 0x 356.00 ns/op 701.00 ns/op 0.51
Object access 1 prop 0.16500 ns/op 0.33300 ns/op 0.50
Map access 1 prop 0.15900 ns/op 0.20900 ns/op 0.76
Object get x1000 6.9260 ns/op 9.8060 ns/op 0.71
Map get x1000 0.54200 ns/op 0.66600 ns/op 0.81
Object set x1000 55.250 ns/op 93.298 ns/op 0.59
Map set x1000 47.161 ns/op 69.989 ns/op 0.67
Return object 10000 times 0.24510 ns/op 0.41070 ns/op 0.60
Throw Error 10000 times 4.2831 us/op 5.7164 us/op 0.75
fastMsgIdFn sha256 / 200 bytes 3.5920 us/op 4.1650 us/op 0.86
fastMsgIdFn h32 xxhash / 200 bytes 322.00 ns/op 343.00 ns/op 0.94
fastMsgIdFn h64 xxhash / 200 bytes 483.00 ns/op 564.00 ns/op 0.86
fastMsgIdFn sha256 / 1000 bytes 11.892 us/op 13.297 us/op 0.89
fastMsgIdFn h32 xxhash / 1000 bytes 455.00 ns/op 623.00 ns/op 0.73
fastMsgIdFn h64 xxhash / 1000 bytes 541.00 ns/op 633.00 ns/op 0.85
fastMsgIdFn sha256 / 10000 bytes 104.57 us/op 112.08 us/op 0.93
fastMsgIdFn h32 xxhash / 10000 bytes 1.9610 us/op 2.7800 us/op 0.71
fastMsgIdFn h64 xxhash / 10000 bytes 1.3890 us/op 1.9700 us/op 0.71
enrSubnets - fastDeserialize 64 bits 1.4510 us/op 2.3290 us/op 0.62
enrSubnets - ssz BitVector 64 bits 605.00 ns/op 754.00 ns/op 0.80
enrSubnets - fastDeserialize 4 bits 186.00 ns/op 236.00 ns/op 0.79
enrSubnets - ssz BitVector 4 bits 568.00 ns/op 709.00 ns/op 0.80
prioritizePeers score -10:0 att 32-0.1 sync 2-0 110.24 us/op 148.69 us/op 0.74
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 153.12 us/op 166.32 us/op 0.92
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 195.38 us/op 216.13 us/op 0.90
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 342.71 us/op 369.81 us/op 0.93
prioritizePeers score 0:0 att 64-1 sync 4-1 387.01 us/op 436.28 us/op 0.89
array of 16000 items push then shift 1.6968 us/op 1.7603 us/op 0.96
LinkedList of 16000 items push then shift 8.9060 ns/op 9.5160 ns/op 0.94
array of 16000 items push then pop 109.98 ns/op 107.72 ns/op 1.02
LinkedList of 16000 items push then pop 8.6040 ns/op 10.069 ns/op 0.85
array of 24000 items push then shift 2.3685 us/op 2.5173 us/op 0.94
LinkedList of 24000 items push then shift 8.7680 ns/op 9.7060 ns/op 0.90
array of 24000 items push then pop 76.339 ns/op 97.529 ns/op 0.78
LinkedList of 24000 items push then pop 8.5780 ns/op 9.4600 ns/op 0.91
intersect bitArray bitLen 8 13.514 ns/op 14.163 ns/op 0.95
intersect array and set length 8 79.419 ns/op 95.880 ns/op 0.83
intersect bitArray bitLen 128 43.407 ns/op 46.131 ns/op 0.94
intersect array and set length 128 1.0421 us/op 1.1444 us/op 0.91
Buffer.concat 32 items 2.6950 us/op 2.8990 us/op 0.93
Uint8Array.set 32 items 2.6250 us/op 2.3900 us/op 1.10
pass gossip attestations to forkchoice per slot 3.3938 ms/op 3.4208 ms/op 0.99
computeDeltas 3.2021 ms/op 3.1559 ms/op 1.01
computeProposerBoostScoreFromBalances 1.7916 ms/op 1.8256 ms/op 0.98
altair processAttestation - 250000 vs - 7PWei normalcase 2.6058 ms/op 2.5118 ms/op 1.04
altair processAttestation - 250000 vs - 7PWei worstcase 4.3137 ms/op 3.3563 ms/op 1.29
altair processAttestation - setStatus - 1/6 committees join 140.89 us/op 143.01 us/op 0.99
altair processAttestation - setStatus - 1/3 committees join 282.34 us/op 290.01 us/op 0.97
altair processAttestation - setStatus - 1/2 committees join 379.11 us/op 387.47 us/op 0.98
altair processAttestation - setStatus - 2/3 committees join 485.35 us/op 481.20 us/op 1.01
altair processAttestation - setStatus - 4/5 committees join 662.19 us/op 661.15 us/op 1.00
altair processAttestation - setStatus - 100% committees join 796.40 us/op 786.94 us/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 18.155 ms/op 20.485 ms/op 0.89
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.153 ms/op 27.502 ms/op 1.02
altair processBlock - 250000 vs - 7PWei worstcase 52.874 ms/op 55.693 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 72.012 ms/op 69.902 ms/op 1.03
phase0 processBlock - 250000 vs - 7PWei normalcase 2.4628 ms/op 2.3265 ms/op 1.06
phase0 processBlock - 250000 vs - 7PWei worstcase 29.986 ms/op 31.828 ms/op 0.94
altair processEth1Data - 250000 vs - 7PWei normalcase 508.19 us/op 643.56 us/op 0.79
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 9.0760 us/op 11.807 us/op 0.77
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 29.671 us/op 33.290 us/op 0.89
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 12.672 us/op 16.163 us/op 0.78
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.8920 us/op 13.454 us/op 0.66
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 106.75 us/op 112.14 us/op 0.95
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 655.86 us/op 686.20 us/op 0.96
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 940.14 us/op 923.55 us/op 1.02
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 884.23 us/op 920.37 us/op 0.96
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.3902 ms/op 2.4680 ms/op 0.97
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.5697 ms/op 1.7702 ms/op 0.89
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 3.7658 ms/op 4.1512 ms/op 0.91
Tree 40 250000 create 326.91 ms/op 350.82 ms/op 0.93
Tree 40 250000 get(125000) 181.35 ns/op 197.48 ns/op 0.92
Tree 40 250000 set(125000) 901.40 ns/op 1.0060 us/op 0.90
Tree 40 250000 toArray() 18.289 ms/op 23.063 ms/op 0.79
Tree 40 250000 iterate all - toArray() + loop 17.367 ms/op 22.446 ms/op 0.77
Tree 40 250000 iterate all - get(i) 66.376 ms/op 77.085 ms/op 0.86
MutableVector 250000 create 10.065 ms/op 13.378 ms/op 0.75
MutableVector 250000 get(125000) 6.8400 ns/op 6.7980 ns/op 1.01
MutableVector 250000 set(125000) 236.32 ns/op 347.93 ns/op 0.68
MutableVector 250000 toArray() 2.7207 ms/op 4.2729 ms/op 0.64
MutableVector 250000 iterate all - toArray() + loop 2.9857 ms/op 4.8280 ms/op 0.62
MutableVector 250000 iterate all - get(i) 1.7649 ms/op 1.5993 ms/op 1.10
Array 250000 create 2.6917 ms/op 4.3121 ms/op 0.62
Array 250000 clone - spread 1.1070 ms/op 1.3026 ms/op 0.85
Array 250000 get(125000) 0.53500 ns/op 0.94600 ns/op 0.57
Array 250000 set(125000) 0.61400 ns/op 0.80300 ns/op 0.76
Array 250000 iterate all - loop 82.167 us/op 92.943 us/op 0.88
effectiveBalanceIncrements clone Uint8Array 300000 25.035 us/op 57.871 us/op 0.43
effectiveBalanceIncrements clone MutableVector 300000 323.00 ns/op 373.00 ns/op 0.87
effectiveBalanceIncrements rw all Uint8Array 300000 163.53 us/op 176.43 us/op 0.93
effectiveBalanceIncrements rw all MutableVector 300000 75.669 ms/op 101.66 ms/op 0.74
phase0 afterProcessEpoch - 250000 vs - 7PWei 113.87 ms/op 123.76 ms/op 0.92
phase0 beforeProcessEpoch - 250000 vs - 7PWei 43.314 ms/op 49.524 ms/op 0.87
altair processEpoch - mainnet_e81889 304.20 ms/op 425.54 ms/op 0.71
mainnet_e81889 - altair beforeProcessEpoch 54.613 ms/op 81.422 ms/op 0.67
mainnet_e81889 - altair processJustificationAndFinalization 19.630 us/op 29.781 us/op 0.66
mainnet_e81889 - altair processInactivityUpdates 6.6705 ms/op 8.2146 ms/op 0.81
mainnet_e81889 - altair processRewardsAndPenalties 61.072 ms/op 71.095 ms/op 0.86
mainnet_e81889 - altair processRegistryUpdates 2.6780 us/op 7.1270 us/op 0.38
mainnet_e81889 - altair processSlashings 610.00 ns/op 1.4090 us/op 0.43
mainnet_e81889 - altair processEth1DataReset 469.00 ns/op 1.3950 us/op 0.34
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.2471 ms/op 1.5164 ms/op 0.82
mainnet_e81889 - altair processSlashingsReset 4.8580 us/op 7.1660 us/op 0.68
mainnet_e81889 - altair processRandaoMixesReset 4.3700 us/op 6.7130 us/op 0.65
mainnet_e81889 - altair processHistoricalRootsUpdate 573.00 ns/op 1.9990 us/op 0.29
mainnet_e81889 - altair processParticipationFlagUpdates 2.3320 us/op 6.1730 us/op 0.38
mainnet_e81889 - altair processSyncCommitteeUpdates 726.00 ns/op 1.4880 us/op 0.49
mainnet_e81889 - altair afterProcessEpoch 126.33 ms/op 149.70 ms/op 0.84
phase0 processEpoch - mainnet_e58758 361.78 ms/op 444.69 ms/op 0.81
mainnet_e58758 - phase0 beforeProcessEpoch 132.77 ms/op 134.90 ms/op 0.98
mainnet_e58758 - phase0 processJustificationAndFinalization 18.651 us/op 27.476 us/op 0.68
mainnet_e58758 - phase0 processRewardsAndPenalties 64.754 ms/op 70.699 ms/op 0.92
mainnet_e58758 - phase0 processRegistryUpdates 7.7960 us/op 14.284 us/op 0.55
mainnet_e58758 - phase0 processSlashings 431.00 ns/op 1.0530 us/op 0.41
mainnet_e58758 - phase0 processEth1DataReset 475.00 ns/op 1.2260 us/op 0.39
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 989.42 us/op 1.5000 ms/op 0.66
mainnet_e58758 - phase0 processSlashingsReset 3.4040 us/op 6.2220 us/op 0.55
mainnet_e58758 - phase0 processRandaoMixesReset 4.1000 us/op 6.6790 us/op 0.61
mainnet_e58758 - phase0 processHistoricalRootsUpdate 537.00 ns/op 1.1160 us/op 0.48
mainnet_e58758 - phase0 processParticipationRecordUpdates 3.8950 us/op 7.3340 us/op 0.53
mainnet_e58758 - phase0 afterProcessEpoch 97.467 ms/op 102.16 ms/op 0.95
phase0 processEffectiveBalanceUpdates - 250000 normalcase 1.2131 ms/op 1.3140 ms/op 0.92
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 1.4761 ms/op 1.6430 ms/op 0.90
altair processInactivityUpdates - 250000 normalcase 22.742 ms/op 28.711 ms/op 0.79
altair processInactivityUpdates - 250000 worstcase 25.314 ms/op 30.407 ms/op 0.83
phase0 processRegistryUpdates - 250000 normalcase 6.7270 us/op 12.981 us/op 0.52
phase0 processRegistryUpdates - 250000 badcase_full_deposits 233.49 us/op 311.10 us/op 0.75
phase0 processRegistryUpdates - 250000 worstcase 0.5 121.12 ms/op 146.66 ms/op 0.83
altair processRewardsAndPenalties - 250000 normalcase 63.046 ms/op 81.168 ms/op 0.78
altair processRewardsAndPenalties - 250000 worstcase 64.333 ms/op 92.432 ms/op 0.70
phase0 getAttestationDeltas - 250000 normalcase 6.6695 ms/op 11.963 ms/op 0.56
phase0 getAttestationDeltas - 250000 worstcase 6.7445 ms/op 10.357 ms/op 0.65
phase0 processSlashings - 250000 worstcase 3.4260 ms/op 5.5399 ms/op 0.62
altair processSyncCommitteeUpdates - 250000 179.42 ms/op 225.83 ms/op 0.79
BeaconState.hashTreeRoot - No change 263.00 ns/op 322.00 ns/op 0.82
BeaconState.hashTreeRoot - 1 full validator 52.504 us/op 58.838 us/op 0.89
BeaconState.hashTreeRoot - 32 full validator 563.30 us/op 711.85 us/op 0.79
BeaconState.hashTreeRoot - 512 full validator 5.7717 ms/op 8.2085 ms/op 0.70
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 64.711 us/op 84.581 us/op 0.77
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 942.50 us/op 1.0802 ms/op 0.87
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 12.945 ms/op 13.780 ms/op 0.94
BeaconState.hashTreeRoot - 1 balances 53.245 us/op 62.297 us/op 0.85
BeaconState.hashTreeRoot - 32 balances 448.48 us/op 497.45 us/op 0.90
BeaconState.hashTreeRoot - 512 balances 4.5984 ms/op 5.4217 ms/op 0.85
BeaconState.hashTreeRoot - 250000 balances 76.804 ms/op 77.157 ms/op 1.00
aggregationBits - 2048 els - zipIndexesInBitList 16.691 us/op 23.956 us/op 0.70
regular array get 100000 times 33.731 us/op 35.036 us/op 0.96
wrappedArray get 100000 times 33.078 us/op 35.011 us/op 0.94
arrayWithProxy get 100000 times 17.161 ms/op 17.318 ms/op 0.99
ssz.Root.equals 576.00 ns/op 745.00 ns/op 0.77
byteArrayEquals 562.00 ns/op 780.00 ns/op 0.72
shuffle list - 16384 els 7.0648 ms/op 8.5130 ms/op 0.83
shuffle list - 250000 els 105.61 ms/op 121.32 ms/op 0.87
processSlot - 1 slots 10.880 us/op 10.698 us/op 1.02
processSlot - 32 slots 1.4459 ms/op 1.6695 ms/op 0.87
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 36.800 ms/op 41.303 ms/op 0.89
getCommitteeAssignments - req 1 vs - 250000 vc 2.9266 ms/op 3.2463 ms/op 0.90
getCommitteeAssignments - req 100 vs - 250000 vc 4.1757 ms/op 4.6956 ms/op 0.89
getCommitteeAssignments - req 1000 vs - 250000 vc 4.5208 ms/op 5.0823 ms/op 0.89
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8100 ns/op 5.7900 ns/op 0.83
state getBlockRootAtSlot - 250000 vs - 7PWei 599.53 ns/op 950.30 ns/op 0.63
computeProposers - vc 250000 10.747 ms/op 12.516 ms/op 0.86
computeEpochShuffling - vc 250000 105.11 ms/op 122.33 ms/op 0.86
getNextSyncCommittee - vc 250000 177.02 ms/op 194.91 ms/op 0.91
computeSigningRoot for AttestationData 14.184 us/op 15.228 us/op 0.93
hash AttestationData serialized data then Buffer.toString(base64) 2.5349 us/op 2.6270 us/op 0.96
toHexString serialized data 1.1135 us/op 1.4739 us/op 0.76
Buffer.toString(base64) 324.36 ns/op 381.41 ns/op 0.85

by benchmarkbot/action

@wemeetagain
wemeetagain merged commit 12c3ea7 into unstable Apr 20, 2023
@wemeetagain
wemeetagain deleted the tuyen/rejected_attestation_messages branch April 20, 2023 14:08
@wemeetagain

Copy link
Copy Markdown
Member

馃帀 This PR is included in v1.8.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.

Rejected attestation messages

2 participants