mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
resolve merge conflict and migrate il service to new pardigmn
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user