resolve merge conflict and migrate il service to new pardigmn

This commit is contained in:
Eitan Seri-Levi
2025-05-21 12:43:43 -07:00
358 changed files with 11541 additions and 6759 deletions

View File

@@ -53,7 +53,7 @@ use slot_clock::SlotClock;
use state_processing::AllCaches;
use std::sync::Arc;
use std::time::Duration;
use store::{iter::StateRootsIterator, KeyValueStoreOp, StoreItem};
use store::{iter::StateRootsIterator, KeyValueStore, KeyValueStoreOp, StoreItem};
use task_executor::{JoinHandle, ShutdownReason};
use tracing::{debug, error, info, warn};
use types::*;
@@ -845,7 +845,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
);
if is_epoch_transition || reorg_distance.is_some() {
self.persist_head_and_fork_choice()?;
self.persist_fork_choice()?;
self.op_pool.prune_attestations(self.epoch()?);
}
@@ -988,7 +988,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self.store_migrator.process_finalization(
new_finalized_state_root.into(),
new_view.finalized_checkpoint,
self.head_tracker.clone(),
)?;
// Prune blobs in the background.
@@ -1003,6 +1002,14 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
Ok(())
}
/// Persist fork choice to disk, writing immediately.
pub fn persist_fork_choice(&self) -> Result<(), Error> {
let _fork_choice_timer = metrics::start_timer(&metrics::PERSIST_FORK_CHOICE);
let batch = vec![self.persist_fork_choice_in_batch()];
self.store.hot_db.do_atomically(batch)?;
Ok(())
}
/// Return a database operation for writing fork choice to disk.
pub fn persist_fork_choice_in_batch(&self) -> KeyValueStoreOp {
Self::persist_fork_choice_in_batch_standalone(&self.canonical_head.fork_choice_read_lock())