Struct solana_runtime::bank::Bank[][src]

pub struct Bank {
Show fields pub rc: BankRc, pub src: StatusCacheRc, pub ancestors: Ancestors, pub ns_per_slot: u128, pub last_vote_sync: AtomicU64, pub rewards: RwLock<Vec<(Pubkey, RewardInfo)>>, pub skip_drop: AtomicBool, pub cluster_type: Option<ClusterType>, pub lazy_rent_collection: AtomicBool, pub no_stake_rewrite: AtomicBool, pub rewards_pool_pubkeys: Arc<HashSet<Pubkey>>, pub transaction_log_collector_config: Arc<RwLock<TransactionLogCollectorConfig>>, pub transaction_log_collector: Arc<RwLock<TransactionLogCollector>>, pub feature_set: Arc<FeatureSet>, pub drop_callback: RwLock<OptionalDropCallback>, pub freeze_started: AtomicBool, // some fields omitted
}
Expand description

Manager for the state of all accounts and programs after processing its entries. AbiExample is needed even without Serialize/Deserialize; actual (de-)serialization are implemented elsewhere for versioning

Fields

rc: BankRc

References to accounts, parent and signature status

src: StatusCacheRcancestors: Ancestors

The set of parents including this bank

ns_per_slot: u128

length of a slot in ns

last_vote_sync: AtomicU64

Last time when the cluster info vote listener has synced with this bank

rewards: RwLock<Vec<(Pubkey, RewardInfo)>>

Protocol-level rewards that were distributed by this bank

skip_drop: AtomicBoolcluster_type: Option<ClusterType>lazy_rent_collection: AtomicBoolno_stake_rewrite: AtomicBoolrewards_pool_pubkeys: Arc<HashSet<Pubkey>>transaction_log_collector_config: Arc<RwLock<TransactionLogCollectorConfig>>transaction_log_collector: Arc<RwLock<TransactionLogCollector>>feature_set: Arc<FeatureSet>drop_callback: RwLock<OptionalDropCallback>freeze_started: AtomicBool

Implementations

Create a new bank that points to an immutable checkpoint of another bank.

Like new_from_parent but additionally:

  • Doesn’t assume that the parent is anywhere near slot, parent could be millions of slots in the past
  • Adjusts the new bank’s tick height to avoid having to run PoH for millions of slots
  • Freezes the new bank, assuming that the user will Bank::new_from_parent from this bank

computed unix_timestamp at this slot height

Unused conversion

squash the parent’s state up into this Bank, this Bank becomes a root

Return the more recent checkpoint of this bank instance.

Return the last block hash registered.

Forget all signatures. Useful for benchmarking.

Tell the bank which Entry IDs exist on the ledger. This function assumes subsequent calls correspond to later entries, and will boot the oldest ones once its internal cache is full. Once boot, the bank will reject transactions using that hash.

Run transactions against a frozen bank without committing the results

Remove an executor from the bank’s cache

Process a batch of transactions.

Process a Transaction. This is used for unit tests and simply calls the vector Bank::process_transactions method

Create, sign, and process a Transaction from keypair to to of n lamports where blockhash is the last Entry ID observed by the client.

Each program would need to be able to introspect its own state this is hard-coded to the Budget language

Compute all the parents of the bank in order

Compute all the parents of the bank including this bank itself

pub fn transactions_per_entry_max(&self) -> u64[src]

Forcibly overwrites current capitalization by actually recalculating accounts’ balances. This should only be used for developing purposes.

A snapshot bank should be purged of 0 lamport accounts which are not part of the hash calculation and could shield other real accounts.

Return the number of hashes per tick

Return the number of ticks per slot

Return the number of slots per year

Return the number of ticks since genesis.

Return the inflation parameters of the Bank

Return the total capitalization of the Bank

Return this bank’s max_tick_height

Return the block_height of this bank

Return the number of slots per epoch for the given epoch

returns the epoch for which this bank’s leader_schedule_slot_offset and slot would need to cache leader_schedule

current stake delegations for this bank

current vote accounts for this bank along with the stake attributed to each account Note: This clones the entire vote-accounts hashmap. For a single account lookup use get_vote_account instead.

Vote account for the given vote account pubkey along with the stake.

Get the EpochStakes for a given epoch

vote accounts for the specific epoch along with the stake attributed to each account

Get the fixed authorized voter for the given vote account for the current epoch

Get the fixed set of vote accounts for the given node id for the current epoch

Get the fixed total stake of all vote accounts for current epoch

Get the fixed stake of the given vote account for the current epoch

given a slot, return the epoch and offset into the epoch this slot falls e.g. with a fixed number for slots_per_epoch, the calculation is simply:

( slot/slots_per_epoch, slot % slots_per_epoch )

Add an instruction processor to intercept instructions before the dynamic loader.

Replace a builtin instruction processor if it already exists

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.