Struct solana_ledger::blockstore::Blockstore [−][src]
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]
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>
[src]
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
)
[src]
&self,
forks: Tree<Slot>,
is_orphan: bool,
is_slot_complete: bool,
num_ticks: u64,
starting_hash: Hash
)
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]
&self,
slot: Slot,
set_index: u64
) -> Result<Option<ErasureMeta>>
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]
&self,
slot: Slot
) -> Result<impl Iterator<Item = (Slot, SlotMeta)> + '_>
pub fn live_slots_iterator(
&self,
root: Slot
) -> impl Iterator<Item = (Slot, SlotMeta)> + '_
[src]
&self,
root: Slot
) -> impl Iterator<Item = (Slot, SlotMeta)> + '_
pub fn slot_data_iterator(
&self,
slot: Slot,
index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
[src]
&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]>)> + '_>
[src]
&self,
slot: Slot,
index: u64
) -> Result<impl Iterator<Item = ((u64, u64), Box<[u8]>)> + '_>
pub fn rooted_slot_iterator(
&self,
slot: Slot
) -> Result<impl Iterator<Item = u64> + '_>
[src]
&self,
slot: Slot
) -> Result<impl Iterator<Item = u64> + '_>
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]
&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 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]
&self,
shreds: Vec<Shred>,
leader_schedule: Option<&Arc<LeaderScheduleCache>>,
is_trusted: bool
) -> Result<(Vec<CompletedDataSetInfo>, Vec<usize>)>
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]
&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)>
[src]
&self,
slot: Slot,
from_index: u64,
to_index: u64,
buffer: &mut [u8]
) -> Result<(u64, usize)>
pub fn get_coding_shred(
&self,
slot: Slot,
index: u64
) -> Result<Option<Vec<u8>>>
[src]
&self,
slot: Slot,
index: u64
) -> Result<Option<Vec<u8>>>
pub fn get_coding_shreds_for_slot(
&self,
slot: Slot,
start_index: u64
) -> ShredResult<Vec<Shred>>
[src]
&self,
slot: Slot,
start_index: u64
) -> ShredResult<Vec<Shred>>
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]
&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>
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]
&self,
slot: Slot,
first_timestamp: u64,
start_index: u64,
end_index: u64,
max_missing: usize
) -> Vec<u64>
pub fn get_block_time(&self, slot: Slot) -> Result<Option<UnixTimestamp>>
[src]
pub fn cache_block_time(
&self,
slot: Slot,
timestamp: UnixTimestamp
) -> Result<()>
[src]
&self,
slot: Slot,
timestamp: UnixTimestamp
) -> Result<()>
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]
&self,
block_num: BlockNum
) -> Result<impl Iterator<Item = ((BlockNum, Option<Slot>), BlockHeader)> + '_>
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]
&self,
slot: Slot,
require_previous_blockhash: bool
) -> Result<ConfirmedBlock>
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]
&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<()>
[src]
&self,
slot: Slot,
signature: Signature,
writable_keys: Vec<&Pubkey>,
readonly_keys: Vec<&Pubkey>,
status: TransactionStatusMeta
) -> Result<()>
pub fn get_transaction_status(
&self,
signature: Signature
) -> Result<Option<(Slot, TransactionStatusMeta)>>
[src]
&self,
signature: Signature
) -> Result<Option<(Slot, TransactionStatusMeta)>>
Returns a transaction status if it was processed in a root
pub fn get_confirmed_transaction(
&self,
signature: Signature
) -> Result<Option<ConfirmedTransaction>>
[src]
&self,
signature: Signature
) -> Result<Option<ConfirmedTransaction>>
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]
&self,
pubkey: Pubkey,
start_slot: Slot,
end_slot: Slot
) -> Result<Vec<Signature>>
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]
&self,
address: Pubkey,
highest_confirmed_root: Slot,
before: Option<Signature>,
until: Option<Signature>,
limit: usize
) -> Result<Vec<ConfirmedTransactionStatusWithSignature>>
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]
&self,
num: usize
) -> Result<Vec<(Slot, PerfSample)>>
pub fn write_perf_sample(
&self,
index: Slot,
perf_sample: &PerfSample
) -> Result<()>
[src]
&self,
index: Slot,
perf_sample: &PerfSample
) -> Result<()>
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]
&self,
block_index: BlockNum
) -> Result<Vec<BlockHeader>>
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]
&self,
slot: Slot,
hash: H256,
id: BlockNum
) -> Result<()>
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]
&self,
index: (H256, BlockNum, Option<Slot>)
) -> Result<Option<TransactionReceipt>>
Try to search for evm transaction in next indexes:
- When primary index = 0 and slot is Some,
- When primary index = 1 and slot is Some,
- When primary index = 0 and slot is None,
- 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]
&self,
hash: H256
) -> Result<Option<TransactionReceipt>>
pub fn write_evm_transaction(
&self,
block_num: BlockNum,
slot_index: Slot,
hash: H256,
status: TransactionReceipt
) -> Result<()>
[src]
&self,
block_num: BlockNum,
slot_index: Slot,
hash: H256,
status: TransactionReceipt
) -> Result<()>
pub fn get_slot_entries(
&self,
slot: Slot,
shred_start_index: u64
) -> Result<Vec<Entry>>
[src]
&self,
slot: Slot,
shred_start_index: u64
) -> Result<Vec<Entry>>
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]
&self,
slot: Slot,
start_index: u64,
allow_dead_slots: bool
) -> Result<(Vec<Entry>, u64, bool)>
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]
&self,
slot: Slot,
start_index: u32,
end_index: u32,
slot_meta: Option<&SlotMeta>
) -> Result<Vec<Entry>>
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]
&self,
slot: Slot,
shred1: Vec<u8>,
shred2: Vec<u8>
) -> Result<()>
pub fn store_duplicate_slot(
&self,
slot: Slot,
shred1: Vec<u8>,
shred2: Vec<u8>
) -> Result<()>
[src]
&self,
slot: Slot,
shred1: Vec<u8>,
shred2: Vec<u8>
) -> Result<()>
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]
&self,
slot: u64,
index: u32,
new_shred: &[u8],
is_data: bool
) -> Option<Vec<u8>>
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]
&self,
slot: Slot
) -> Result<impl Iterator<Item = u64> + '_>
pub fn dead_slots_iterator(
&self,
slot: Slot
) -> Result<impl Iterator<Item = Slot> + '_>
[src]
&self,
slot: Slot
) -> Result<impl Iterator<Item = Slot> + '_>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,