mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Sidecar inclusion proof (#4900)
* Refactor BlobSidecar to new type * Fix some compile errors * Gossip verification compiles * Fix http api types take 1 * Fix another round of compile errors * Beacon node crate compiles * EF tests compile * Remove all blob signing from VC * fmt * Tests compile * Fix some tests * Fix more http tests * get compiling * Fix gossip conditions and tests * Add basic proof generation and verification * remove unnecessary ssz decode * add back build_sidecar * remove default at fork for blobs * fix beacon chain tests * get relase tests compiling * fix lints * fix existing spec tests * add new ef tests * fix gossip duplicate rule * lints * add back sidecar signature check in gossip * add finalized descendant check to blob sidecar gossip * fix error conversion * fix release tests * sidecar inclusion self review cleanup * Add proof verification and computation metrics * Remove accidentally committed file * Unify some block and blob errors; add slashing conditions for sidecars * Address review comment * Clean up re-org tests (#4957) * Address more review comments * Add Comments & Eliminate Unnecessary Clones * update names * Update beacon_node/beacon_chain/src/metrics.rs Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * Update beacon_node/network/src/network_beacon_processor/tests.rs Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * pr feedback * fix test compile * Sidecar Inclusion proof small refactor and updates (#4967) * Update some comments, variables and small cosmetic fixes. * Couple blobs and proofs into a tuple in `PayloadAndBlobs` for simplicity and safety. * Update function comment. * Update testing/ef_tests/src/cases/merkle_proof_validity.rs Co-authored-by: Jimmy Chen <jchen.tc@gmail.com> * Rename the block and blob wrapper types used in the beacon API interfaces. * make sure gossip invalid blobs are passed to the slasher (#4970) * Add blob headers to slasher before adding to DA checker * Replace Vec with HashSet in BlockQueue * fmt * Rename gindex -> index * Simplify gossip condition --------- Co-authored-by: realbigsean <seananderson33@gmail.com> Co-authored-by: realbigsean <sean@sigmaprime.io> Co-authored-by: Michael Sproul <michael@sigmaprime.io> Co-authored-by: Mark Mackey <mark@sigmaprime.io> Co-authored-by: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -2,18 +2,12 @@ use beacon_chain::{
|
||||
test_utils::{AttestationStrategy, BlockStrategy},
|
||||
GossipVerifiedBlock, IntoGossipVerifiedBlockContents,
|
||||
};
|
||||
use eth2::types::{
|
||||
BroadcastValidation, SignedBeaconBlock, SignedBlindedBeaconBlock, SignedBlockContents,
|
||||
SignedBlockContentsTuple,
|
||||
};
|
||||
use eth2::types::{BroadcastValidation, PublishBlockRequest, SignedBeaconBlock};
|
||||
use http_api::test_utils::InteractiveTester;
|
||||
use http_api::{publish_blinded_block, publish_block, reconstruct_block, ProvenancedBlock};
|
||||
use std::sync::Arc;
|
||||
use tree_hash::TreeHash;
|
||||
use types::{
|
||||
BlindedBlobSidecar, BlindedPayload, BlobSidecar, FullPayload, Hash256, MainnetEthSpec,
|
||||
SignedSidecarList, Slot,
|
||||
};
|
||||
use types::{Hash256, MainnetEthSpec, Slot};
|
||||
use warp::Rejection;
|
||||
use warp_utils::reject::CustomBadRequest;
|
||||
|
||||
@@ -80,7 +74,7 @@ pub async fn gossip_invalid() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -131,7 +125,7 @@ pub async fn gossip_partial_pass() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -174,7 +168,7 @@ pub async fn gossip_full_pass() {
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block.clone(), blobs),
|
||||
&PublishBlockRequest::new(block.clone(), blobs),
|
||||
validation_level,
|
||||
)
|
||||
.await;
|
||||
@@ -266,7 +260,7 @@ pub async fn consensus_invalid() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -315,7 +309,7 @@ pub async fn consensus_gossip() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -358,10 +352,8 @@ pub async fn consensus_partial_pass_only_consensus() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let ((block_a, _), state_after_a): ((SignedBeaconBlock<E>, _), _) =
|
||||
tester.harness.make_block(state_a.clone(), slot_b).await;
|
||||
let ((block_b, blobs_b), state_after_b): ((SignedBeaconBlock<E>, _), _) =
|
||||
tester.harness.make_block(state_a, slot_b).await;
|
||||
let ((block_a, _), state_after_a) = tester.harness.make_block(state_a.clone(), slot_b).await;
|
||||
let ((block_b, blobs_b), state_after_b) = tester.harness.make_block(state_a, slot_b).await;
|
||||
let block_b_root = block_b.canonical_root();
|
||||
|
||||
/* check for `make_block` curios */
|
||||
@@ -369,7 +361,7 @@ pub async fn consensus_partial_pass_only_consensus() {
|
||||
assert_eq!(block_b.state_root(), state_after_b.tree_hash_root());
|
||||
assert_ne!(block_a.state_root(), block_b.state_root());
|
||||
|
||||
let gossip_block_contents_b = SignedBlockContents::new(block_b, blobs_b)
|
||||
let gossip_block_contents_b = PublishBlockRequest::new(block_b, blobs_b)
|
||||
.into_gossip_verified_block(&tester.harness.chain);
|
||||
assert!(gossip_block_contents_b.is_ok());
|
||||
let gossip_block_a = GossipVerifiedBlock::new(block_a.clone().into(), &tester.harness.chain);
|
||||
@@ -430,7 +422,7 @@ pub async fn consensus_full_pass() {
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block.clone(), blobs),
|
||||
&PublishBlockRequest::new(block.clone(), blobs),
|
||||
validation_level,
|
||||
)
|
||||
.await;
|
||||
@@ -481,7 +473,7 @@ pub async fn equivocation_invalid() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -538,7 +530,7 @@ pub async fn equivocation_consensus_early_equivocation() {
|
||||
assert!(tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block_a.clone(), blobs_a),
|
||||
&PublishBlockRequest::new(block_a.clone(), blobs_a),
|
||||
validation_level
|
||||
)
|
||||
.await
|
||||
@@ -552,7 +544,7 @@ pub async fn equivocation_consensus_early_equivocation() {
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block_b.clone(), blobs_b),
|
||||
&PublishBlockRequest::new(block_b.clone(), blobs_b),
|
||||
validation_level,
|
||||
)
|
||||
.await;
|
||||
@@ -603,7 +595,7 @@ pub async fn equivocation_gossip() {
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(&SignedBlockContents::new(block, blobs), validation_level)
|
||||
.post_beacon_blocks_v2(&PublishBlockRequest::new(block, blobs), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -661,10 +653,10 @@ pub async fn equivocation_consensus_late_equivocation() {
|
||||
assert_eq!(block_b.state_root(), state_after_b.tree_hash_root());
|
||||
assert_ne!(block_a.state_root(), block_b.state_root());
|
||||
|
||||
let gossip_block_contents_b = SignedBlockContents::new(block_b, blobs_b)
|
||||
let gossip_block_contents_b = PublishBlockRequest::new(block_b, blobs_b)
|
||||
.into_gossip_verified_block(&tester.harness.chain);
|
||||
assert!(gossip_block_contents_b.is_ok());
|
||||
let gossip_block_contents_a = SignedBlockContents::new(block_a, blobs_a)
|
||||
let gossip_block_contents_a = PublishBlockRequest::new(block_a, blobs_a)
|
||||
.into_gossip_verified_block(&tester.harness.chain);
|
||||
assert!(gossip_block_contents_a.is_err());
|
||||
|
||||
@@ -728,7 +720,7 @@ pub async fn equivocation_full_pass() {
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block.clone(), blobs),
|
||||
&PublishBlockRequest::new(block.clone(), blobs),
|
||||
validation_level,
|
||||
)
|
||||
.await;
|
||||
@@ -776,11 +768,9 @@ pub async fn blinded_gossip_invalid() {
|
||||
})
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -829,11 +819,9 @@ pub async fn blinded_gossip_partial_pass() {
|
||||
})
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -870,18 +858,17 @@ pub async fn blinded_gossip_full_pass() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let (block_contents_tuple, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let block_contents = block_contents_tuple.into();
|
||||
let (blinded_block, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block, validation_level)
|
||||
.await;
|
||||
|
||||
assert!(response.is_ok());
|
||||
assert!(tester
|
||||
.harness
|
||||
.chain
|
||||
.block_is_known_to_fork_choice(&block_contents.signed_block().canonical_root()));
|
||||
.block_is_known_to_fork_choice(&blinded_block.canonical_root()));
|
||||
}
|
||||
|
||||
// This test checks that a block that is valid from both a gossip and consensus perspective is accepted when using `broadcast_validation=gossip`.
|
||||
@@ -912,19 +899,18 @@ pub async fn blinded_gossip_full_pass_ssz() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let (block_contents_tuple, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let block_contents = block_contents_tuple.into();
|
||||
let (blinded_block, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2_ssz(&block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2_ssz(&blinded_block, validation_level)
|
||||
.await;
|
||||
|
||||
assert!(response.is_ok());
|
||||
assert!(tester
|
||||
.harness
|
||||
.chain
|
||||
.block_is_known_to_fork_choice(&block_contents.signed_block().canonical_root()));
|
||||
.block_is_known_to_fork_choice(&blinded_block.canonical_root()));
|
||||
}
|
||||
|
||||
/// This test checks that a block that is **invalid** from a gossip perspective gets rejected when using `broadcast_validation=consensus`.
|
||||
@@ -963,11 +949,9 @@ pub async fn blinded_consensus_invalid() {
|
||||
})
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -1014,11 +998,9 @@ pub async fn blinded_consensus_gossip() {
|
||||
.make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero())
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -1060,19 +1042,18 @@ pub async fn blinded_consensus_full_pass() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let (block_contents_tuple, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let (blinded_block, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
|
||||
let block_contents = block_contents_tuple.into();
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block, validation_level)
|
||||
.await;
|
||||
|
||||
assert!(response.is_ok());
|
||||
assert!(tester
|
||||
.harness
|
||||
.chain
|
||||
.block_is_known_to_fork_choice(&block_contents.signed_block().canonical_root()));
|
||||
.block_is_known_to_fork_choice(&blinded_block.canonical_root()));
|
||||
}
|
||||
|
||||
/// This test checks that a block that is **invalid** from a gossip perspective gets rejected when using `broadcast_validation=consensus_and_equivocation`.
|
||||
@@ -1112,11 +1093,9 @@ pub async fn blinded_equivocation_invalid() {
|
||||
})
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -1159,18 +1138,13 @@ pub async fn blinded_equivocation_consensus_early_equivocation() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let (block_contents_tuple_a, state_after_a) = tester
|
||||
let (block_a, state_after_a) = tester
|
||||
.harness
|
||||
.make_blinded_block(state_a.clone(), slot_b)
|
||||
.await;
|
||||
let (block_contents_tuple_b, state_after_b) =
|
||||
tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let (block_b, state_after_b) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
|
||||
/* check for `make_blinded_block` curios */
|
||||
let block_contents_a: SignedBlockContents<E, BlindedPayload<E>> = block_contents_tuple_a.into();
|
||||
let block_contents_b: SignedBlockContents<E, BlindedPayload<E>> = block_contents_tuple_b.into();
|
||||
let block_a = block_contents_a.signed_block();
|
||||
let block_b = block_contents_b.signed_block();
|
||||
assert_eq!(block_a.state_root(), state_after_a.tree_hash_root());
|
||||
assert_eq!(block_b.state_root(), state_after_b.tree_hash_root());
|
||||
assert_ne!(block_a.state_root(), block_b.state_root());
|
||||
@@ -1178,7 +1152,7 @@ pub async fn blinded_equivocation_consensus_early_equivocation() {
|
||||
/* submit `block_a` as valid */
|
||||
assert!(tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_a, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_a, validation_level)
|
||||
.await
|
||||
.is_ok());
|
||||
assert!(tester
|
||||
@@ -1189,7 +1163,7 @@ pub async fn blinded_equivocation_consensus_early_equivocation() {
|
||||
/* submit `block_b` which should induce equivocation */
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_b, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_b, validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -1236,11 +1210,9 @@ pub async fn blinded_equivocation_gossip() {
|
||||
.make_block_with_modifier(state_a, slot_b, |b| *b.state_root_mut() = Hash256::zero())
|
||||
.await;
|
||||
|
||||
let blinded_block_contents = into_signed_blinded_block_contents(block_contents_tuple);
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blinded_blocks_v2(&blinded_block_contents, validation_level)
|
||||
.post_beacon_blinded_blocks_v2(&block_contents_tuple.0.clone_as_blinded(), validation_level)
|
||||
.await;
|
||||
assert!(response.is_err());
|
||||
|
||||
@@ -1286,12 +1258,11 @@ pub async fn blinded_equivocation_consensus_late_equivocation() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let ((block_a, blobs_a), state_after_a): ((SignedBlindedBeaconBlock<E>, _), _) = tester
|
||||
let (block_a, state_after_a) = tester
|
||||
.harness
|
||||
.make_blinded_block(state_a.clone(), slot_b)
|
||||
.await;
|
||||
let ((block_b, blobs_b), state_after_b): ((SignedBlindedBeaconBlock<E>, _), _) =
|
||||
tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let (block_b, state_after_b) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
|
||||
/* check for `make_blinded_block` curios */
|
||||
assert_eq!(block_a.state_root(), state_after_a.tree_hash_root());
|
||||
@@ -1301,7 +1272,7 @@ pub async fn blinded_equivocation_consensus_late_equivocation() {
|
||||
let unblinded_block_a = reconstruct_block(
|
||||
tester.harness.chain.clone(),
|
||||
block_a.canonical_root(),
|
||||
SignedBlockContents::new(block_a, blobs_a),
|
||||
block_a,
|
||||
test_logger.clone(),
|
||||
)
|
||||
.await
|
||||
@@ -1309,7 +1280,7 @@ pub async fn blinded_equivocation_consensus_late_equivocation() {
|
||||
let unblinded_block_b = reconstruct_block(
|
||||
tester.harness.chain.clone(),
|
||||
block_b.canonical_root(),
|
||||
SignedBlockContents::new(block_b.clone(), blobs_b.clone()),
|
||||
block_b.clone(),
|
||||
test_logger.clone(),
|
||||
)
|
||||
.await
|
||||
@@ -1338,7 +1309,7 @@ pub async fn blinded_equivocation_consensus_late_equivocation() {
|
||||
let channel = tokio::sync::mpsc::unbounded_channel();
|
||||
|
||||
let publication_result = publish_blinded_block(
|
||||
SignedBlockContents::new(block_b, blobs_b),
|
||||
block_b,
|
||||
tester.harness.chain,
|
||||
&channel.0,
|
||||
test_logger,
|
||||
@@ -1383,15 +1354,11 @@ pub async fn blinded_equivocation_full_pass() {
|
||||
let slot_b = slot_a + 1;
|
||||
|
||||
let state_a = tester.harness.get_current_state();
|
||||
let ((block, blobs), _): ((SignedBlindedBeaconBlock<E>, _), _) =
|
||||
tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
let (block, _) = tester.harness.make_blinded_block(state_a, slot_b).await;
|
||||
|
||||
let response: Result<(), eth2::Error> = tester
|
||||
.client
|
||||
.post_beacon_blocks_v2(
|
||||
&SignedBlockContents::new(block.clone(), blobs),
|
||||
validation_level,
|
||||
)
|
||||
.post_beacon_blinded_blocks_v2(&block, validation_level)
|
||||
.await;
|
||||
|
||||
assert!(response.is_ok());
|
||||
@@ -1400,20 +1367,3 @@ pub async fn blinded_equivocation_full_pass() {
|
||||
.chain
|
||||
.block_is_known_to_fork_choice(&block.canonical_root()));
|
||||
}
|
||||
|
||||
fn into_signed_blinded_block_contents(
|
||||
block_contents_tuple: SignedBlockContentsTuple<E, FullPayload<E>>,
|
||||
) -> SignedBlockContents<E, BlindedPayload<E>> {
|
||||
let (block, maybe_blobs) = block_contents_tuple;
|
||||
SignedBlockContents::new(block.into(), maybe_blobs.map(into_blinded_blob_sidecars))
|
||||
}
|
||||
|
||||
fn into_blinded_blob_sidecars(
|
||||
blobs: SignedSidecarList<E, BlobSidecar<E>>,
|
||||
) -> SignedSidecarList<E, BlindedBlobSidecar> {
|
||||
blobs
|
||||
.into_iter()
|
||||
.map(|blob| blob.into())
|
||||
.collect::<Vec<_>>()
|
||||
.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user