clean up blob by root response (#4136)

This commit is contained in:
realbigsean
2023-03-28 12:49:32 -04:00
committed by GitHub
parent d24e5cc22a
commit deec9c51ba
6 changed files with 70 additions and 161 deletions

View File

@@ -1023,7 +1023,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
)
}
pub async fn get_blobs_checking_early_attester_cache(
pub fn get_blobs_checking_early_attester_cache(
&self,
block_root: &Hash256,
) -> Result<Option<BlobSidecarList<T::EthSpec>>, Error> {

View File

@@ -112,6 +112,11 @@ impl<T: EthSpec, S: SlotClock> DataAvailabilityChecker<T, S> {
}
}
/// Get a blob from the RPC cache.
pub fn get_blob(&self, blob_id: &BlobIdentifier) -> Option<Arc<BlobSidecar<T>>> {
self.rpc_blob_cache.read().get(blob_id).cloned()
}
/// This first validate the KZG commitments included in the blob sidecar.
/// Check if we've cached other blobs for this block. If it completes a set and we also
/// have a block cached, return the Availability variant triggering block import.

View File

@@ -22,7 +22,6 @@ pub struct CacheItem<E: EthSpec> {
* Values used to make the block available.
*/
block: Arc<SignedBeaconBlock<E>>,
//TODO(sean) remove this and just use the da checker?'
blobs: Option<BlobSidecarList<E>>,
proto_block: ProtoBlock,
}

View File

@@ -213,9 +213,6 @@ pub enum BeaconChainError {
BlsToExecutionConflictsWithPool,
InconsistentFork(InconsistentFork),
ProposerHeadForkChoiceError(fork_choice::Error<proto_array::Error>),
BlobsUnavailable,
NoKzgCommitmentsFieldOnBlock,
BlobsOlderThanDataAvailabilityBoundary(Epoch),
}
easy_from_to!(SlotProcessingError, BeaconChainError);