Import validated IL's into IL cache

This commit is contained in:
Eitan Seri-Levi
2025-01-17 16:09:21 +07:00
parent f87f83873a
commit 77551ea1b7
4 changed files with 11 additions and 5 deletions

View File

@@ -471,7 +471,7 @@ pub struct BeaconChain<T: BeaconChainTypes> {
/// A cache used when producing attestations whilst the head block is still being imported.
pub early_attester_cache: EarlyAttesterCache<T::EthSpec>,
/// A cache used to store verified/equivocating inclusion lists.
pub inclusion_list_cache: InclusionListCache<T::EthSpec>,
pub inclusion_list_cache: RwLock<InclusionListCache<T::EthSpec>>,
/// Cache gossip verified blocks to serve over ReqResp before they are imported
pub reqresp_pre_import_cache: Arc<RwLock<ReqRespPreImportCache<T::EthSpec>>>,
/// A cache used to keep track of various block timings.
@@ -7293,6 +7293,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
Ok(())
}
pub fn on_verified_inclusion_list(&self, signed_il: SignedInclusionList<T::EthSpec>) {
self.inclusion_list_cache.write().on_inclusion_list(signed_il);
}
pub fn metrics(&self) -> BeaconChainMetrics {
BeaconChainMetrics {
reqresp_pre_import_cache_len: self.reqresp_pre_import_cache.read().len(),