Refactor slot status notification to decouple from accounts notifications (#21308)
Problem Slot status can be used of in other scenarios in addition to account information such as transactions, blocks. The current implementation is too tightly coupled. Summary of Changes Decouple the slot status notification from accounts notification. Created a new slot status notification module.
This commit is contained in:
@ -202,15 +202,6 @@ pub mod tests {
|
||||
.push((slot, account.clone_account()));
|
||||
}
|
||||
|
||||
/// Notified when a slot is optimistically confirmed
|
||||
fn notify_slot_confirmed(&self, _slot: Slot, _parent: Option<Slot>) {}
|
||||
|
||||
/// Notified when a slot is marked frozen.
|
||||
fn notify_slot_processed(&self, _slot: Slot, _parent: Option<Slot>) {}
|
||||
|
||||
/// Notified when a slot is rooted.
|
||||
fn notify_slot_rooted(&self, _slot: Slot, _parent: Option<Slot>) {}
|
||||
|
||||
fn notify_end_of_restore_from_snapshot(&self) {
|
||||
self.is_startup_done.store(true, Ordering::Relaxed);
|
||||
}
|
||||
|
@ -14,15 +14,6 @@ pub trait AccountsUpdateNotifierInterface: std::fmt::Debug {
|
||||
|
||||
/// Notified when all accounts have been notified when restoring from a snapshot.
|
||||
fn notify_end_of_restore_from_snapshot(&self);
|
||||
|
||||
/// Notified when a slot is optimistically confirmed
|
||||
fn notify_slot_confirmed(&self, slot: Slot, parent: Option<Slot>);
|
||||
|
||||
/// Notified when a slot is marked frozen.
|
||||
fn notify_slot_processed(&self, slot: Slot, parent: Option<Slot>);
|
||||
|
||||
/// Notified when a slot is rooted.
|
||||
fn notify_slot_rooted(&self, slot: Slot, parent: Option<Slot>);
|
||||
}
|
||||
|
||||
pub type AccountsUpdateNotifier = Arc<RwLock<dyn AccountsUpdateNotifierInterface + Sync + Send>>;
|
||||
|
Reference in New Issue
Block a user