mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 12:28:24 +00:00
merge cleanuo
This commit is contained in:
@@ -987,19 +987,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
&self,
|
||||
block_root: &Hash256,
|
||||
) -> Result<Option<BlobSidecarList<T::EthSpec>>, Error> {
|
||||
// If there is no data availability boundary, the Eip4844 fork is disabled.
|
||||
if let Some(finalized_data_availability_boundary) =
|
||||
self.finalized_data_availability_boundary()
|
||||
{
|
||||
self.early_attester_cache
|
||||
.get_blobs(*block_root)
|
||||
.map_or_else(
|
||||
|| self.get_blobs(block_root, finalized_data_availability_boundary),
|
||||
|blobs| Ok(Some(blobs)),
|
||||
)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
self.early_attester_cache
|
||||
.get_blobs(*block_root)
|
||||
.map_or_else(|| self.get_blobs(block_root), |blobs| Ok(Some(blobs)))
|
||||
}
|
||||
|
||||
/// Returns the block at the given root, if any.
|
||||
@@ -2667,11 +2657,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
|
||||
pub async fn process_blob(
|
||||
self: &Arc<Self>,
|
||||
blob: BlobSidecar<T::EthSpec>,
|
||||
blob: Arc<BlobSidecar<T::EthSpec>>,
|
||||
count_unrealized: CountUnrealized,
|
||||
) -> Result<AvailabilityProcessingStatus, BlockError<T::EthSpec>> {
|
||||
self.check_availability_and_maybe_import(
|
||||
|chain| chain.data_availability_checker.put_blob(Arc::new(blob)),
|
||||
|chain| chain.data_availability_checker.put_blob(blob),
|
||||
count_unrealized,
|
||||
)
|
||||
.await
|
||||
|
||||
@@ -9,7 +9,6 @@ use crate::gossip_blob_cache::AvailabilityCheckError;
|
||||
use crate::BeaconChainError;
|
||||
use derivative::Derivative;
|
||||
use state_processing::per_block_processing::eip4844::eip4844::verify_kzg_commitments_against_transactions;
|
||||
use types::blob_sidecar::BlobSidecarList;
|
||||
use types::{
|
||||
BeaconBlockRef, BeaconStateError, BlobSidecar, BlobSidecarList, Epoch, EthSpec, Hash256,
|
||||
KzgCommitment, SignedBeaconBlock, SignedBeaconBlockHeader, SignedBlobSidecar, Slot,
|
||||
@@ -131,11 +130,11 @@ impl From<BeaconStateError> for BlobError {
|
||||
/// the p2p network.
|
||||
#[derive(Debug)]
|
||||
pub struct GossipVerifiedBlob<T: EthSpec> {
|
||||
blob: BlobSidecar<T>,
|
||||
blob: Arc<BlobSidecar<T>>,
|
||||
}
|
||||
|
||||
impl<T: EthSpec> GossipVerifiedBlob<T> {
|
||||
pub fn to_blob(self) -> BlobSidecar<T> {
|
||||
pub fn to_blob(self) -> Arc<BlobSidecar<T>> {
|
||||
self.blob
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user