mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-payload-processing
This commit is contained in:
@@ -287,21 +287,6 @@ pub struct BlockImportData<E: EthSpec> {
|
||||
pub consensus_context: ConsensusContext<E>,
|
||||
}
|
||||
|
||||
impl<E: EthSpec> BlockImportData<E> {
|
||||
pub fn __new_for_test(
|
||||
block_root: Hash256,
|
||||
state: BeaconState<E>,
|
||||
parent_block: SignedBeaconBlock<E, BlindedPayload<E>>,
|
||||
) -> Self {
|
||||
Self {
|
||||
block_root,
|
||||
state,
|
||||
parent_block,
|
||||
consensus_context: ConsensusContext::new(Slot::new(0)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for common block operations.
|
||||
pub trait AsBlock<E: EthSpec> {
|
||||
fn slot(&self) -> Slot;
|
||||
|
||||
@@ -698,6 +698,8 @@ impl<T: BeaconChainTypes> DataAvailabilityCheckerInner<T> {
|
||||
pub fn remove_pre_execution_block(&self, block_root: &Hash256) {
|
||||
// The read lock is immediately dropped so we can safely remove the block from the cache.
|
||||
if let Some(BlockProcessStatus::NotValidated(_, _)) = self.get_cached_block(block_root) {
|
||||
// If the block is execution invalid, this status is permanent and idempotent to this
|
||||
// block_root. We drop its components (e.g. columns) because they will never be useful.
|
||||
self.critical.write().pop(block_root);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,7 +818,11 @@ where
|
||||
}
|
||||
|
||||
pub fn get_full_block(&self, block_root: &Hash256) -> RpcBlock<E> {
|
||||
let block = self.chain.get_blinded_block(block_root).unwrap().unwrap();
|
||||
let block = self
|
||||
.chain
|
||||
.get_blinded_block(block_root)
|
||||
.unwrap()
|
||||
.unwrap_or_else(|| panic!("block root does not exist in harness {block_root:?}"));
|
||||
let full_block = self.chain.store.make_full_block(block_root, block).unwrap();
|
||||
self.build_rpc_block_from_store_blobs(Some(*block_root), Arc::new(full_block))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user