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<u64>>,
    // some fields omitted
}

Fields

new_shreds_signals: Vec<SyncSender<bool>>completed_slots_senders: Vec<SyncSender<Vec<Slot>>>lowest_cleanup_slot: Arc<RwLock<u64>>

Implementations

impl Blockstore[src]

pub fn purge_slots(&self, from_slot: Slot, to_slot: Slot, purge_type: PurgeType)[src]

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

pub fn purge_and_compact_slots(&self, from_slot: Slot, to_slot: Slot)[src]

pub fn purge_from_next_slots(&self, from_slot: Slot, to_slot: Slot)[src]

Ensures that the SlotMeta::next_slots vector for all slots contain no references in the [from_slot,to_slot] range

Dangerous; Use with care

pub fn compact_storage(&self, from_slot: Slot, to_slot: Slot) -> Result<bool>[src]

impl Blockstore[src]

pub fn db(self) -> Arc<Database>[src]

pub fn ledger_path(&self) -> &Path[src]

pub fn open(ledger_path: &Path) -> Result<Blockstore>[src]

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>
[src]

pub fn open_with_signal(
    ledger_path: &Path,
    recovery_mode: Option<BlockstoreRecoveryMode>,
    enforce_ulimit_nofile: bool
) -> Result<BlockstoreSignals>
[src]

pub fn add_tree(
    &self,
    forks: Tree<Slot>,
    is_orphan: bool,
    is_slot_complete: bool,
    num_ticks: u64,
    starting_hash: Hash
)
[src]

pub fn set_no_compaction(&mut self, no_compaction: bool)[src]

pub fn destroy(ledger_path: &Path) -> Result<()>[src]

pub fn meta(&self, slot: Slot) -> Result<Option<SlotMeta>>[src]

pub fn is_full(&self, slot: Slot) -> bool[src]

pub fn erasure_meta(
    &self,
    slot: Slot,
    set_index: u64
) -> Result<Option<ErasureMeta>>
[src]

pub fn orphan(&self, slot: Slot) -> Result<Option<bool>>[src]

pub fn max_root(&self) -> Slot[src]

pub fn slot_meta_iterator(
    &self,
    slot: Slot
) -> Result<impl Iterator<Item = (Slot, SlotMeta)> + '_>
[src]

pub fn live_slots_iterator(
    &self,
    root: Slot
) -> impl Iterator<Item = (Slot, SlotMeta)> + '_
[src]

