pub trait ExecutionCacheCommit: Send + Sync {
// Required methods
fn build_db_batch(
&self,
epoch: EpochId,
digests: &[TransactionDigest],
) -> Batch;
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 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.