Skip to content

Commit

Permalink
feat(engine): set eth_syncing = true if pruner is active (paradigmx…
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Aug 4, 2023
1 parent ff1ef29 commit b673b6c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,13 +1599,18 @@ where
EnginePruneEvent::Started(tip_block_number) => {
trace!(target: "consensus::engine", %tip_block_number, "Pruner started");
self.metrics.pruner_runs.increment(1);
// Engine can't process any FCU/payload messages from CL while we're pruning, as
// pruner needs an exclusive write access to the database. To prevent CL from
// sending us unneeded updates, we need to respond `true` on `eth_syncing` request.
self.sync_state_updater.update_sync_state(SyncState::Syncing);
}
EnginePruneEvent::TaskDropped => {
error!(target: "consensus::engine", "Failed to receive spawned pruner");
return Some(Err(BeaconConsensusEngineError::PrunerChannelClosed))
}
EnginePruneEvent::Finished { result } => {
trace!(target: "consensus::engine", ?result, "Pruner finished");
self.sync_state_updater.update_sync_state(SyncState::Idle);
match result {
Ok(_) => {
// Update the state and hashes of the blockchain tree if possible.
Expand Down

0 comments on commit b673b6c

Please sign in to comment.