pub struct ConsensusWal { /* private fields */ }Expand description
Write-Ahead Log for consensus commit operations.
Provides crash recovery by recording commit intent before executing blocks
and commit-done after persisting state. On restart, if a CommitIntent
without a matching CommitDone is found, the node knows a mid-commit
crash occurred and can re-execute from the block store.
Implementations§
Source§impl ConsensusWal
impl ConsensusWal
Sourcepub fn open(data_dir: &Path) -> Result<Self>
pub fn open(data_dir: &Path) -> Result<Self>
Open or create the WAL file in the given data directory.
Sourcepub fn check_recovery(data_dir: &Path) -> Result<WalRecovery>
pub fn check_recovery(data_dir: &Path) -> Result<WalRecovery>
Check the WAL for incomplete commits (called on startup).
Sourcepub fn log_commit_intent(&mut self, target_height: Height) -> Result<()>
pub fn log_commit_intent(&mut self, target_height: Height) -> Result<()>
Record that a commit batch is about to start.
Sourcepub fn log_commit_done(&mut self, target_height: Height) -> Result<()>
pub fn log_commit_done(&mut self, target_height: Height) -> Result<()>
Record that a commit batch completed successfully.
Trait Implementations§
Source§impl Wal for ConsensusWal
The WAL struct implements hotmint_consensus::Wal.
impl Wal for ConsensusWal
The WAL struct implements hotmint_consensus::Wal.
Auto Trait Implementations§
impl Freeze for ConsensusWal
impl RefUnwindSafe for ConsensusWal
impl Send for ConsensusWal
impl Sync for ConsensusWal
impl Unpin for ConsensusWal
impl UnsafeUnpin for ConsensusWal
impl UnwindSafe for ConsensusWal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more