use block wrapper in sync pairing (#4131)

This commit is contained in:
realbigsean
2023-03-26 19:18:54 -04:00
committed by GitHub
parent a5addf661c
commit af974dc0b8
5 changed files with 20 additions and 56 deletions

View File

@@ -4,7 +4,7 @@ use beacon_chain::blob_verification::{AsBlock, BlockWrapper};
use beacon_chain::validator_monitor::{get_block_delay_ms, timestamp_now};
use beacon_chain::{AvailabilityProcessingStatus, NotifyExecutionLayer};
use beacon_chain::{BeaconChain, BeaconChainTypes, BlockError, CountUnrealized};
use eth2::types::{SignedBlockContents, VariableList};
use eth2::types::SignedBlockContents;
use execution_layer::ProvenancedPayload;
use lighthouse_network::PubsubMessage;
use network::NetworkMessage;
@@ -77,10 +77,7 @@ pub async fn publish_block<T: BeaconChainTypes>(
PubsubMessage::BlobSidecar(Box::new((blob_index as u64, blob))),
)?;
}
let blobs_vec = signed_blobs.into_iter().map(|blob| blob.message).collect();
let blobs = VariableList::new(blobs_vec).map_err(|e| {
warp_utils::reject::custom_server_error(format!("Invalid blobs length: {e:?}"))
})?;
let blobs = signed_blobs.into_iter().map(|blob| blob.message).collect();
BlockWrapper::BlockAndBlobs(block, blobs)
} else {
block.into()