diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index ab0bcb741..5768fd85b 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -1074,12 +1074,24 @@ impl BeaconChain { ) -> Result>, Error> { match self.store.get_blobs(block_root)? { Some(blobs) => Ok(Some(blobs)), +<<<<<<< HEAD None => { // Check for the corresponding block to understand whether we *should* have blobs. self.get_blinded_block(block_root)? .map(|block| { // If there are no KZG commitments in the block, we know the sidecar should // be empty. +======= + None => match self.get_blinded_block(block_root)? { + Some(block) => { + let current_slot = self.slot()?; + let current_epoch = current_slot.epoch(T::EthSpec::slots_per_epoch()); + + if block.slot().epoch(T::EthSpec::slots_per_epoch()) + + *MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS + >= current_epoch + { +>>>>>>> 292426505 (Improve syntax) let expected_kzg_commitments = match block.message().body().blob_kzg_commitments() { Ok(kzg_commitments) => kzg_commitments, diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index c020fe0bd..6ed0d129d 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -1694,21 +1694,27 @@ impl, Cold: ItemStore> HotColdDB pub fn try_prune_blobs(&self, force: bool) -> Result<(), Error> { let mut blob_info: BlobInfo; - if let Some(old_blob_info) = self.get_blob_info() { - blob_info = old_blob_info; - } else { - return Ok(()); + match self.get_blob_info() { + Some(old_blob_info) => { + blob_info = old_blob_info; + } + None => { + return Ok(()); + } } let data_availability_breakpoint: Hash256; - if let Some(breakpoint) = blob_info.data_availability_breakpoint { - if breakpoint == blob_info.oldest_blob_parent { + match blob_info.data_availability_breakpoint { + Some(breakpoint) => { + if breakpoint == blob_info.oldest_blob_parent { + return Ok(()); + } + data_availability_breakpoint = breakpoint; + } + None => { return Ok(()); } - data_availability_breakpoint = breakpoint; - } else { - return Ok(()); } // Load the state from which to prune blobs so we can backtrack.