mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-01 03:33:47 +00:00
Merge commit '65a5eb829264cb279ed66814c961991ae3a0a04b' into eip4844
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::attestation_verification::{
|
||||
VerifiedUnaggregatedAttestation,
|
||||
};
|
||||
use crate::attester_cache::{AttesterCache, AttesterCacheKey};
|
||||
use crate::beacon_block_streamer::{BeaconBlockStreamer, CheckEarlyAttesterCache};
|
||||
use crate::beacon_proposer_cache::compute_proposer_duties_from_head;
|
||||
use crate::beacon_proposer_cache::BeaconProposerCache;
|
||||
use crate::blob_cache::BlobCache;
|
||||
@@ -105,6 +106,7 @@ use store::{
|
||||
DatabaseBlock, Error as DBError, HotColdDB, KeyValueStore, KeyValueStoreOp, StoreItem, StoreOp,
|
||||
};
|
||||
use task_executor::{ShutdownReason, TaskExecutor};
|
||||
use tokio_stream::Stream;
|
||||
use tree_hash::TreeHash;
|
||||
use types::beacon_state::CloneConfig;
|
||||
use types::consts::eip4844::MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS;
|
||||
@@ -947,14 +949,42 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
/// ## Errors
|
||||
///
|
||||
/// May return a database error.
|
||||
pub async fn get_block_checking_early_attester_cache(
|
||||
&self,
|
||||
block_root: &Hash256,
|
||||
) -> Result<Option<Arc<SignedBeaconBlock<T::EthSpec>>>, Error> {
|
||||
if let Some(block) = self.early_attester_cache.get_block(*block_root) {
|
||||
return Ok(Some(block));
|
||||
}
|
||||
Ok(self.get_block(block_root).await?.map(Arc::new))
|
||||
pub fn get_blocks_checking_early_attester_cache(
|
||||
self: &Arc<Self>,
|
||||
block_roots: Vec<Hash256>,
|
||||
executor: &TaskExecutor,
|
||||
) -> Result<
|
||||
impl Stream<
|
||||
Item = (
|
||||
Hash256,
|
||||
Arc<Result<Option<Arc<SignedBeaconBlock<T::EthSpec>>>, Error>>,
|
||||
),
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
Ok(
|
||||
BeaconBlockStreamer::<T>::new(self, CheckEarlyAttesterCache::Yes)?
|
||||
.launch_stream(block_roots, executor),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_blocks(
|
||||
self: &Arc<Self>,
|
||||
block_roots: Vec<Hash256>,
|
||||
executor: &TaskExecutor,
|
||||
) -> Result<
|
||||
impl Stream<
|
||||
Item = (
|
||||
Hash256,
|
||||
Arc<Result<Option<Arc<SignedBeaconBlock<T::EthSpec>>>, Error>>,
|
||||
),
|
||||
>,
|
||||
Error,
|
||||
> {
|
||||
Ok(
|
||||
BeaconBlockStreamer::<T>::new(self, CheckEarlyAttesterCache::No)?
|
||||
.launch_stream(block_roots, executor),
|
||||
)
|
||||
}
|
||||
|
||||
pub async fn get_block_and_blobs_checking_early_attester_cache(
|
||||
|
||||
Reference in New Issue
Block a user