mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: add BeaconConsensusEvent for live sync download requests (#7230)
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
use crate::events::cl::ConsensusLayerHealthEvent;
|
||||
use futures::Stream;
|
||||
use reth_beacon_consensus::{BeaconConsensusEngineEvent, ForkchoiceStatus};
|
||||
use reth_beacon_consensus::{
|
||||
BeaconConsensusEngineEvent, ConsensusEngineLiveSyncProgress, ForkchoiceStatus,
|
||||
};
|
||||
use reth_db::{database::Database, database_metrics::DatabaseMetadata};
|
||||
use reth_interfaces::consensus::ForkchoiceState;
|
||||
use reth_network::{NetworkEvent, NetworkHandle};
|
||||
@@ -233,6 +235,20 @@ impl<DB> NodeState<DB> {
|
||||
self.safe_block_hash = Some(safe_block_hash);
|
||||
self.finalized_block_hash = Some(finalized_block_hash);
|
||||
}
|
||||
BeaconConsensusEngineEvent::LiveSyncProgress(live_sync_progress) => {
|
||||
match live_sync_progress {
|
||||
ConsensusEngineLiveSyncProgress::DownloadingBlocks {
|
||||
remaining_blocks,
|
||||
target,
|
||||
} => {
|
||||
info!(
|
||||
remaining_blocks,
|
||||
target_block_hash=?target,
|
||||
"Live sync in progress, downloading blocks"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
BeaconConsensusEngineEvent::CanonicalBlockAdded(block, elapsed) => {
|
||||
info!(
|
||||
number=block.number,
|
||||
|
||||
Reference in New Issue
Block a user