File tree Expand file tree Collapse file tree 2 files changed +11
-25
lines changed
network/src/network_beacon_processor Expand file tree Collapse file tree 2 files changed +11
-25
lines changed Original file line number Diff line number Diff line change @@ -1368,12 +1368,19 @@ fn verify_attestation_is_finalized_checkpoint_or_descendant<T: BeaconChainTypes>
1368
1368
chain : & BeaconChain < T > ,
1369
1369
) -> bool {
1370
1370
// If we have a split block newer than finalization then we also ban attestations which are not
1371
- // descended from that split block.
1371
+ // descended from that split block. It's important not to try checking `is_descendant` if
1372
+ // finality is ahead of the split and the split block has been pruned, as `is_descendant` will
1373
+ // return `false` in this case.
1372
1374
let fork_choice = chain. canonical_head . fork_choice_read_lock ( ) ;
1373
- let split = chain. store . get_split_info ( ) ;
1374
1375
let attestation_block_root = attestation_data. beacon_block_root ;
1375
- let is_descendant_from_split_block =
1376
- split. slot == 0 || fork_choice. is_descendant ( split. block_root , attestation_block_root) ;
1376
+ let finalized_slot = fork_choice
1377
+ . finalized_checkpoint ( )
1378
+ . epoch
1379
+ . start_slot ( T :: EthSpec :: slots_per_epoch ( ) ) ;
1380
+ let split = chain. store . get_split_info ( ) ;
1381
+ let is_descendant_from_split_block = split. slot == 0
1382
+ || split. slot <= finalized_slot
1383
+ || fork_choice. is_descendant ( split. block_root , attestation_block_root) ;
1377
1384
1378
1385
fork_choice. is_finalized_checkpoint_or_descendant ( attestation_block_root)
1379
1386
&& is_descendant_from_split_block
Original file line number Diff line number Diff line change @@ -2893,27 +2893,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
2893
2893
) ;
2894
2894
self . propagate_validation_result ( message_id, peer_id, MessageAcceptance :: Ignore ) ;
2895
2895
}
2896
- AttnError :: NotFinalizedDescendant {
2897
- attestation_block_root,
2898
- attestation_slot,
2899
- } => {
2900
- error ! (
2901
- self . log,
2902
- "Could not verify the attestation for gossip. Rejecting the attestation" ;
2903
- "attestation_block_root" => ?attestation_block_root,
2904
- "slot" => ?attestation_slot,
2905
- "type" => ?attestation_type,
2906
- "peer_id" => %peer_id,
2907
- ) ;
2908
- // There's no reason for an honest and non-buggy client to be gossiping
2909
- // attestations that blatantly conflict with finalization.
2910
- self . gossip_penalize_peer (
2911
- peer_id,
2912
- PeerAction :: LowToleranceError ,
2913
- "gossip_attestation_invalid" ,
2914
- ) ;
2915
- self . propagate_validation_result ( message_id, peer_id, MessageAcceptance :: Reject ) ;
2916
- }
2917
2896
}
2918
2897
2919
2898
debug ! (
You can’t perform that action at this time.
0 commit comments