solo

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Solo Sequencer

A minimal single-leader sequencer without forced inclusion support. It accepts mempool transactions via an in-memory queue and produces batches on demand.

Overview

The solo sequencer is the simplest sequencer implementation. It has no DA-layer interaction for transaction ordering and no crash-recovery persistence. Transactions are held in memory and lost on restart.

Use it when you need a single node that orders transactions without the overhead of forced inclusion checkpoints or DA-based sequencing.

flowchart LR
    Client["Client"] -->|SubmitBatchTxs| Sequencer["SoloSequencer"]
    Sequencer -->|GetNextBatch| BlockManager["Block Manager"]

Design Decisions

Decision Rationale
In-memory queue No persistence overhead; suitable for trusted single-operator setups
No forced inclusion Avoids DA epoch tracking, checkpoint storage, and catch-up logic
No DA client dependency VerifyBatch returns true unconditionally

Flow

SubmitBatchTxs
flowchart TD
    A["SubmitBatchTxs()"] --> B{"Valid ID?"}
    B -->|No| C["Return ErrInvalidID"]
    B -->|Yes| D{"Empty batch?"}
    D -->|Yes| E["Return OK"]
    D -->|No| H["Append txs to queue"]
    H --> E
GetNextBatch
flowchart TD
    A["GetNextBatch()"] --> B{"Valid ID?"}
    B -->|No| C["Return ErrInvalidID"]
    B -->|Yes| D["Drain queue"]
    D --> E{"Queue was empty?"}
    E -->|Yes| F["Return empty batch"]
    E -->|No| G["FilterTxs via executor"]
    G --> H["Re-queue postponed txs"]
    H --> I["Return valid txs"]

Comparison with Other Sequencers

Aspect Solo Single Based
Mempool transactions Yes Yes No
Forced inclusion No Yes Yes
Persistence None DB-backed queue + checkpoints Checkpoints only
Crash recovery Lost on restart Full recovery Checkpoint-based
Catch-up mode N/A Yes N/A
DA client required No Yes Yes

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidID = errors.New("invalid chain id")

Functions

This section is empty.

Types

type SoloSequencer

type SoloSequencer struct {
	// contains filtered or unexported fields
}

SoloSequencer is a single-leader sequencer without forced inclusion support. It maintains a simple in-memory queue of mempool transactions and produces batches on demand.

func NewSoloSequencer

func NewSoloSequencer(
	logger zerolog.Logger,
	id []byte,
	executor execution.Executor,
) *SoloSequencer

func (*SoloSequencer) GetDAHeight

func (s *SoloSequencer) GetDAHeight() uint64

func (*SoloSequencer) SetDAHeight

func (s *SoloSequencer) SetDAHeight(height uint64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL