diff --git a/core/src/validator.rs b/core/src/validator.rs index 9dede099d1..2becf95903 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -58,7 +58,7 @@ use { }, blockstore_options::{BlockstoreOptions, BlockstoreRecoveryMode, LedgerColumnOptions}, blockstore_processor::{self, TransactionStatusSender}, - entry_notifier_interface::EntryNotifierLock, + entry_notifier_interface::EntryNotifierArc, entry_notifier_service::{EntryNotifierSender, EntryNotifierService}, leader_schedule::FixedSchedule, leader_schedule_cache::LeaderScheduleCache, @@ -1690,7 +1690,7 @@ fn load_blockstore( start_progress: &Arc>, accounts_update_notifier: Option, transaction_notifier: Option, - entry_notifier: Option, + entry_notifier: Option, poh_timing_point_sender: Option, ) -> Result< ( diff --git a/geyser-plugin-manager/src/geyser_plugin_service.rs b/geyser-plugin-manager/src/geyser_plugin_service.rs index b8f9db4910..b762c210e4 100644 --- a/geyser-plugin-manager/src/geyser_plugin_service.rs +++ b/geyser-plugin-manager/src/geyser_plugin_service.rs @@ -12,7 +12,7 @@ use { crossbeam_channel::Receiver, log::*, solana_accounts_db::accounts_update_notifier_interface::AccountsUpdateNotifier, - solana_ledger::entry_notifier_interface::EntryNotifierLock, + solana_ledger::entry_notifier_interface::EntryNotifierArc, solana_rpc::{ optimistically_confirmed_bank_tracker::SlotNotification, transaction_notifier_interface::TransactionNotifierLock, @@ -35,7 +35,7 @@ pub struct GeyserPluginService { plugin_manager: Arc>, accounts_update_notifier: Option, transaction_notifier: Option, - entry_notifier: Option, + entry_notifier: Option, block_metadata_notifier: Option, } @@ -100,9 +100,9 @@ impl GeyserPluginService { None }; - let entry_notifier: Option = if entry_notifications_enabled { + let entry_notifier: Option = if entry_notifications_enabled { let entry_notifier = EntryNotifierImpl::new(plugin_manager.clone()); - Some(Arc::new(RwLock::new(entry_notifier))) + Some(Arc::new(entry_notifier)) } else { None }; @@ -164,7 +164,7 @@ impl GeyserPluginService { self.transaction_notifier.clone() } - pub fn get_entry_notifier(&self) -> Option { + pub fn get_entry_notifier(&self) -> Option { self.entry_notifier.clone() } diff --git a/ledger/src/entry_notifier_interface.rs b/ledger/src/entry_notifier_interface.rs index de523fc979..174be9e1b7 100644 --- a/ledger/src/entry_notifier_interface.rs +++ b/ledger/src/entry_notifier_interface.rs @@ -1,11 +1,7 @@ -use { - solana_entry::entry::EntrySummary, - solana_sdk::clock::Slot, - std::sync::{Arc, RwLock}, -}; +use {solana_entry::entry::EntrySummary, solana_sdk::clock::Slot, std::sync::Arc}; pub trait EntryNotifier { fn notify_entry(&self, slot: Slot, index: usize, entry: &EntrySummary); } -pub type EntryNotifierLock = Arc>; +pub type EntryNotifierArc = Arc; diff --git a/ledger/src/entry_notifier_service.rs b/ledger/src/entry_notifier_service.rs index 5e108c94e8..ec7eae0bc7 100644 --- a/ledger/src/entry_notifier_service.rs +++ b/ledger/src/entry_notifier_service.rs @@ -1,5 +1,5 @@ use { - crate::entry_notifier_interface::EntryNotifierLock, + crate::entry_notifier_interface::EntryNotifierArc, crossbeam_channel::{unbounded, Receiver, RecvTimeoutError, Sender}, solana_entry::entry::EntrySummary, solana_sdk::clock::Slot, @@ -28,7 +28,7 @@ pub struct EntryNotifierService { } impl EntryNotifierService { - pub fn new(entry_notifier: EntryNotifierLock, exit: Arc) -> Self { + pub fn new(entry_notifier: EntryNotifierArc, exit: Arc) -> Self { let (entry_notification_sender, entry_notification_receiver) = unbounded(); let thread_hdl = Builder::new() .name("solEntryNotif".to_string()) @@ -52,14 +52,11 @@ impl EntryNotifierService { fn notify_entry( entry_notification_receiver: &EntryNotifierReceiver, - entry_notifier: EntryNotifierLock, + entry_notifier: EntryNotifierArc, ) -> Result<(), RecvTimeoutError> { let EntryNotification { slot, index, entry } = entry_notification_receiver.recv_timeout(Duration::from_secs(1))?; - entry_notifier - .write() - .unwrap() - .notify_entry(slot, index, &entry); + entry_notifier.notify_entry(slot, index, &entry); Ok(()) }