This commit is contained in:
realbigsean
2022-12-30 11:00:14 -05:00
parent 222a514506
commit d8f7277beb
18 changed files with 109 additions and 302 deletions

View File

@@ -6,7 +6,6 @@ use crate::attestation_verification::{
use crate::attester_cache::{AttesterCache, AttesterCacheKey};
use crate::beacon_proposer_cache::compute_proposer_duties_from_head;
use crate::beacon_proposer_cache::BeaconProposerCache;
use crate::blob_verification::{BlobError, VerifiedBlobsSidecar};
use crate::block_times_cache::BlockTimesCache;
use crate::block_verification::{
check_block_is_finalized_descendant, check_block_relevancy, get_block_root,
@@ -1818,23 +1817,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
})
}
/// Accepts some `BlobsSidecar` received over from the network and attempts to verify it,
/// returning `Ok(_)` if it is valid to be (re)broadcast on the gossip network.
pub fn verify_blobs_sidecar_for_gossip<'a>(
&self,
blobs_sidecar: &'a BlobsSidecar<T::EthSpec>,
) -> Result<VerifiedBlobsSidecar<'a, T>, BlobError> {
metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_REQUESTS);
let _timer = metrics::start_timer(&metrics::BLOBS_SIDECAR_GOSSIP_VERIFICATION_TIMES);
VerifiedBlobsSidecar::verify(blobs_sidecar, self).map(|v| {
if let Some(_event_handler) = self.event_handler.as_ref() {
// TODO: Handle sse events
}
metrics::inc_counter(&metrics::BLOBS_SIDECAR_PROCESSING_SUCCESSES);
v
})
}
/// Accepts some 'LightClientFinalityUpdate' from the network and attempts to verify it
pub fn verify_finality_update_for_gossip(
self: &Arc<Self>,
@@ -4479,7 +4461,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.try_into()
.map_err(|_| BlockProductionError::InvalidPayloadFork)?,
bls_to_execution_changes: bls_to_execution_changes.into(),
//FIXME(sean) get blobs
blob_kzg_commitments: VariableList::from(kzg_commitments),
},
}),

View File

@@ -460,7 +460,7 @@ where
if is_terminal_block_hash_set && !is_activation_epoch_reached {
// Use the "empty" payload if there's a terminal block hash, but we haven't reached the
// terminal block epoch yet.
return Ok(BlockProposalContents::default_at_fork(fork));
return BlockProposalContents::default_at_fork(fork).map_err(Into::into);
}
let terminal_pow_block_hash = execution_layer
@@ -473,7 +473,7 @@ where
} else {
// If the merge transition hasn't occurred yet and the EL hasn't found the terminal
// block, return an "empty" payload.
return Ok(BlockProposalContents::default_at_fork(fork));
return BlockProposalContents::default_at_fork(fork).map_err(Into::into);
}
} else {
latest_execution_payload_header_block_hash