@@ -141,8 +141,6 @@ pub enum BlockError<T: EthSpec> {
141
141
/// It's unclear if this block is valid, but it cannot be processed without already knowing
142
142
/// its parent.
143
143
ParentUnknown ( Arc < SignedBeaconBlock < T > > ) ,
144
- /// The block skips too many slots and is a DoS risk.
145
- TooManySkippedSlots { parent_slot : Slot , block_slot : Slot } ,
146
144
/// The block slot is greater than the present slot.
147
145
///
148
146
/// ## Peer scoring
@@ -786,9 +784,6 @@ impl<T: BeaconChainTypes> GossipVerifiedBlock<T> {
786
784
parent_block. root
787
785
} ;
788
786
789
- // Reject any block that exceeds our limit on skipped slots.
790
- check_block_skip_slots ( chain, parent_block. slot , block. message ( ) ) ?;
791
-
792
787
// We assign to a variable instead of using `if let Some` directly to ensure we drop the
793
788
// write lock before trying to acquire it again in the `else` clause.
794
789
let proposer_opt = chain
@@ -942,9 +937,6 @@ impl<T: BeaconChainTypes> SignatureVerifiedBlock<T> {
942
937
943
938
let ( mut parent, block) = load_parent ( block_root, block, chain) ?;
944
939
945
- // Reject any block that exceeds our limit on skipped slots.
946
- check_block_skip_slots ( chain, parent. beacon_block . slot ( ) , block. message ( ) ) ?;
947
-
948
940
let state = cheap_state_advance_to_obtain_committees (
949
941
& mut parent. pre_state ,
950
942
parent. beacon_state_root ,
@@ -1135,9 +1127,6 @@ impl<T: BeaconChainTypes> ExecutionPendingBlock<T> {
1135
1127
return Err ( BlockError :: ParentUnknown ( block) ) ;
1136
1128
}
1137
1129
1138
- // Reject any block that exceeds our limit on skipped slots.
1139
- check_block_skip_slots ( chain, parent. beacon_block . slot ( ) , block. message ( ) ) ?;
1140
-
1141
1130
/*
1142
1131
* Perform cursory checks to see if the block is even worth processing.
1143
1132
*/
@@ -1492,30 +1481,6 @@ impl<T: BeaconChainTypes> ExecutionPendingBlock<T> {
1492
1481
}
1493
1482
}
1494
1483
1495
- /// Check that the count of skip slots between the block and its parent does not exceed our maximum
1496
- /// value.
1497
- ///
1498
- /// Whilst this is not part of the specification, we include this to help prevent us from DoS
1499
- /// attacks. In times of dire network circumstance, the user can configure the
1500
- /// `import_max_skip_slots` value.
1501
- fn check_block_skip_slots < T : BeaconChainTypes > (
1502
- chain : & BeaconChain < T > ,
1503
- parent_slot : Slot ,
1504
- block : BeaconBlockRef < ' _ , T :: EthSpec > ,
1505
- ) -> Result < ( ) , BlockError < T :: EthSpec > > {
1506
- // Reject any block that exceeds our limit on skipped slots.
1507
- if let Some ( max_skip_slots) = chain. config . import_max_skip_slots {
1508
- if block. slot ( ) > parent_slot + max_skip_slots {
1509
- return Err ( BlockError :: TooManySkippedSlots {
1510
- parent_slot,
1511
- block_slot : block. slot ( ) ,
1512
- } ) ;
1513
- }
1514
- }
1515
-
1516
- Ok ( ( ) )
1517
- }
1518
-
1519
1484
/// Returns `Ok(())` if the block's slot is greater than the anchor block's slot (if any).
1520
1485
fn check_block_against_anchor_slot < T : BeaconChainTypes > (
1521
1486
block : BeaconBlockRef < ' _ , T :: EthSpec > ,
0 commit comments