da

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForceInclusionNotConfigured = errors.New("forced inclusion namespace not configured")

ErrForceInclusionNotConfigured is returned when the forced inclusion namespace is not configured.

Functions

This section is empty.

Types

type AsyncBlockRetriever

type AsyncBlockRetriever interface {
	Start()
	Stop()
	GetCachedBlock(ctx context.Context, daHeight uint64) (*BlockData, error)
	UpdateCurrentHeight(height uint64)
}

AsyncBlockRetriever provides background prefetching of DA blocks

func NewAsyncBlockRetriever

func NewAsyncBlockRetriever(
	client Client,
	logger zerolog.Logger,
	namespace []byte,
	config config.Config,
	daStartHeight uint64,
	prefetchWindow uint64,
) AsyncBlockRetriever

NewAsyncBlockRetriever creates a new async block retriever with in-memory cache.

type BlockData

type BlockData struct {
	Height    uint64
	Timestamp time.Time
	Blobs     [][]byte
}

BlockData contains data retrieved from a single DA height

type Client

type Client interface {
	// Submit submits blobs to the DA layer.
	Submit(ctx context.Context, data [][]byte, gasPrice float64, namespace []byte, options []byte) datypes.ResultSubmit

	// Retrieve retrieves blobs from the DA layer at the specified height and namespace.
	Retrieve(ctx context.Context, height uint64, namespace []byte) datypes.ResultRetrieve

	// Get retrieves blobs by their IDs. Used for visualization and fetching specific blobs.
	Get(ctx context.Context, ids []datypes.ID, namespace []byte) ([]datypes.Blob, error)

	// Namespace accessors.
	GetHeaderNamespace() []byte
	GetDataNamespace() []byte
	GetForcedInclusionNamespace() []byte
	HasForcedInclusionNamespace() bool
}

Client represents the DA client contract.

type Config

type Config struct {
	DA                       *blobrpc.Client
	Logger                   zerolog.Logger
	DefaultTimeout           time.Duration
	Namespace                string
	DataNamespace            string
	ForcedInclusionNamespace string
}

Config contains configuration for the blob DA client.

type ForcedInclusionEvent

type ForcedInclusionEvent struct {
	Timestamp     time.Time
	StartDaHeight uint64
	EndDaHeight   uint64
	Txs           [][]byte
}

ForcedInclusionEvent contains forced inclusion transactions retrieved from DA.

type ForcedInclusionRetriever

type ForcedInclusionRetriever interface {
	RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error)
	Stop()
}

ForcedInclusionRetriever defines the interface for retrieving forced inclusion transactions from DA.

func NewForcedInclusionRetriever

func NewForcedInclusionRetriever(
	client Client,
	logger zerolog.Logger,
	cfg config.Config,
	daStartHeight, daEpochSize uint64,
) ForcedInclusionRetriever

NewForcedInclusionRetriever creates a new forced inclusion retriever. It internally creates and manages an AsyncBlockRetriever for background prefetching.

type FullClient

type FullClient interface {
	Client
	Verifier
}

FullClient combines Client and Verifier interfaces. This is the complete interface implemented by the concrete DA client.

func NewClient

func NewClient(cfg Config) FullClient

NewClient creates a new blob client wrapper with pre-calculated namespace bytes.

func WithTracingClient

func WithTracingClient(inner FullClient) FullClient

WithTracingClient decorates the provided client with tracing spans.

type Verifier

type Verifier interface {
	// GetProofs returns inclusion Proofs for Blobs specified by their IDs.
	GetProofs(ctx context.Context, ids []datypes.ID, namespace []byte) ([]datypes.Proof, error)

	// Validate validates Commitments against the corresponding Proofs.
	Validate(ctx context.Context, ids []datypes.ID, proofs []datypes.Proof, namespace []byte) ([]bool, error)
}

Verifier defines the interface for DA proof verification operations. This is a subset of the DA interface used by sequencers to verify batch inclusion.

Jump to

Keyboard shortcuts

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