pub trait ExecutionCacheCommit: Send + Sync {
// Required methods
fn build_db_batch(
&self,
epoch: EpochId,
digests: &[TransactionDigest],
) -> Batch;
fn set_highest_committed_checkpoint_in_batch(
&self,
batch: &mut Batch,
checkpoint: CheckpointSequenceNumber,
);
fn commit_transaction_outputs(
&self,
epoch: EpochId,
batch: Batch,
digests: &[TransactionDigest],
);
fn persist_transaction(&self, transaction: &VerifiedExecutableTransaction);
fn approximate_pending_transaction_count(&self) -> u64;
}Required Methods§
Sourcefn build_db_batch(&self, epoch: EpochId, digests: &[TransactionDigest]) -> Batch
fn build_db_batch(&self, epoch: EpochId, digests: &[TransactionDigest]) -> Batch
Build a DBBatch containing the given transaction outputs.
Sourcefn set_highest_committed_checkpoint_in_batch(
&self,
batch: &mut Batch,
checkpoint: CheckpointSequenceNumber,
)
fn set_highest_committed_checkpoint_in_batch( &self, batch: &mut Batch, checkpoint: CheckpointSequenceNumber, )
Stage the highest-committed-checkpoint watermark into batch so it is
written atomically with that checkpoint’s transaction outputs. Called by
CheckpointExecutor between Self::build_db_batch and
Self::commit_transaction_outputs. Unlike the checkpoint store’s
separately-bumped highest_executed watermark, this stays consistent
with the durable object set across an unclean stop.
Sourcefn commit_transaction_outputs(
&self,
epoch: EpochId,
batch: Batch,
digests: &[TransactionDigest],
)
fn commit_transaction_outputs( &self, epoch: EpochId, batch: Batch, digests: &[TransactionDigest], )
Durably commit the outputs of the given transactions to the database. Will be called by CheckpointExecutor to ensure that transaction outputs are written durably before marking a checkpoint as finalized.
Sourcefn persist_transaction(&self, transaction: &VerifiedExecutableTransaction)
fn persist_transaction(&self, transaction: &VerifiedExecutableTransaction)
Durably commit a transaction to the database. Used to store any transactions that cannot be reconstructed at start-up by consensus replay. Currently the only case of this is RandomnessStateUpdate.