mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
smol fixes
This commit is contained in:
@@ -3820,9 +3820,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 = signed_payload_bid_from_block(block.as_ref())?;
|
let bid = signed_payload_bid_from_block(block.as_ref())?;
|
||||||
chain
|
chain.pending_payload_cache.insert_bid(block_root, bid);
|
||||||
.pending_payload_cache
|
|
||||||
.init_pending_bid(block_root, bid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publish_fn()?;
|
publish_fn()?;
|
||||||
|
|||||||
@@ -1334,7 +1334,7 @@ pub(crate) fn load_gloas_payload_bid<T: BeaconChainTypes>(
|
|||||||
|
|
||||||
chain
|
chain
|
||||||
.pending_payload_cache
|
.pending_payload_cache
|
||||||
.init_pending_bid(block_root, bid.clone());
|
.insert_bid(block_root, bid.clone());
|
||||||
|
|
||||||
Ok(Some(bid))
|
Ok(Some(bid))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ 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, Hash256, PartialDataColumnSidecarRef
|
ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, Epoch, EthSpec, Hash256,
|
||||||
|
PartialDataColumnSidecarRef,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod pending_column;
|
mod pending_column;
|
||||||
@@ -230,11 +231,7 @@ impl<T: BeaconChainTypes> PendingPayloadCache<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Inserts a bid into the pending payload cache.
|
/// Inserts a bid into the pending payload cache.
|
||||||
pub fn insert_bid(
|
pub fn insert_bid(&self, block_root: Hash256, bid: Arc<SignedExecutionPayloadBid<T::EthSpec>>) {
|
||||||
&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::new(block_root, bid));
|
write_lock.get_or_insert_mut(block_root, || PendingComponents::new(block_root, bid));
|
||||||
}
|
}
|
||||||
@@ -756,7 +753,7 @@ mod data_availability_checker_tests {
|
|||||||
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 = signed_payload_bid_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.insert_bid(block_root, bid.clone());
|
||||||
(bid, block_root, data_columns)
|
(bid, block_root, data_columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ async fn data_column_sidecar_event_on_process_gossip_data_column() {
|
|||||||
harness
|
harness
|
||||||
.chain
|
.chain
|
||||||
.pending_payload_cache
|
.pending_payload_cache
|
||||||
.init_pending_bid(random_sidecar.beacon_block_root, Arc::new(bid));
|
.insert_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