Skip to main content

TransactionPool

Trait TransactionPool 

Source
pub trait TransactionPool:
    Send
    + Sync
    + 'static {
    // Required methods
    fn take(
        &self,
        max_count: usize,
        max_bytes: usize,
    ) -> (Vec<Transaction>, Box<dyn FnOnce(BlockRef) + Send>, LimitReached);
    fn notify_committed(
        &self,
        own_committed_blocks: Vec<BlockRef>,
        gc_round: Round,
    );
}
Expand description

TransactionPool supplies transactions for block proposals, as an alternative to submitting transactions through TransactionClient. Like TransactionVerifier, the implementation can be provided by Sui and passed into ConsensusAuthority::start().

Required Methods§

Source

fn take( &self, max_count: usize, max_bytes: usize, ) -> (Vec<Transaction>, Box<dyn FnOnce(BlockRef) + Send>, LimitReached)

Called by the proposer while building a block. Takes transactions to include, up to max_count transactions and max_bytes total serialized bytes. Returns the transactions in block order, an ack callback the proposer invokes with the created block’s reference after the block is durably created, and which limit stopped the take. Dropping the callback without invoking it means the transactions have not been included in a block, and the implementation may make them available to take again.

Source

fn notify_committed(&self, own_committed_blocks: Vec<BlockRef>, gc_round: Round)

Called from the commit path with this authority’s own committed block refs and the current GC round. Own blocks at rounds <= gc_round that are not committed are GC’ed and will never commit.

Implementors§