mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
minor fixes
This commit is contained in:
@@ -70,7 +70,8 @@ use crate::payload_envelope_streamer::{EnvelopeRequestSource, launch_payload_env
|
|||||||
use crate::pending_payload_cache::PendingPayloadCache;
|
use crate::pending_payload_cache::PendingPayloadCache;
|
||||||
use crate::pending_payload_cache::{
|
use crate::pending_payload_cache::{
|
||||||
Availability as PayloadAvailability,
|
Availability as PayloadAvailability,
|
||||||
DataColumnReconstructionResult as DataColumnReconstructionResultGloas, PendingPayloadBid,
|
DataColumnReconstructionResult as DataColumnReconstructionResultGloas,
|
||||||
|
signed_payload_bid_from_block,
|
||||||
};
|
};
|
||||||
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
|
use crate::pending_payload_envelopes::PendingPayloadEnvelopes;
|
||||||
use crate::persisted_beacon_chain::PersistedBeaconChain;
|
use crate::persisted_beacon_chain::PersistedBeaconChain;
|
||||||
@@ -3431,7 +3432,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.put_kzg_verified_custody_data_columns(
|
.put_kzg_verified_custody_data_columns(
|
||||||
block_root,
|
block_root,
|
||||||
bid,
|
bid,
|
||||||
merge_result.full_columns.clone(),
|
&merge_result.full_columns,
|
||||||
)
|
)
|
||||||
.map_err(BlockError::from)?;
|
.map_err(BlockError::from)?;
|
||||||
self.process_payload_availability(slot, availability, || Ok(()))
|
self.process_payload_availability(slot, availability, || Ok(()))
|
||||||
@@ -3818,7 +3819,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
|
|
||||||
let block = execution_pending.block.block_cloned();
|
let block = execution_pending.block.block_cloned();
|
||||||
if block.fork_name_unchecked().gloas_enabled() {
|
if block.fork_name_unchecked().gloas_enabled() {
|
||||||
let bid = PendingPayloadBid::from_block(block.as_ref())?;
|
let bid = signed_payload_bid_from_block(block.as_ref())?;
|
||||||
chain
|
chain
|
||||||
.pending_payload_cache
|
.pending_payload_cache
|
||||||
.init_pending_bid(block_root, bid);
|
.init_pending_bid(block_root, bid);
|
||||||
@@ -4107,7 +4108,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
.ok_or(BlockError::EnvelopeBlockRootUnknown { block_root })?;
|
.ok_or(BlockError::EnvelopeBlockRootUnknown { block_root })?;
|
||||||
let availability = self
|
let availability = self
|
||||||
.pending_payload_cache
|
.pending_payload_cache
|
||||||
.put_kzg_verified_custody_data_columns(block_root, bid, data_columns)
|
.put_kzg_verified_custody_data_columns(block_root, bid, &data_columns)
|
||||||
.map_err(BlockError::from)?;
|
.map_err(BlockError::from)?;
|
||||||
Ok(self
|
Ok(self
|
||||||
.process_payload_availability(slot, availability, || Ok(()))
|
.process_payload_availability(slot, availability, || Ok(()))
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use crate::kzg_utils::{
|
|||||||
use crate::observed_data_sidecars::{
|
use crate::observed_data_sidecars::{
|
||||||
Error as ObservedDataSidecarsError, ObservationKey, ObservationStrategy, Observe,
|
Error as ObservedDataSidecarsError, ObservationKey, ObservationStrategy, Observe,
|
||||||
};
|
};
|
||||||
use crate::pending_payload_cache::PendingPayloadBid;
|
use crate::pending_payload_cache::signed_payload_bid_from_block;
|
||||||
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes, metrics};
|
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes, metrics};
|
||||||
use educe::Educe;
|
use educe::Educe;
|
||||||
use fork_choice::ProtoBlock;
|
use fork_choice::ProtoBlock;
|
||||||
@@ -32,7 +32,7 @@ use types::data::{
|
|||||||
use types::{
|
use types::{
|
||||||
BeaconStateError, ChainSpec, DataColumnSidecar, DataColumnSidecarFulu, DataColumnSidecarGloas,
|
BeaconStateError, ChainSpec, DataColumnSidecar, DataColumnSidecarFulu, DataColumnSidecarGloas,
|
||||||
DataColumnSubnetId, EthSpec, Hash256, KzgCommitment, PartialDataColumnSidecarRef,
|
DataColumnSubnetId, EthSpec, Hash256, KzgCommitment, PartialDataColumnSidecarRef,
|
||||||
SignedBeaconBlockHeader, Slot,
|
SignedBeaconBlockHeader, SignedExecutionPayloadBid, Slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// An error occurred while validating a gossip data column.
|
/// An error occurred while validating a gossip data column.
|
||||||
@@ -373,15 +373,15 @@ impl<T: BeaconChainTypes, O: ObservationStrategy> GossipVerifiedDataColumn<T, O>
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
DataColumnSidecar::Gloas(_) => {
|
DataColumnSidecar::Gloas(_) => {
|
||||||
let kzg_commitments = load_gloas_payload_bid(column_sidecar.block_root(), chain)?
|
let bid = load_gloas_payload_bid(column_sidecar.block_root(), chain)?.ok_or(
|
||||||
.ok_or(GossipDataColumnError::BlockRootUnknown {
|
GossipDataColumnError::BlockRootUnknown {
|
||||||
block_root: column_sidecar.block_root(),
|
block_root: column_sidecar.block_root(),
|
||||||
slot: column_sidecar.slot(),
|
slot: column_sidecar.slot(),
|
||||||
})?
|
},
|
||||||
.blob_kzg_commitments;
|
)?;
|
||||||
verify_data_column_sidecar_with_commitments_len(
|
verify_data_column_sidecar_with_commitments_len(
|
||||||
&column_sidecar,
|
&column_sidecar,
|
||||||
kzg_commitments.len(),
|
bid.message.blob_kzg_commitments.len(),
|
||||||
&chain.spec,
|
&chain.spec,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
@@ -1091,12 +1091,13 @@ pub fn validate_data_column_sidecar_for_gossip_gloas<
|
|||||||
verify_slot_greater_than_latest_finalized_slot(chain, column_slot)?;
|
verify_slot_greater_than_latest_finalized_slot(chain, column_slot)?;
|
||||||
verify_is_unknown_sidecar(chain, &data_column)?;
|
verify_is_unknown_sidecar(chain, &data_column)?;
|
||||||
|
|
||||||
let kzg_commitments = load_gloas_payload_bid(data_column.block_root(), chain)?
|
let bid = load_gloas_payload_bid(data_column.block_root(), chain)?.ok_or(
|
||||||
.ok_or(GossipDataColumnError::BlockRootUnknown {
|
GossipDataColumnError::BlockRootUnknown {
|
||||||
block_root: data_column.block_root(),
|
block_root: data_column.block_root(),
|
||||||
slot: column_slot,
|
slot: column_slot,
|
||||||
})?
|
},
|
||||||
.blob_kzg_commitments;
|
)?;
|
||||||
|
let kzg_commitments = &bid.message.blob_kzg_commitments;
|
||||||
verify_data_column_sidecar_with_commitments_len(
|
verify_data_column_sidecar_with_commitments_len(
|
||||||
&data_column,
|
&data_column,
|
||||||
kzg_commitments.len(),
|
kzg_commitments.len(),
|
||||||
@@ -1306,13 +1307,13 @@ fn verify_data_column_sidecar_with_commitments_len<E: EthSpec>(
|
|||||||
pub(crate) fn load_gloas_payload_bid<T: BeaconChainTypes>(
|
pub(crate) fn load_gloas_payload_bid<T: BeaconChainTypes>(
|
||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
chain: &BeaconChain<T>,
|
chain: &BeaconChain<T>,
|
||||||
) -> Result<Option<PendingPayloadBid<T::EthSpec>>, BeaconChainError> {
|
) -> Result<Option<Arc<SignedExecutionPayloadBid<T::EthSpec>>>, BeaconChainError> {
|
||||||
if let Some(bid) = chain.pending_payload_cache.get_bid(&block_root) {
|
if let Some(bid) = chain.pending_payload_cache.get_bid(&block_root) {
|
||||||
return Ok(Some(bid));
|
return Ok(Some(bid));
|
||||||
}
|
}
|
||||||
|
|
||||||
let bid = if let Some(block) = chain.early_attester_cache.get_block(block_root) {
|
let bid = if let Some(block) = chain.early_attester_cache.get_block(block_root) {
|
||||||
PendingPayloadBid::from_block(block.as_ref()).map_err(BeaconChainError::BeaconStateError)?
|
signed_payload_bid_from_block(block.as_ref()).map_err(BeaconChainError::BeaconStateError)?
|
||||||
} else {
|
} else {
|
||||||
match chain
|
match chain
|
||||||
.store
|
.store
|
||||||
@@ -1320,10 +1321,10 @@ pub(crate) fn load_gloas_payload_bid<T: BeaconChainTypes>(
|
|||||||
.map_err(BeaconChainError::DBError)?
|
.map_err(BeaconChainError::DBError)?
|
||||||
{
|
{
|
||||||
Some(DatabaseBlock::Full(block)) => {
|
Some(DatabaseBlock::Full(block)) => {
|
||||||
PendingPayloadBid::from_block(&block).map_err(BeaconChainError::BeaconStateError)?
|
signed_payload_bid_from_block(&block).map_err(BeaconChainError::BeaconStateError)?
|
||||||
}
|
}
|
||||||
Some(DatabaseBlock::Blinded(block)) => {
|
Some(DatabaseBlock::Blinded(block)) => {
|
||||||
PendingPayloadBid::from_block(&block).map_err(BeaconChainError::BeaconStateError)?
|
signed_payload_bid_from_block(&block).map_err(BeaconChainError::BeaconStateError)?
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ use std::sync::Arc;
|
|||||||
use task_executor::TaskExecutor;
|
use task_executor::TaskExecutor;
|
||||||
use tracing::{Span, debug, error, instrument, trace};
|
use tracing::{Span, debug, error, instrument, trace};
|
||||||
use types::{
|
use types::{
|
||||||
ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, ExecutionPayloadBid, Hash256, PartialDataColumnSidecarRef
|
ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, Hash256, PartialDataColumnSidecarRef
|
||||||
};
|
};
|
||||||
|
|
||||||
mod pending_column;
|
mod pending_column;
|
||||||
@@ -67,8 +67,9 @@ use crate::metrics::{
|
|||||||
KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS, KZG_DATA_COLUMN_RECONSTRUCTION_FAILURES,
|
KZG_DATA_COLUMN_RECONSTRUCTION_ATTEMPTS, KZG_DATA_COLUMN_RECONSTRUCTION_FAILURES,
|
||||||
};
|
};
|
||||||
use crate::observed_data_sidecars::ObservationStrategy;
|
use crate::observed_data_sidecars::ObservationStrategy;
|
||||||
pub use pending_components::PendingPayloadBid;
|
pub use pending_components::signed_payload_bid_from_block;
|
||||||
use pending_components::{PendingComponents, ReconstructColumnsDecision};
|
use pending_components::{PendingComponents, ReconstructColumnsDecision};
|
||||||
|
use types::SignedExecutionPayloadBid;
|
||||||
use types::new_non_zero_usize;
|
use types::new_non_zero_usize;
|
||||||
|
|
||||||
/// The LRU Cache stores `PendingComponents`, which store the block root, the execution payload bid, and its associated column data.
|
/// The LRU Cache stores `PendingComponents`, which store the block root, the execution payload bid, and its associated column data.
|
||||||
@@ -151,7 +152,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
) -> Option<DataColumnSidecarList<T::EthSpec>> {
|
) -> Option<DataColumnSidecarList<T::EthSpec>> {
|
||||||
self.peek_pending_components(&block_root, |components| {
|
self.peek_pending_components(&block_root, |components| {
|
||||||
components.map(|c| c.get_cached_data_columns(block_root))
|
components.map(|c| c.get_cached_data_columns())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,8 +164,11 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the cached Gloas payload bid metadata for `block_root`, if present.
|
/// Return the cached Gloas payload bid for `block_root`, if present.
|
||||||
pub fn get_bid(&self, block_root: &Hash256) -> Option<PendingPayloadBid<T::EthSpec>> {
|
pub fn get_bid(
|
||||||
|
&self,
|
||||||
|
block_root: &Hash256,
|
||||||
|
) -> Option<Arc<SignedExecutionPayloadBid<T::EthSpec>>> {
|
||||||
self.peek_pending_components(block_root, |components| {
|
self.peek_pending_components(block_root, |components| {
|
||||||
components.map(|components| components.bid.clone())
|
components.map(|components| components.bid.clone())
|
||||||
})
|
})
|
||||||
@@ -199,7 +203,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
/// Insert an executed payload envelope into the cache and performs an availability check
|
/// Insert an executed payload envelope into the cache and performs an availability check
|
||||||
pub fn put_executed_payload_envelope(
|
pub fn put_executed_payload_envelope(
|
||||||
&self,
|
&self,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
executed_envelope: AvailabilityPendingExecutedEnvelope<T::EthSpec>,
|
executed_envelope: AvailabilityPendingExecutedEnvelope<T::EthSpec>,
|
||||||
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
||||||
let epoch = executed_envelope.envelope.epoch();
|
let epoch = executed_envelope.envelope.epoch();
|
||||||
@@ -225,10 +229,14 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
self.check_availability(beacon_block_root, pending_components, num_expected_columns)
|
self.check_availability(beacon_block_root, pending_components, num_expected_columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initialize pending components for a block's Gloas bid.
|
/// Inserts a bid into the pending payload cache.
|
||||||
pub fn insert_bid(&self, block_root: Hash256, bid: ExecutionPayloadBid<T::EthSpec>) {
|
pub fn insert_bid(
|
||||||
|
&self,
|
||||||
|
block_root: Hash256,
|
||||||
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
|
) {
|
||||||
let mut write_lock = self.availability_cache.write();
|
let mut write_lock = self.availability_cache.write();
|
||||||
write_lock.get_or_insert_mut(block_root, || PendingComponents::empty(block_root, bid));
|
write_lock.get_or_insert_mut(block_root, || PendingComponents::new(block_root, bid));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform KZG verification on RPC custody columns and insert them into the cache.
|
/// Perform KZG verification on RPC custody columns and insert them into the cache.
|
||||||
@@ -237,17 +245,17 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
pub fn put_rpc_custody_columns(
|
pub fn put_rpc_custody_columns(
|
||||||
&self,
|
&self,
|
||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
custody_columns: DataColumnSidecarList<T::EthSpec>,
|
custody_columns: DataColumnSidecarList<T::EthSpec>,
|
||||||
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
||||||
let kzg_verified_columns = KzgVerifiedDataColumn::from_batch_with_scoring_and_commitments(
|
let kzg_verified_columns = KzgVerifiedDataColumn::from_batch_with_scoring_and_commitments(
|
||||||
custody_columns,
|
custody_columns,
|
||||||
bid.blob_kzg_commitments.as_ref(),
|
bid.message.blob_kzg_commitments.as_ref(),
|
||||||
&self.kzg,
|
&self.kzg,
|
||||||
)
|
)
|
||||||
.map_err(AvailabilityCheckError::InvalidColumn)?;
|
.map_err(AvailabilityCheckError::InvalidColumn)?;
|
||||||
|
|
||||||
let epoch = bid.slot.epoch(T::EthSpec::slots_per_epoch());
|
let epoch = bid.message.slot.epoch(T::EthSpec::slots_per_epoch());
|
||||||
let sampling_columns = self
|
let sampling_columns = self
|
||||||
.custody_context
|
.custody_context
|
||||||
.sampling_columns_for_epoch(epoch, &self.spec);
|
.sampling_columns_for_epoch(epoch, &self.spec);
|
||||||
@@ -257,7 +265,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
.map(KzgVerifiedCustodyDataColumn::from_asserted_custody)
|
.map(KzgVerifiedCustodyDataColumn::from_asserted_custody)
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
self.put_kzg_verified_custody_data_columns(block_root, bid, verified_custody_columns)
|
self.put_kzg_verified_custody_data_columns(block_root, bid, &verified_custody_columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform KZG verification on gossip verified custody columns and insert them into the cache.
|
/// Perform KZG verification on gossip verified custody columns and insert them into the cache.
|
||||||
@@ -266,10 +274,10 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
pub fn put_gossip_verified_data_columns<O: ObservationStrategy>(
|
pub fn put_gossip_verified_data_columns<O: ObservationStrategy>(
|
||||||
&self,
|
&self,
|
||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
data_columns: Vec<GossipVerifiedDataColumn<T, O>>,
|
data_columns: Vec<GossipVerifiedDataColumn<T, O>>,
|
||||||
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
||||||
let epoch = bid.slot.epoch(T::EthSpec::slots_per_epoch());
|
let epoch = bid.message.slot.epoch(T::EthSpec::slots_per_epoch());
|
||||||
let sampling_columns = self
|
let sampling_columns = self
|
||||||
.custody_context
|
.custody_context
|
||||||
.sampling_columns_for_epoch(epoch, &self.spec);
|
.sampling_columns_for_epoch(epoch, &self.spec);
|
||||||
@@ -279,7 +287,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
.map(|c| KzgVerifiedCustodyDataColumn::from_asserted_custody(c.into_inner()))
|
.map(|c| KzgVerifiedCustodyDataColumn::from_asserted_custody(c.into_inner()))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
self.put_kzg_verified_custody_data_columns(block_root, bid, custody_columns)
|
self.put_kzg_verified_custody_data_columns(block_root, bid, &custody_columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Insert KZG verified columns into the cache.
|
/// Insert KZG verified columns into the cache.
|
||||||
@@ -287,14 +295,16 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
pub fn put_kzg_verified_custody_data_columns(
|
pub fn put_kzg_verified_custody_data_columns(
|
||||||
&self,
|
&self,
|
||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
kzg_verified_data_columns: Vec<KzgVerifiedCustodyDataColumn<T::EthSpec>>,
|
kzg_verified_data_columns: &[KzgVerifiedCustodyDataColumn<T::EthSpec>],
|
||||||
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
||||||
let pending_components =
|
let pending_components =
|
||||||
self.get_pending_components(block_root, bid, |pending_components| {
|
self.get_pending_components(block_root, bid.clone(), |pending_components| {
|
||||||
pending_components.merge_data_columns(kzg_verified_data_columns)
|
pending_components.merge_data_columns(kzg_verified_data_columns)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
let epoch = bid.message.slot.epoch(T::EthSpec::slots_per_epoch());
|
||||||
|
|
||||||
let num_expected_columns = self
|
let num_expected_columns = self
|
||||||
.custody_context
|
.custody_context
|
||||||
.num_of_data_columns_to_sample(epoch, &self.spec);
|
.num_of_data_columns_to_sample(epoch, &self.spec);
|
||||||
@@ -314,7 +324,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
pub fn reconstruct_data_columns(
|
pub fn reconstruct_data_columns(
|
||||||
&self,
|
&self,
|
||||||
block_root: &Hash256,
|
block_root: &Hash256,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
) -> Result<DataColumnReconstructionResult<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<DataColumnReconstructionResult<T::EthSpec>, AvailabilityCheckError> {
|
||||||
let verified_data_columns = match self.check_and_set_reconstruction_started(block_root) {
|
let verified_data_columns = match self.check_and_set_reconstruction_started(block_root) {
|
||||||
ReconstructColumnsDecision::Yes(verified_data_columns) => verified_data_columns,
|
ReconstructColumnsDecision::Yes(verified_data_columns) => verified_data_columns,
|
||||||
@@ -380,7 +390,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
self.put_kzg_verified_custody_data_columns(
|
self.put_kzg_verified_custody_data_columns(
|
||||||
*block_root,
|
*block_root,
|
||||||
bid,
|
bid,
|
||||||
data_columns_to_import_and_publish.clone(),
|
&data_columns_to_import_and_publish,
|
||||||
)
|
)
|
||||||
.map(|availability| {
|
.map(|availability| {
|
||||||
DataColumnReconstructionResult::Success((
|
DataColumnReconstructionResult::Success((
|
||||||
@@ -415,9 +425,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
pending_components: MappedRwLockReadGuard<'_, PendingComponents<T::EthSpec>>,
|
pending_components: MappedRwLockReadGuard<'_, PendingComponents<T::EthSpec>>,
|
||||||
num_expected_columns: usize,
|
num_expected_columns: usize,
|
||||||
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
) -> Result<Availability<T::EthSpec>, AvailabilityCheckError> {
|
||||||
if let Some(available_envelope) =
|
if let Some(available_envelope) = pending_components.make_available(num_expected_columns)? {
|
||||||
pending_components.make_available(block_root, num_expected_columns)?
|
|
||||||
{
|
|
||||||
// Explicitly drop read lock before acquiring write lock
|
// Explicitly drop read lock before acquiring write lock
|
||||||
drop(pending_components);
|
drop(pending_components);
|
||||||
if let Some(components) = self.availability_cache.write().get_mut(&block_root) {
|
if let Some(components) = self.availability_cache.write().get_mut(&block_root) {
|
||||||
@@ -441,7 +449,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
fn get_pending_components<F>(
|
fn get_pending_components<F>(
|
||||||
&self,
|
&self,
|
||||||
block_root: Hash256,
|
block_root: Hash256,
|
||||||
bid: PendingPayloadBid<T::EthSpec>,
|
bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>,
|
||||||
update_fn: F,
|
update_fn: F,
|
||||||
) -> Result<MappedRwLockReadGuard<'_, PendingComponents<T::EthSpec>>, AvailabilityCheckError>
|
) -> Result<MappedRwLockReadGuard<'_, PendingComponents<T::EthSpec>>, AvailabilityCheckError>
|
||||||
where
|
where
|
||||||
@@ -451,7 +459,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
|
|
||||||
{
|
{
|
||||||
let pending_components = write_lock
|
let pending_components = write_lock
|
||||||
.get_or_insert_mut(block_root, || PendingComponents::empty(block_root, bid));
|
.get_or_insert_mut(block_root, || PendingComponents::new(block_root, bid));
|
||||||
update_fn(pending_components)?
|
update_fn(pending_components)?
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,7 +509,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pending_components.reconstruction_started = true;
|
pending_components.reconstruction_started = true;
|
||||||
ReconstructColumnsDecision::Yes(pending_components.get_cached_data_columns(*block_root))
|
ReconstructColumnsDecision::Yes(pending_components.get_cached_data_columns())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This could mean some invalid data columns made it through to the `DataAvailabilityChecker`.
|
/// This could mean some invalid data columns made it through to the `DataAvailabilityChecker`.
|
||||||
@@ -738,12 +746,16 @@ mod data_availability_checker_tests {
|
|||||||
spec: &ChainSpec,
|
spec: &ChainSpec,
|
||||||
num_blobs: NumBlobs,
|
num_blobs: NumBlobs,
|
||||||
seed: u64,
|
seed: u64,
|
||||||
) -> (PendingPayloadBid<E>, Hash256, DataColumnSidecarList<E>) {
|
) -> (
|
||||||
|
Arc<SignedExecutionPayloadBid<E>>,
|
||||||
|
Hash256,
|
||||||
|
DataColumnSidecarList<E>,
|
||||||
|
) {
|
||||||
let mut rng = StdRng::seed_from_u64(seed);
|
let mut rng = StdRng::seed_from_u64(seed);
|
||||||
let (block, data_columns) =
|
let (block, data_columns) =
|
||||||
generate_rand_block_and_data_columns::<E>(ForkName::Gloas, num_blobs, &mut rng, spec);
|
generate_rand_block_and_data_columns::<E>(ForkName::Gloas, num_blobs, &mut rng, spec);
|
||||||
let block_root = block.canonical_root();
|
let block_root = block.canonical_root();
|
||||||
let bid = PendingPayloadBid::from_block(&block).expect("should get payload bid");
|
let bid = signed_payload_bid_from_block(&block).expect("should get payload bid");
|
||||||
cache.init_pending_bid(block_root, bid.clone());
|
cache.init_pending_bid(block_root, bid.clone());
|
||||||
(bid, block_root, data_columns)
|
(bid, block_root, data_columns)
|
||||||
}
|
}
|
||||||
@@ -753,7 +765,7 @@ mod data_availability_checker_tests {
|
|||||||
let (harness, cache, _path) = setup().await;
|
let (harness, cache, _path) = setup().await;
|
||||||
let (bid, block_root, data_columns) =
|
let (bid, block_root, data_columns) =
|
||||||
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
||||||
let epoch = bid.slot.epoch(E::slots_per_epoch());
|
let epoch = bid.message.slot.epoch(E::slots_per_epoch());
|
||||||
let sampling_cols = cache
|
let sampling_cols = cache
|
||||||
.custody_context()
|
.custody_context()
|
||||||
.sampling_columns_for_epoch(epoch, &harness.spec);
|
.sampling_columns_for_epoch(epoch, &harness.spec);
|
||||||
@@ -787,7 +799,7 @@ mod data_availability_checker_tests {
|
|||||||
let (bid, block_root, data_columns) =
|
let (bid, block_root, data_columns) =
|
||||||
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
||||||
|
|
||||||
let epoch = bid.slot.epoch(E::slots_per_epoch());
|
let epoch = bid.message.slot.epoch(E::slots_per_epoch());
|
||||||
let num_sampling_columns = cache
|
let num_sampling_columns = cache
|
||||||
.custody_context()
|
.custody_context()
|
||||||
.sampling_columns_for_epoch(epoch, &harness.spec)
|
.sampling_columns_for_epoch(epoch, &harness.spec)
|
||||||
@@ -846,7 +858,7 @@ mod data_availability_checker_tests {
|
|||||||
let (bid, block_root, data_columns) =
|
let (bid, block_root, data_columns) =
|
||||||
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
||||||
|
|
||||||
let epoch = bid.slot.epoch(E::slots_per_epoch());
|
let epoch = bid.message.slot.epoch(E::slots_per_epoch());
|
||||||
let sampling_cols = cache
|
let sampling_cols = cache
|
||||||
.custody_context()
|
.custody_context()
|
||||||
.sampling_columns_for_epoch(epoch, &harness.spec);
|
.sampling_columns_for_epoch(epoch, &harness.spec);
|
||||||
@@ -896,7 +908,7 @@ mod data_availability_checker_tests {
|
|||||||
let (harness, cache, _path) = setup().await;
|
let (harness, cache, _path) = setup().await;
|
||||||
let (bid, block_root, data_columns) =
|
let (bid, block_root, data_columns) =
|
||||||
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
init_block(&cache, &harness.spec, NumBlobs::Number(1), RNG_SEED);
|
||||||
let block_epoch = bid.slot.epoch(E::slots_per_epoch());
|
let block_epoch = bid.message.slot.epoch(E::slots_per_epoch());
|
||||||
let column = data_columns.first().cloned().expect("should have column");
|
let column = data_columns.first().cloned().expect("should have column");
|
||||||
|
|
||||||
cache
|
cache
|
||||||
|
|||||||
@@ -1,37 +1,28 @@
|
|||||||
use kzg::KzgProof;
|
use kzg::KzgProof;
|
||||||
use ssz_types::VariableList;
|
use ssz_types::VariableList;
|
||||||
|
use std::collections::HashMap;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use types::{Cell, ColumnIndex, DataColumnSidecar, DataColumnSidecarGloas, EthSpec, Hash256, Slot};
|
use types::{Cell, ColumnIndex, DataColumnSidecar, DataColumnSidecarGloas, EthSpec, Hash256, Slot};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone, Default)]
|
||||||
pub struct PendingColumn<E: EthSpec> {
|
pub struct PendingColumn<E: EthSpec> {
|
||||||
cells: Vec<Option<(Cell<E>, KzgProof)>>,
|
cells: HashMap<usize, (Cell<E>, KzgProof)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E: EthSpec> PendingColumn<E> {
|
impl<E: EthSpec> PendingColumn<E> {
|
||||||
pub fn new_with_capacity(blobs: usize) -> Self {
|
|
||||||
Self {
|
|
||||||
cells: vec![None; blobs],
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn insert(&mut self, index: usize, cell: &Cell<E>, proof: &KzgProof) {
|
pub fn insert(&mut self, index: usize, cell: &Cell<E>, proof: &KzgProof) {
|
||||||
if let Some(existing_cell) = self.cells.get_mut(index)
|
self.cells
|
||||||
&& existing_cell.is_none()
|
.entry(index)
|
||||||
{
|
.or_insert_with(|| (cell.clone(), *proof));
|
||||||
*existing_cell = Some((cell.clone(), *proof));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cell_matches(&self, index: usize, cell: &Cell<E>, proof: &KzgProof) -> Option<bool> {
|
pub fn cell_matches(&self, index: usize, cell: &Cell<E>, proof: &KzgProof) -> Option<bool> {
|
||||||
self.cells
|
let (c, p) = self.cells.get(&index)?;
|
||||||
.get(index)?
|
Some(c == cell && p == proof)
|
||||||
.as_ref()
|
|
||||||
.map(|(c, p)| c == cell && p == proof)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_complete(&self, blob_count: usize) -> bool {
|
pub fn is_complete(&self, blob_count: usize) -> bool {
|
||||||
self.cells.len() == blob_count && self.cells.iter().all(|cell| cell.is_some())
|
(0..blob_count).all(|i| self.cells.contains_key(&i))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn try_to_sidecar(
|
pub fn try_to_sidecar(
|
||||||
@@ -41,17 +32,11 @@ impl<E: EthSpec> PendingColumn<E> {
|
|||||||
beacon_block_root: Hash256,
|
beacon_block_root: Hash256,
|
||||||
blob_count: usize,
|
blob_count: usize,
|
||||||
) -> Option<Arc<DataColumnSidecar<E>>> {
|
) -> Option<Arc<DataColumnSidecar<E>>> {
|
||||||
if self.cells.len() != blob_count {
|
let mut column = Vec::with_capacity(blob_count);
|
||||||
return None;
|
let mut kzg_proofs = Vec::with_capacity(blob_count);
|
||||||
}
|
|
||||||
|
|
||||||
let mut column = Vec::with_capacity(self.cells.len());
|
for i in 0..blob_count {
|
||||||
let mut kzg_proofs = Vec::with_capacity(self.cells.len());
|
let (cell, proof) = self.cells.get(&i)?;
|
||||||
|
|
||||||
for cell in self.cells.iter() {
|
|
||||||
let Some((cell, proof)) = cell else {
|
|
||||||
return None;
|
|
||||||
};
|
|
||||||
// TODO(gloas): we likely want to go and arc all cells
|
// TODO(gloas): we likely want to go and arc all cells
|
||||||
column.push(cell.clone());
|
column.push(cell.clone());
|
||||||
kzg_proofs.push(*proof);
|
kzg_proofs.push(*proof);
|
||||||
|
|||||||
@@ -10,26 +10,23 @@ use std::sync::Arc;
|
|||||||
use tracing::{Span, debug, debug_span};
|
use tracing::{Span, debug, debug_span};
|
||||||
use types::DataColumnSidecar;
|
use types::DataColumnSidecar;
|
||||||
use types::{
|
use types::{
|
||||||
AbstractExecPayload, BeaconStateError, ColumnIndex, Epoch, EthSpec, Hash256, KzgCommitments,
|
AbstractExecPayload, BeaconStateError, ColumnIndex, Epoch, EthSpec, Hash256, SignedBeaconBlock,
|
||||||
SignedBeaconBlock, Slot,
|
SignedExecutionPayloadBid,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
/// Extract the signed execution payload bid from a Gloas block as a shareable `Arc`.
|
||||||
pub struct PendingPayloadBid<E: EthSpec> {
|
///
|
||||||
pub slot: Slot,
|
/// Returns `Err` if the block is not a Gloas block.
|
||||||
pub blob_kzg_commitments: KzgCommitments<E>,
|
pub fn signed_payload_bid_from_block<E: EthSpec, P: AbstractExecPayload<E>>(
|
||||||
}
|
block: &SignedBeaconBlock<E, P>,
|
||||||
|
) -> Result<Arc<SignedExecutionPayloadBid<E>>, BeaconStateError> {
|
||||||
impl<E: EthSpec> PendingPayloadBid<E> {
|
Ok(Arc::new(
|
||||||
pub fn from_block<Payload: AbstractExecPayload<E>>(
|
block
|
||||||
block: &SignedBeaconBlock<E, Payload>,
|
.message()
|
||||||
) -> Result<Self, BeaconStateError> {
|
.body()
|
||||||
let signed_bid = block.message().body().signed_execution_payload_bid()?;
|
.signed_execution_payload_bid()?
|
||||||
Ok(Self {
|
.clone(),
|
||||||
slot: block.slot(),
|
))
|
||||||
blob_kzg_commitments: signed_bid.message.blob_kzg_commitments.clone(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This represents the components of a payload pending data availability.
|
/// This represents the components of a payload pending data availability.
|
||||||
@@ -37,7 +34,8 @@ impl<E: EthSpec> PendingPayloadBid<E> {
|
|||||||
/// The columns are all gossip and kzg verified.
|
/// The columns are all gossip and kzg verified.
|
||||||
/// The payload is considered "available" when all required columns are received.
|
/// The payload is considered "available" when all required columns are received.
|
||||||
pub struct PendingComponents<E: EthSpec> {
|
pub struct PendingComponents<E: EthSpec> {
|
||||||
pub bid: PendingPayloadBid<E>,
|
pub block_root: Hash256,
|
||||||
|
pub bid: Arc<SignedExecutionPayloadBid<E>>,
|
||||||
/// a cached post executed payload envelope
|
/// a cached post executed payload envelope
|
||||||
pub envelope: Option<AvailabilityPendingExecutedEnvelope<E>>,
|
pub envelope: Option<AvailabilityPendingExecutedEnvelope<E>>,
|
||||||
pub verified_data_columns: HashMap<ColumnIndex, PendingColumn<E>>,
|
pub verified_data_columns: HashMap<ColumnIndex, PendingColumn<E>>,
|
||||||
@@ -47,18 +45,18 @@ pub struct PendingComponents<E: EthSpec> {
|
|||||||
|
|
||||||
impl<E: EthSpec> PendingComponents<E> {
|
impl<E: EthSpec> PendingComponents<E> {
|
||||||
pub fn num_blobs_expected(&self) -> usize {
|
pub fn num_blobs_expected(&self) -> usize {
|
||||||
self.bid.blob_kzg_commitments.len()
|
self.bid.message.blob_kzg_commitments.len()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the completed custody columns
|
/// Returns the completed custody columns
|
||||||
pub fn get_cached_data_columns(&self, block_root: Hash256) -> Vec<Arc<DataColumnSidecar<E>>> {
|
pub fn get_cached_data_columns(&self) -> Vec<Arc<DataColumnSidecar<E>>> {
|
||||||
self.verified_data_columns
|
self.verified_data_columns
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(col_idx, col)| {
|
.filter_map(|(col_idx, col)| {
|
||||||
col.try_to_sidecar(
|
col.try_to_sidecar(
|
||||||
*col_idx,
|
*col_idx,
|
||||||
self.bid.slot,
|
self.bid.message.slot,
|
||||||
block_root,
|
self.block_root,
|
||||||
self.num_blobs_expected(),
|
self.num_blobs_expected(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@@ -77,17 +75,16 @@ impl<E: EthSpec> PendingComponents<E> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Merges a given set of data columns into the cache.
|
/// Merges a given set of data columns into the cache.
|
||||||
pub(crate) fn merge_data_columns<I: IntoIterator<Item = KzgVerifiedCustodyDataColumn<E>>>(
|
pub(crate) fn merge_data_columns(
|
||||||
&mut self,
|
&mut self,
|
||||||
kzg_verified_data_columns: I,
|
kzg_verified_data_columns: &[KzgVerifiedCustodyDataColumn<E>],
|
||||||
) -> Result<(), AvailabilityCheckError> {
|
) -> Result<(), AvailabilityCheckError> {
|
||||||
let num_blobs_expected = self.num_blobs_expected();
|
|
||||||
for data_column in kzg_verified_data_columns {
|
for data_column in kzg_verified_data_columns {
|
||||||
let data_column = data_column.as_data_column();
|
let data_column = data_column.as_data_column();
|
||||||
let col = self
|
let col = self
|
||||||
.verified_data_columns
|
.verified_data_columns
|
||||||
.entry(*data_column.index())
|
.entry(*data_column.index())
|
||||||
.or_insert_with(|| PendingColumn::new_with_capacity(num_blobs_expected));
|
.or_default();
|
||||||
for (cell_idx, (cell, proof)) in data_column
|
for (cell_idx, (cell, proof)) in data_column
|
||||||
.column()
|
.column()
|
||||||
.iter()
|
.iter()
|
||||||
@@ -121,7 +118,6 @@ impl<E: EthSpec> PendingComponents<E> {
|
|||||||
/// Returns `Some` if the envelope and all required data columns have been received.
|
/// Returns `Some` if the envelope and all required data columns have been received.
|
||||||
pub fn make_available(
|
pub fn make_available(
|
||||||
&self,
|
&self,
|
||||||
block_hash: Hash256,
|
|
||||||
num_expected_columns: usize,
|
num_expected_columns: usize,
|
||||||
) -> Result<Option<AvailableExecutedEnvelope<E>>, AvailabilityCheckError> {
|
) -> Result<Option<AvailableExecutedEnvelope<E>>, AvailabilityCheckError> {
|
||||||
// Check if the payload has been received and executed
|
// Check if the payload has been received and executed
|
||||||
@@ -154,17 +150,7 @@ impl<E: EthSpec> PendingComponents<E> {
|
|||||||
debug!("All data columns received, data is available");
|
debug!("All data columns received, data is available");
|
||||||
});
|
});
|
||||||
|
|
||||||
self.verified_data_columns
|
self.get_cached_data_columns()
|
||||||
.iter()
|
|
||||||
.filter_map(|(col_idx, col)| {
|
|
||||||
col.try_to_sidecar(
|
|
||||||
*col_idx,
|
|
||||||
self.bid.slot,
|
|
||||||
block_hash,
|
|
||||||
self.num_blobs_expected(),
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.collect()
|
|
||||||
}
|
}
|
||||||
Ordering::Less => {
|
Ordering::Less => {
|
||||||
// Not enough data columns received yet
|
// Not enough data columns received yet
|
||||||
@@ -187,11 +173,12 @@ impl<E: EthSpec> PendingComponents<E> {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an empty `PendingComponents` object with the given block root.
|
/// Constructs a fresh `PendingComponents` with no envelope and no columns yet.
|
||||||
pub fn empty(block_root: Hash256, bid: PendingPayloadBid<E>) -> Self {
|
pub fn new(block_root: Hash256, bid: Arc<SignedExecutionPayloadBid<E>>) -> Self {
|
||||||
let span = debug_span!(parent: None, "lh_pending_components", %block_root);
|
let span = debug_span!(parent: None, "lh_pending_components", %block_root);
|
||||||
let _guard = span.clone().entered();
|
let _guard = span.clone().entered();
|
||||||
Self {
|
Self {
|
||||||
|
block_root,
|
||||||
bid,
|
bid,
|
||||||
envelope: None,
|
envelope: None,
|
||||||
verified_data_columns: HashMap::new(),
|
verified_data_columns: HashMap::new(),
|
||||||
@@ -202,7 +189,7 @@ impl<E: EthSpec> PendingComponents<E> {
|
|||||||
|
|
||||||
/// Returns the epoch of the bid or first data column, if available.
|
/// Returns the epoch of the bid or first data column, if available.
|
||||||
pub fn epoch(&self) -> Epoch {
|
pub fn epoch(&self) -> Epoch {
|
||||||
self.bid.slot.epoch(E::slots_per_epoch())
|
self.bid.message.slot.epoch(E::slots_per_epoch())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn status_str(&self, num_expected_columns: usize) -> String {
|
pub fn status_str(&self, num_expected_columns: usize) -> String {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use beacon_chain::blob_verification::GossipVerifiedBlob;
|
use beacon_chain::blob_verification::GossipVerifiedBlob;
|
||||||
use beacon_chain::data_column_verification::GossipVerifiedDataColumn;
|
use beacon_chain::data_column_verification::GossipVerifiedDataColumn;
|
||||||
use beacon_chain::pending_payload_cache::PendingPayloadBid;
|
|
||||||
use beacon_chain::test_utils::{
|
use beacon_chain::test_utils::{
|
||||||
BeaconChainHarness, fork_name_from_env, generate_data_column_sidecars_from_block, test_spec,
|
BeaconChainHarness, fork_name_from_env, generate_data_column_sidecars_from_block, test_spec,
|
||||||
};
|
};
|
||||||
@@ -12,8 +11,8 @@ use types::data::FixedBlobSidecarList;
|
|||||||
use types::test_utils::TestRandom;
|
use types::test_utils::TestRandom;
|
||||||
use types::{
|
use types::{
|
||||||
BlobSidecar, DataColumnSidecar, DataColumnSidecarFulu, DataColumnSidecarGloas, Domain, EthSpec,
|
BlobSidecar, DataColumnSidecar, DataColumnSidecarFulu, DataColumnSidecarGloas, Domain, EthSpec,
|
||||||
KzgCommitments, MinimalEthSpec, PayloadAttestationData, PayloadAttestationMessage, SignedRoot,
|
MinimalEthSpec, PayloadAttestationData, PayloadAttestationMessage, SignedExecutionPayloadBid,
|
||||||
Slot,
|
SignedRoot, Slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
type E = MinimalEthSpec;
|
type E = MinimalEthSpec;
|
||||||
@@ -88,13 +87,12 @@ async fn data_column_sidecar_event_on_process_gossip_data_column() {
|
|||||||
random_sidecar.index = harness.chain.sampling_columns_for_epoch(epoch)[0];
|
random_sidecar.index = harness.chain.sampling_columns_for_epoch(epoch)[0];
|
||||||
|
|
||||||
// For gloas, the bid must be known, e.g. in the pending payload cache
|
// For gloas, the bid must be known, e.g. in the pending payload cache
|
||||||
harness.chain.pending_payload_cache.init_pending_bid(
|
let mut bid = SignedExecutionPayloadBid::<E>::empty();
|
||||||
random_sidecar.beacon_block_root,
|
bid.message.slot = Slot::new(10);
|
||||||
PendingPayloadBid {
|
harness
|
||||||
slot: Slot::new(10),
|
.chain
|
||||||
blob_kzg_commitments: KzgCommitments::<E>::empty(),
|
.pending_payload_cache
|
||||||
},
|
.init_pending_bid(random_sidecar.beacon_block_root, Arc::new(bid));
|
||||||
);
|
|
||||||
|
|
||||||
DataColumnSidecar::Gloas(random_sidecar)
|
DataColumnSidecar::Gloas(random_sidecar)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user