pub fn slot_data_iterator(
    &self,
    slot: Slot,
    index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
[src]

pub fn slot_coding_iterator(
    &self,
    slot: Slot,
    index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
[src]

pub fn rooted_slot_iterator(
    &self,
    slot: Slot
) -> Result<impl Iterator<Item = u64> + '_>
[src]

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), 
[src]

pub fn clear_unconfirmed_slot(&self, slot: Slot)[src]

pub fn insert_shreds(
    &self,
    shreds: Vec<Shred>,
    leader_schedule: Option<&Arc<LeaderScheduleCache>>,
    is_trusted: bool
) -> Result<(Vec<CompletedDataSetInfo>, Vec<usize>)>
[src]

pub fn get_data_shred(&self, slot: Slot, index: u64) -> Result<Option<Vec<u8>>>[src]

pub fn get_data_shreds_for_slot(
    &self,
    slot: Slot,
    start_index: u64
) -> ShredResult<Vec<Shred>>
[src]

pub fn get_data_shreds(
    &self,
    slot: Slot,
    from_index: u64,
    to_index: u64,
    buffer: &mut [u8]
) -> Result<(u64, usize)>
[src]

pub fn get_coding_shred(
    &self,
    slot: Slot,
    index: u64
) -> Result<Option<Vec<u8>>>
[src]

pub fn get_coding_shreds_for_slot(
    &self,
    slot: Slot,
    start_index: u64
) -> ShredResult<Vec<Shred>>
[src]

pub fn write_entries(
    &self,
    start_slot: Slot,
    num_ticks_in_start_slot: u64,
    start_index: u32,
    ticks_per_slot: u64,
    parent: Option<u64>,
    is_full_slot: bool,
    keypair: &Arc<Keypair>,
    entries: Vec<Entry>,
    version: u16
) -> Result<usize>
[src]

pub fn get_index(&self, slot: Slot) -> Result<Option<Index>>[src]

pub fn put_meta_bytes(&self, slot: Slot, bytes: &[u8]) -> Result<()>[src]

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>
[src]

pub fn get_block_time(&self, slot: Slot) -> Result<Option<UnixTimestamp>>[src]

pub fn cache_block_time(
    &self,
    slot: Slot,
    timestamp: UnixTimestamp
) -> Result<()>
[src]

pub fn get_first_available_block(&self) -> Result<Slot>[src]

pub fn evm_blocks_iterator(
    &self,
    block_num: BlockNum
) -> Result<impl Iterator<Item = ((BlockNum, Option<Slot>), BlockHeader)> + '_>
[src]

Return iterator over evm blocks. There can be more than one block with same block number and different slot numbers.

pub fn get_first_available_evm_block(&self) -> Result<BlockNum>[src]

pub fn get_last_available_evm_block(&self) -> Result<Option<BlockNum>>[src]

pub fn get_confirmed_block_hash(&self, slot: Slot) -> Result<String>[src]

pub fn get_confirmed_block(
    &self,
    slot: Slot,
    require_previous_blockhash: bool
) -> Result<ConfirmedBlock>
[src]

pub fn get_evm_block(&self, block_number: BlockNum) -> Result<(Block, bool)>[src]

Returns block, and flag if that block was rooted (confirmed)

pub fn read_transaction_status(
    &self,
    index: (Signature, Slot)
) -> Result<Option<TransactionStatusMeta>>
[src]

pub fn write_transaction_status(
    &self,
    slot: Slot,
    signature: Signature,
    writable_keys: Vec<&Pubkey>,
    readonly_keys: Vec<&Pubkey>,
    status: TransactionStatusMeta
) -> Result<()>
[src]

pub fn get_transaction_status(
    &self,
    signature: Signature
) -> Result<Option<(Slot, TransactionStatusMeta)>>
[src]

Returns a transaction status if it was processed in a root

pub fn get_confirmed_transaction(
    &self,
    signature: Signature
) -> Result<Option<ConfirmedTransaction>>
[src]

Returns a complete transaction if it was processed in a root

pub fn get_confirmed_signatures_for_address(
    &self,
    pubkey: Pubkey,
    start_slot: Slot,
    end_slot: Slot
) -> Result<Vec<Signature>>
[src]

pub fn get_confirmed_signatures_for_address2(
    &self,
    address: Pubkey,
    highest_confirmed_root: Slot,
    before: Option<Signature>,
    until: Option<Signature>,
    limit: usize
) -> Result<Vec<ConfirmedTransactionStatusWithSignature>>
[src]

pub fn read_rewards(&self, index: Slot) -> Result<Option<Rewards>>[src]

pub fn write_rewards(&self, index: Slot, rewards: Rewards) -> Result<()>[src]

pub fn get_recent_perf_samples(
    &self,
    num: usize
) -> Result<Vec<(Slot, PerfSample)>>
[src]

pub fn write_perf_sample(
    &self,
    index: Slot,
    perf_sample: &PerfSample
) -> Result<()>
[src]

pub fn write_evm_block_header(&self, block: &BlockHeader) -> Result<()>[src]

pub fn read_evm_block_headers(
    &self,
    block_index: BlockNum
) -> Result<Vec<BlockHeader>>
[src]

Returns iterator over evm blocks. If more than one evm block have been found on same block_num, this function return multiple items.

pub fn write_evm_block_id_by_hash(
    &self,
    slot: Slot,
    hash: H256,
    id: BlockNum
) -> Result<()>
[src]

pub fn read_evm_block_id_by_hash(&self, hash: H256) -> Result<Option<BlockNum>>[src]

pub fn read_evm_transaction(
    &self,
    index: (H256, BlockNum, Option<Slot>)
) -> Result<Option<TransactionReceipt>>
[src]

Try to search for evm transaction in next indexes:

  1. When primary index = 0 and slot is Some,
  2. When primary index = 1 and slot is Some,
  3. When primary index = 0 and slot is None,
  4. When primary index = 1 and slot is None

pub fn filter_logs(&self, filter: LogFilter) -> Result<Vec<LogWithLocation>>[src]

pub fn find_evm_transaction(
    &self,
    hash: H256
) -> Result<Option<TransactionReceipt>>
[src]

pub fn write_evm_transaction(
    &self,
    block_num: BlockNum,
    slot_index: Slot,
    hash: H256,
    status: TransactionReceipt
) -> Result<()>
[src]

pub fn get_slot_entries(
    &self,
    slot: Slot,
    shred_start_index: u64
) -> Result<Vec<Entry>>
[src]

Returns the entry vector for the slot starting with shred_start_index

pub fn get_slot_entries_with_shred_info(
    &self,
    slot: Slot,
    start_index: u64,
    allow_dead_slots: bool
) -> Result<(Vec<Entry>, u64, bool)>
[src]

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>>
[src]

pub fn get_slots_since(&self, slots: &[u64]) -> Result<HashMap<u64, Vec<u64>>>[src]

pub fn is_root(&self, slot: Slot) -> bool[src]

pub fn is_skipped(&self, slot: Slot) -> bool[src]

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 set_roots(&self, rooted_slots: &[u64]) -> Result<()>[src]

pub fn is_dead(&self, slot: Slot) -> bool[src]

pub fn set_dead_slot(&self, slot: Slot) -> Result<()>[src]

pub fn store_duplicate_if_not_existing(
    &self,
    slot: Slot,
    shred1: Vec<u8>,
    shred2: Vec<u8>
) -> Result<()>
[src]

pub fn store_duplicate_slot(
    &self,
    slot: Slot,
    shred1: Vec<u8>,
    shred2: Vec<u8>
) -> Result<()>
[src]

pub fn get_duplicate_slot(&self, slot: u64) -> Option<DuplicateSlotProof>[src]

pub fn is_shred_duplicate(
    &self,
    slot: u64,
    index: u32,
    new_shred: &[u8],
    is_data: bool
) -> Option<Vec<u8>>
[src]

pub fn has_duplicate_shreds_in_slot(&self, slot: Slot) -> bool[src]

pub fn orphans_iterator(
    &self,
    slot: Slot
) -> Result<impl Iterator<Item = u64> + '_>
[src]

pub fn dead_slots_iterator(
    &self,
    slot: Slot
) -> Result<impl Iterator<Item = Slot> + '_>
[src]

pub fn last_root(&self) -> Slot[src]

pub fn lowest_slot(&self) -> Slot[src]

pub fn storage_size(&self) -> Result<u64>[src]

pub fn is_primary_access(&self) -> bool[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]