Overview
After consensus produces aCommittedBatch, every validator independently processes it through the same deterministic execution pipeline. No further communication is needed - identical inputs produce identical outputs across every validator.
Executor Pipeline
The executor processes each committed batch through the following stages:1. Receive TickProcess
The consensus output is packaged as aTickProcess containing:
- The committed transactions
- The round number (slot)
- The batch timestamp (used as the shuffle seed)
2. Shuffle and Queue Separation
TheSlotQueue receives the transactions and:
- Reseeds the Fisher-Yates shuffler with the batch timestamp
- Shuffles all transactions in the batch
- Separates transactions into priority queues:
- Config/data actions (oracle updates, settings changes)
- Liquidation orders (from the risk engine)
- Cancels (cancel-one and cancel-all)
- Post-only (ALO) maker orders
- Regular orders (market, limit GTC, IOC)
3. Execution Order
Actions are dequeued and executed in strict priority order:- Config and data updates
- Liquidations (if any accounts breached maintenance margin)
- Cancels
- Post-only maker orders
- Regular orders
4. Pre-Flight Margin Check
Before any order touches the book, the executor runs aprecheck_order validation:
- Verifies the account has sufficient available equity for the new position
- Checks leverage limits
- Validates order parameters (size, price, side)
- For reduce-only orders, verifies the order would actually reduce the position
rejectedRiskLimit, rejectedInvalid).
5. Book Matching
Orders that pass pre-flight are submitted to the matching engine, which operates as a standard central limit order book (CLOB) with price-time priority:- Aggressive orders (market, or limit orders that cross the spread) are matched immediately against resting liquidity at the best available prices
- Passive orders (limit orders that don’t cross) are placed on the book and wait for a counterparty
- Post-only orders that would cross the spread are rejected (
rejectedCrossing) instead of filling
cancelledRiskLimit).
6. State Updates
After each fill, the executor updates:- Position sizes and entry prices
- Account collateral and PnL
- Order status (working, filled, partially filled)
- Book state (remove filled levels, update partial fills)
Deterministic Execution
The entire pipeline - shuffle, queue separation, margin checks, book matching, state updates - is deterministic. Given the sameCommittedBatch, every validator produces:
- The same fills at the same prices
- The same order statuses
- The same position and margin state
- The same book state