sequencer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 6 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Transactions [][]byte
}

Batch is a collection of transactions

func (*Batch) Hash

func (batch *Batch) Hash() ([]byte, error)

Hash returns the cryptographic hash of the batch

type DummySequencer

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

DummySequencer is a dummy implementation of the Sequencer interface for testing

func NewDummySequencer

func NewDummySequencer() *DummySequencer

NewDummySequencer creates a new dummy Sequencer instance

func (*DummySequencer) GetDAHeight

func (s *DummySequencer) GetDAHeight() uint64

GetDAHeight returns the current DA height for the sequencer

func (*DummySequencer) GetNextBatch

GetNextBatch gets the next batch from the sequencer

func (*DummySequencer) SetDAHeight

func (s *DummySequencer) SetDAHeight(height uint64)

SetDAHeight sets the current DA height for the sequencer

func (*DummySequencer) SubmitBatchTxs

SubmitBatchTxs submits a batch of transactions to the sequencer

func (*DummySequencer) VerifyBatch

VerifyBatch verifies a batch of transactions received from the sequencer

type GetNextBatchRequest

type GetNextBatchRequest struct {
	Id            []byte
	LastBatchData [][]byte
	MaxBytes      uint64
}

GetNextBatchRequest is a request to get the next batch of transactions from sequencer to chain

type GetNextBatchResponse

type GetNextBatchResponse struct {
	Batch     *Batch
	Timestamp time.Time
	BatchData [][]byte
}

GetNextBatchResponse is a response to getting the next batch of transactions from sequencer to chain

type Sequencer

type Sequencer interface {
	// SubmitBatchTxs submits a batch of transactions from executor to sequencer
	// Id is the unique identifier for the target chain
	// Batch is the batch of transactions to submit
	// returns an error if any from the sequencer
	SubmitBatchTxs(ctx context.Context, req SubmitBatchTxsRequest) (*SubmitBatchTxsResponse, error)

	// GetNextBatch returns the next batch of transactions from sequencer and from DA to
	// Id is the unique identifier for the target chain
	// LastBatchHash is the cryptographic hash of the last batch received by the
	// MaxBytes is the maximum number of bytes to return in the batch
	// returns the next batch of transactions and an error if any from the sequencer
	GetNextBatch(ctx context.Context, req GetNextBatchRequest) (*GetNextBatchResponse, error)

	// VerifyBatch verifies a batch of transactions received from the sequencer
	// Id is the unique identifier for the target chain
	// BatchHash is the cryptographic hash of the batch to verify
	// returns a boolean indicating if the batch is valid and an error if any from the sequencer
	VerifyBatch(ctx context.Context, req VerifyBatchRequest) (*VerifyBatchResponse, error)

	// SetDAHeight sets the current DA height for the sequencer
	// This allows the sequencer to track DA height for forced inclusion retrieval
	SetDAHeight(height uint64)

	// GetDAHeight returns the current DA height for the sequencer
	GetDAHeight() uint64
}

Sequencer defines the minimal sequencing interface used by the block executor.

type SubmitBatchTxsRequest

type SubmitBatchTxsRequest struct {
	Id    []byte
	Batch *Batch
}

SubmitBatchTxsRequest is a request to submit a batch of transactions from chain to sequencer

type SubmitBatchTxsResponse

type SubmitBatchTxsResponse struct {
}

SubmitBatchTxsResponse is a response to submitting a batch of transactions from chain to sequencer

type VerifyBatchRequest

type VerifyBatchRequest struct {
	Id        []byte
	BatchData [][]byte
}

VerifyBatchRequest is a request to verify a batch of transactions received from the sequencer

type VerifyBatchResponse

type VerifyBatchResponse struct {
	Status bool
}

VerifyBatchResponse is a response to verifying a batch of transactions received from the sequencer

Jump to

Keyboard shortcuts

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