sov_rollup_interface/node/services/
batch_builder.rs

1//! This module defines the trait that is used to build batches of transactions.
2
3/// BlockBuilder trait is responsible for managing mempool and building batches.
4pub trait BatchBuilder {
5    /// Accept a new transaction.
6    /// Can return error if transaction is invalid or mempool is full.
7    fn accept_tx(&mut self, tx: Vec<u8>) -> anyhow::Result<()>;
8
9    /// Builds a new batch out of transactions in mempool.
10    /// Logic of which transactions and how many of them is included in batch is up to implementation.
11    fn get_next_blob(&mut self) -> anyhow::Result<Vec<Vec<u8>>>;
12}