Struct solana_ledger::blockstore::Blockstore [−][src]
pub struct Blockstore {
pub new_shreds_signals: Vec<SyncSender<bool>>,
pub completed_slots_senders: Vec<SyncSender<Vec<Slot>>>,
pub lowest_cleanup_slot: Arc<RwLock<Slot>>,
// some fields omitted
}
Fields
new_shreds_signals: Vec<SyncSender<bool>>
completed_slots_senders: Vec<SyncSender<Vec<Slot>>>
lowest_cleanup_slot: Arc<RwLock<Slot>>
Implementations
Silently deletes all blockstore column families in the range [from_slot,to_slot] Dangerous; Use with care: Does not check for integrity and does not update slot metas that refer to deleted slots Modifies multiple column families simultaneously
Usually this is paired with .purge_slots() but we can’t internally call this in that function unconditionally. That’s because set_max_expired_slot() expects to purge older slots by the successive chronological order, while .purge_slots() can also be used to purge future slots for –hard-fork thing, preserving older slots. It’d be quite dangerous to purge older slots in that case. So, current legal user of this function is LedgerCleanupService.
Ensures that the SlotMeta::next_slots vector for all slots contain no references in the [from_slot,to_slot] range
Dangerous; Use with care
Opens a Ledger in directory, provides “infinite” window of shreds
pub fn open_with_access_type(
ledger_path: &Path,
access_type: AccessType,
recovery_mode: Option<BlockstoreRecoveryMode>,
enforce_ulimit_nofile: bool
) -> Result<Blockstore>
pub fn open_with_signal(
ledger_path: &Path,
recovery_mode: Option<BlockstoreRecoveryMode>,
enforce_ulimit_nofile: bool
) -> Result<BlockstoreSignals>
pub fn add_tree(
&self,
forks: Tree<Slot>,
is_orphan: bool,
is_slot_complete: bool,
num_ticks: u64,
starting_hash: Hash
)
pub fn slot_meta_iterator(
&self,
slot: Slot
) -> Result<impl Iterator<Item = (Slot, SlotMeta)> + '_>
pub fn slot_data_iterator(
&self,
slot: Slot,
index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
pub fn slot_coding_iterator(
&self,
slot: Slot,
index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
pub fn insert_shreds_handle_duplicate<F>(
&self,
shreds: Vec<Shred>,
leader_schedule: Option<&Arc<LeaderScheduleCache>>,
is_trusted: bool,
handle_duplicate: &F,
metrics: &mut BlockstoreInsertionMetrics
) -> Result<(Vec<CompletedDataSetInfo>, Vec<usize>)> where
F: Fn(Shred),
pub fn insert_shreds(
&self,
shreds: Vec<Shred>,
leader_schedule: Option<&Arc<LeaderScheduleCache>>,
is_trusted: bool
) -> Result<(Vec<CompletedDataSetInfo>, Vec<usize>)>
pub fn get_data_shreds_for_slot(
&self,
slot: Slot,
start_index: u64
) -> ShredResult<Vec<Shred>>
pub fn get_data_shreds(
&self,
slot: Slot,
from_index: u64,
to_index: u64,
buffer: &mut [u8]
) -> Result<(u64, usize)>
pub fn get_coding_shreds_for_slot(
&self,
slot: Slot,
start_index: u64
) -> ShredResult<Vec<Shred>>
Manually update the meta for a slot. Can interfere with automatic meta update and potentially break chaining. Dangerous. Use with care.
pub fn find_missing_data_indexes(
&self,
slot: Slot,
first_timestamp: u64,
start_index: u64,
end_index: u64,
max_missing: usize
) -> Vec<u64>
pub fn get_rooted_block(
&self,
slot: Slot,
require_previous_blockhash: bool
) -> Result<ConfirmedBlock>
pub fn get_complete_block(
&self,
slot: Slot,
require_previous_blockhash: bool
) -> Result<ConfirmedBlock>
pub fn read_transaction_status(
&self,
index: (Signature, Slot)
) -> Result<Option<TransactionStatusMeta>>
pub fn write_transaction_status(
&self,
slot: Slot,
signature: Signature,
writable_keys: Vec<&Pubkey>,
readonly_keys: Vec<&Pubkey>,
status: TransactionStatusMeta
) -> Result<()>
pub fn get_rooted_transaction_status(
&self,
signature: Signature
) -> Result<Option<(Slot, TransactionStatusMeta)>>
pub fn get_rooted_transaction_status(
&self,
signature: Signature
) -> Result<Option<(Slot, TransactionStatusMeta)>>
Returns a transaction status
pub fn get_transaction_status(
&self,
signature: Signature,
confirmed_unrooted_slots: &[Slot]
) -> Result<Option<(Slot, TransactionStatusMeta)>>
pub fn get_transaction_status(
&self,
signature: Signature,
confirmed_unrooted_slots: &[Slot]
) -> Result<Option<(Slot, TransactionStatusMeta)>>
Returns a transaction status
pub fn get_rooted_transaction(
&self,
signature: Signature
) -> Result<Option<ConfirmedTransaction>>
pub fn get_rooted_transaction(
&self,
signature: Signature
) -> Result<Option<ConfirmedTransaction>>
Returns a complete transaction if it was processed in a root
pub fn get_complete_transaction(
&self,
signature: Signature,
highest_confirmed_slot: Slot
) -> Result<Option<ConfirmedTransaction>>
pub fn get_complete_transaction(
&self,
signature: Signature,
highest_confirmed_slot: Slot
) -> Result<Option<ConfirmedTransaction>>
Returns a complete transaction
pub fn get_confirmed_signatures_for_address(
&self,
pubkey: Pubkey,
start_slot: Slot,
end_slot: Slot
) -> Result<Vec<Signature>>
pub fn get_confirmed_signatures_for_address2(
&self,
address: Pubkey,
highest_slot: Slot,
before: Option<Signature>,
until: Option<Signature>,
limit: usize
) -> Result<Vec<ConfirmedTransactionStatusWithSignature>>
Returns the entry vector for the slot starting with shred_start_index
Returns the entry vector for the slot starting with shred_start_index
, the number of
shreds that comprise the entry vector, and whether the slot is full (consumed all shreds).
pub fn get_entries_in_data_block(
&self,
slot: Slot,
start_index: u32,
end_index: u32,
slot_meta: Option<&SlotMeta>
) -> Result<Vec<Entry>>
Returns true if a slot is between the rooted slot bounds of the ledger, but has not itself been rooted. This is either because the slot was skipped, or due to a gap in ledger data, as when booting from a newer snapshot.
pub fn store_duplicate_if_not_existing(
&self,
slot: Slot,
shred1: Vec<u8>,
shred2: Vec<u8>
) -> Result<()>
Auto Trait Implementations
impl RefUnwindSafe for Blockstore
impl Send for Blockstore
impl Sync for Blockstore
impl Unpin for Blockstore
impl UnwindSafe for Blockstore
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Wrap the input message T
in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more