Committer Thread
An async batch committer that decouples DA publishing from the matching engine hot path.
Architecture
The committer is a separate async task (Tokio task) that communicates with the matching engine via a bounded channel. The engine sends CommitBatch messages; the committer receives them and performs the slow work of MPT root computation and DA publishing.
This decoupling is critical. DA publishing — especially to a remote backend like Celestia — can take tens or hundreds of milliseconds. If the engine had to wait for DA confirmation before processing the next request, match latency would be dominated by network round trips. The channel allows the engine to continue at memory-bandwidth speeds while the committer works in parallel.
CommitBatch Message
struct CommitBatch {
batch_id: u64,
deltas: Vec<(StateKey, StateValue)>,
fills: Vec<Fill>,
timestamp: u64,
}Batch Accumulation
The committer does not necessarily publish one DA blob per engine batch. Under high load, it may accumulate multiple engine batches into a single DA submission. This reduces DA costs and improves throughput at the cost of slightly higher latency to the published state root. The accumulation window is configurable.
DA Backend Selection
The committer supports multiple DA backends, selected by configuration:
| Backend | Description | Status |
|---|---|---|
| Local file | Appends batches to a local log file | Default in dev |
| Celestia | Publishes to the Celestia DA network | Supported |
| Ethereum calldata | Embeds batch data in Ethereum transactions | Roadmap |
Fault Handling
If the DA backend is unavailable, the committer retries with exponential backoff. The matching engine is not informed of DA failures — it continues matching. The batch is buffered in the committer's internal queue until publication succeeds. A configurable maximum queue depth prevents unbounded memory growth; if the queue is full, the committer blocks and the engine's channel send will block, applying back-pressure to order processing.