L2 Integration
Integrate Fairseq into an L2 sequencer pipeline.
This guide walks through integrating Fairseq into a rollup sequencer so each batch is accompanied by a temporal ordering proof.
Architecture overview
At a high level:
- Collect transactions and timestamps at ingress.
- Order transactions deterministically for the batch.
- Generate a Fairseq proof for the ordered batch.
- Publish the batch plus proof hash for auditing.
Step-by-step integration
1. Capture ingress timestamps
RUST
struct IncomingTx {
hash: String,
received_at: u64, // nanoseconds since epoch
}Use a monotonic clock or a trusted time source to avoid reordering disputes.
2. Build the ordered batch
RUST
let ordered = order_transactions(inbound, OrderingRule::Fifo);3. Generate the proof
RUST
let proof = prover.prove(ordered).await?;
batch.proof_hash = Some(proof.proof_hash);
batch.proof_id = Some(proof.id);4. Publish and persist metadata
Store the proof ID and proof hash alongside your batch for downstream verification.
Best practices
- Use stable transaction IDs across retries.
- Persist raw ordering inputs for audits.
- Emit proofs before publishing batches to L1.
Common pitfalls
- Non-deterministic timestamps in distributed ingestion.
- Reordering transactions after proof generation.
- Dropping proof metadata in downstream systems.
Was this page helpful? /
Back to docs