pub trait DurableBlockReader: StageCheckpointReader + BlockHashReader {
// Provided method
fn last_durable_block_num_hash(&self) -> Result<NumHash, ProviderError> { ... }
}Expand description
Reads the last block that survives a restart.
Provided Methods§
Sourcefn last_durable_block_num_hash(&self) -> Result<NumHash, ProviderError>
fn last_durable_block_num_hash(&self) -> Result<NumHash, ProviderError>
Returns the number and hash of the last block that is still canonical in the database after a restart.
This can be behind
BlockNumReader::last_block_number: static
files are written before the database transaction that commits the same blocks, and blocks
above the partial state/trie frontier of the Finish stage checkpoint are unwound on
startup. Returns genesis if there is no Finish checkpoint.
The hash is the database’s block at that height, never an in-memory canonical block, so it identifies the block a restart keeps even while an in-memory reorg below it is not yet persisted. Providers that serve in-memory blocks override this to read the database.
The block only survives a host crash or power loss when the database syncs every commit to
disk. With --db.sync-mode safe-no-sync, it survives a process crash, but MDBX may
discard the latest commits when the database is reopened after a host failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".