diff --git a/beacon_node/beacon_chain/src/blob_verification.rs b/beacon_node/beacon_chain/src/blob_verification.rs index 7d049b293..353ecc86c 100644 --- a/beacon_node/beacon_chain/src/blob_verification.rs +++ b/beacon_node/beacon_chain/src/blob_verification.rs @@ -19,15 +19,15 @@ pub enum BlobError { message_slot: Slot, latest_permissible_slot: Slot, }, - /// The blob sidecar is from a slot that is prior to the earliest permissible slot (with - /// respect to the gossip clock disparity). + + /// The blob sidecar has a different slot than the block. /// /// ## Peer scoring /// /// Assuming the local clock is correct, the peer has sent an invalid message. - PastSlot { - message_slot: Slot, - earliest_permissible_slot: Slot, + SlotMismatch { + blob_slot: Slot, + block_slot: Slot, }, /// The blob sidecar contains an incorrectly formatted `BLSFieldElement` > `BLS_MODULUS`. @@ -122,14 +122,10 @@ pub fn validate_blob_for_gossip( }); } - let earliest_permissible_slot = chain - .slot_clock - .now_with_past_tolerance(MAXIMUM_GOSSIP_CLOCK_DISPARITY) - .ok_or(BeaconChainError::UnableToReadSlot)?; - if blob_slot > earliest_permissible_slot { - return Err(BlobError::PastSlot { - message_slot: earliest_permissible_slot, - earliest_permissible_slot: blob_slot, + if blob_slot != block_slot { + return Err(BlobError::SlotMismatch { + blob_slot, + block_slot, }); } diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index 7f5a737af..083176422 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -840,7 +840,17 @@ impl Worker { ); return None; } - Err(blob_errors) => unimplemented!("handle") + Err(e@ BlockError::BlobValidation(_)) => { + warn!(self.log, "Could not verify blob for gossip. Rejecting the block and blob"; + "error" => %e); + self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject); + self.gossip_penalize_peer( + peer_id, + PeerAction::LowToleranceError, + "gossip_blob_low", + ); + return None; + } }; metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_VERIFIED_TOTAL); diff --git a/scripts/local_testnet/genesis.json b/scripts/local_testnet/genesis.json index d5ea83012..7f6bc771b 100644 --- a/scripts/local_testnet/genesis.json +++ b/scripts/local_testnet/genesis.json @@ -12,8 +12,8 @@ "berlinBlock": 0, "londonBlock": 0, "mergeNetsplitBlock": 0, - "shanghaiTime": 1670428733, - "shardingForkTime": 1670428829, + "shanghaiTime": 1670438240, + "shardingForkTime": 1670438336, "terminalTotalDifficulty": 0 }, "alloc": {