pub struct BankForks {
pub snapshot_config: Option<SnapshotConfig>,
pub accounts_hash_interval_slots: Slot,
/* private fields */
}
Fields§
§snapshot_config: Option<SnapshotConfig>
§accounts_hash_interval_slots: Slot
Implementations§
Source§impl BankForks
impl BankForks
pub fn new_rw_arc(root_bank: Bank) -> Arc<RwLock<Self>>
pub fn banks(&self) -> &HashMap<Slot, BankWithScheduler>
pub fn get_vote_only_mode_signal(&self) -> Arc<AtomicBool>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn ancestors(&self) -> HashMap<Slot, HashSet<Slot>>
pub fn ancestors(&self) -> HashMap<Slot, HashSet<Slot>>
Create a map of bank slot id to the set of ancestors for the bank slot.
Sourcepub fn descendants(&self) -> HashMap<Slot, HashSet<Slot>>
pub fn descendants(&self) -> HashMap<Slot, HashSet<Slot>>
Create a map of bank slot id to the set of all of its descendants
pub fn frozen_banks(&self) -> HashMap<Slot, Arc<Bank>>
pub fn active_bank_slots(&self) -> Vec<Slot>
pub fn get_with_scheduler(&self, bank_slot: Slot) -> Option<BankWithScheduler>
pub fn get(&self, bank_slot: Slot) -> Option<Arc<Bank>>
pub fn get_with_checked_hash( &self, (bank_slot, expected_hash): (Slot, Hash), ) -> Option<Arc<Bank>>
pub fn bank_hash(&self, slot: Slot) -> Option<Hash>
pub fn root_bank(&self) -> Arc<Bank>
pub fn install_scheduler_pool(&mut self, pool: InstalledSchedulerPoolArc)
pub fn insert(&mut self, bank: Bank) -> BankWithScheduler
pub fn insert_from_ledger(&mut self, bank: Bank) -> BankWithScheduler
pub fn remove(&mut self, slot: Slot) -> Option<BankWithScheduler>
pub fn highest_slot(&self) -> Slot
pub fn working_bank(&self) -> Arc<Bank>
pub fn working_bank_with_scheduler(&self) -> &BankWithScheduler
Sourcepub fn register_dumped_slot_subscriber(
&mut self,
notifier: DumpedSlotSubscription,
)
pub fn register_dumped_slot_subscriber( &mut self, notifier: DumpedSlotSubscription, )
Register to be notified when a bank has been dumped (due to duplicate block handling) from bank_forks.
Sourcepub fn dump_slots<'a, I>(
&mut self,
slots: I,
) -> (Vec<(Slot, BankId)>, Vec<BankWithScheduler>)
pub fn dump_slots<'a, I>( &mut self, slots: I, ) -> (Vec<(Slot, BankId)>, Vec<BankWithScheduler>)
Clears associated banks from BankForks and notifies subscribers that a dump has occured.
Sourcepub fn send_eah_request_if_needed(
&mut self,
root: Slot,
banks: &[&Arc<Bank>],
accounts_background_request_sender: &AbsRequestSender,
) -> Result<(bool, SquashTiming), SetRootError>
pub fn send_eah_request_if_needed( &mut self, root: Slot, banks: &[&Arc<Bank>], accounts_background_request_sender: &AbsRequestSender, ) -> Result<(bool, SquashTiming), SetRootError>
Sends an EpochAccountsHash request if one of the banks
crosses the EAH boundary.
Returns if the bank at slot root
was squashed, and its timings.
Panics if more than one bank in banks
should send an EAH request.
pub fn prune_program_cache(&self, root: Slot)
pub fn set_root( &mut self, root: Slot, accounts_background_request_sender: &AbsRequestSender, highest_super_majority_root: Option<Slot>, ) -> Result<Vec<BankWithScheduler>, SetRootError>
pub fn root(&self) -> Slot
Sourcepub fn get_atomic_root(&self) -> ReadOnlyAtomicSlot
pub fn get_atomic_root(&self) -> ReadOnlyAtomicSlot
Gets a read-only wrapper to an atomic slot holding the root slot.
pub fn set_snapshot_config(&mut self, snapshot_config: Option<SnapshotConfig>)
pub fn set_accounts_hash_interval_slots(&mut self, accounts_interval_slots: u64)
Trait Implementations§
Source§impl ForkGraph for BankForks
impl ForkGraph for BankForks
Source§fn relationship(&self, a: Slot, b: Slot) -> BlockRelation
fn relationship(&self, a: Slot, b: Slot) -> BlockRelation
Returns the BlockRelation of A to B
Auto Trait Implementations§
impl Freeze for BankForks
impl !RefUnwindSafe for BankForks
impl Send for BankForks
impl Sync for BankForks
impl Unpin for BankForks
impl !UnwindSafe for BankForks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more