From dd766042df66248808476d2d30ab862335cbce80 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 15 Mar 2022 14:00:06 -0700 Subject: [PATCH] Remove LedgerMetricReportService from TVU --- core/src/tvu.rs | 9 ++++----- core/src/validator.rs | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/core/src/tvu.rs b/core/src/tvu.rs index dc6d382d94..18a2256f44 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -16,7 +16,6 @@ use { cost_update_service::CostUpdateService, drop_bank_service::DropBankService, ledger_cleanup_service::LedgerCleanupService, - ledger_metric_report_service::LedgerMetricReportService, replay_stage::{ReplayStage, ReplayStageConfig}, retransmit_stage::RetransmitStage, rewards_recorder_service::RewardsRecorderSender, @@ -74,7 +73,6 @@ pub struct Tvu { retransmit_stage: RetransmitStage, replay_stage: ReplayStage, ledger_cleanup_service: Option, - ledger_metric_report_service: LedgerMetricReportService, accounts_background_service: AccountsBackgroundService, accounts_hash_verifier: AccountsHashVerifier, cost_update_service: CostUpdateService, @@ -339,7 +337,10 @@ impl Tvu { ) }); - let ledger_metric_report_service = LedgerMetricReportService::new(blockstore, exit); + let accounts_background_request_handler = AbsRequestHandler { + snapshot_request_handler, + pruned_banks_receiver, + }; let accounts_background_service = AccountsBackgroundService::new( bank_forks.clone(), @@ -356,7 +357,6 @@ impl Tvu { retransmit_stage, replay_stage, ledger_cleanup_service, - ledger_metric_report_service, accounts_background_service, accounts_hash_verifier, cost_update_service, @@ -390,7 +390,6 @@ impl Tvu { if self.ledger_cleanup_service.is_some() { self.ledger_cleanup_service.unwrap().join()?; } - self.ledger_metric_report_service.join()?; self.accounts_background_service.join()?; self.replay_stage.join()?; self.accounts_hash_verifier.join()?; diff --git a/core/src/validator.rs b/core/src/validator.rs index a5367c2dea..bab7847e83 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -8,6 +8,7 @@ use { cluster_info_vote_listener::VoteTracker, completed_data_sets_service::CompletedDataSetsService, consensus::{reconcile_blockstore_roots_with_tower, Tower}, + ledger_metric_report_service::LedgerMetricReportService, poh_timing_report_service::PohTimingReportService, rewards_recorder_service::{RewardsRecorderSender, RewardsRecorderService}, sample_performance_service::SamplePerformanceService, @@ -334,6 +335,7 @@ pub struct Validator { pub bank_forks: Arc>, pub blockstore: Arc, geyser_plugin_service: Option, + ledger_metric_report_service: LedgerMetricReportService, } // in the distant future, get rid of ::new()/exit() and use Result properly... @@ -829,6 +831,9 @@ impl Validator { abort(); }; + let ledger_metric_report_service = + LedgerMetricReportService::new(blockstore.clone(), &exit); + let wait_for_vote_to_start_leader = !waited_for_supermajority && !config.no_wait_for_vote_to_start_leader; @@ -983,6 +988,7 @@ impl Validator { bank_forks, blockstore: blockstore.clone(), geyser_plugin_service, + ledger_metric_report_service, } }