impl hash correctly for the blob wrapper

This commit is contained in:
realbigsean 2022-12-23 12:53:59 -05:00
parent d09523802b
commit 1dc0759f57
No known key found for this signature in database
GPG Key ID: B372B64D866BF8CC
3 changed files with 7 additions and 5 deletions

View File

@ -2944,7 +2944,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
ops.push(StoreOp::PutBlock(block_root, signed_block.clone()));
ops.push(StoreOp::PutState(block.state_root(), &state));
if let Some(blobs) = blobs {
if let Some(blobs) = blobs? {
//FIXME(sean) using this for debugging for now
info!(self.log, "Writing blobs to store"; "block_root" => ?block_root);
ops.push(StoreOp::PutBlobs(block_root, blobs));

View File

@ -77,7 +77,7 @@ impl<E: EthSpec> EarlyAttesterCache<E> {
source,
target,
block,
blobs,
blobs: blobs?,
proto_block,
};

View File

@ -93,15 +93,17 @@ impl<T: EthSpec> BlockWrapper<T> {
self.block().parent_root()
}
pub fn deconstruct(self) -> (Arc<SignedBeaconBlock<T>>, Option<Arc<BlobsSidecar<T>>>) {
pub fn deconstruct(self) -> (Arc<SignedBeaconBlock<T>>, Result<Option<Arc<BlobsSidecar<T>>>, BlobReconstructionError>) {
match self {
BlockWrapper::Block(block) => (block, None),
BlockWrapper::Block(block) => (block, block
.reconstruct_empty_blobs(block_root)
.map(|blob_opt| blob_opt.map(Arc::new))),
BlockWrapper::BlockAndBlob(block_sidecar_pair) => {
let SignedBeaconBlockAndBlobsSidecar {
beacon_block,
blobs_sidecar,
} = block_sidecar_pair;
(beacon_block, Some(blobs_sidecar))
(beacon_block, Ok(Some(blobs_sidecar)))
}
}
}