field

package
v1.22.25 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package field orchestrates DAG finality via distributed state reduction.

The field represents a superposition of rays (transaction paths) that aggregate multiple stellar processes (flare events) into a coherent finality layer. Where ray handles linear finality, field coordinates the complex, multi-dimensional case: parallel transactions, causal dependencies, and DAG vertex acceptance across the network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockView

type BlockView[V VID] interface {
	ID() V
	Parents() []V
	Author() types.NodeID
	Round() uint64
}

BlockView is enough for order-theory (parents + metadata).

type Committer

type Committer[V VID] interface {
	Commit(ctx context.Context, ordered []V) error
}

Committer applies an ordered prefix decided by Field.

type Config

type Config struct {
	PollSize int
	Alpha    float64
	Beta     uint32
	RoundTO  time.Duration
}

type Driver

type Driver[V VID] struct {
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver[V VID](cfg Config, cut prism.Cut[V], tx wave.Transport[V], store Store[V], prop Proposer[V], com Committer[V]) *Driver[V]

func (*Driver[V]) GetCommittedVertices

func (d *Driver[V]) GetCommittedVertices() []V

GetCommittedVertices returns vertices that have been committed in order

func (*Driver[V]) GetFrontier

func (d *Driver[V]) GetFrontier() []V

GetFrontier returns the current DAG frontier (tips)

func (*Driver[V]) IsFinalized

func (d *Driver[V]) IsFinalized(vertex V) bool

IsFinalized checks if a vertex is finalized

func (*Driver[V]) OnObserve

func (d *Driver[V]) OnObserve(ctx context.Context, v V)

OnObserve should be called by your networking layer as new vertices arrive. You can also plug DAG fast-path voting (flare) here if you embed it in vertex payloads.

func (*Driver[V]) Propose

func (d *Driver[V]) Propose(ctx context.Context, parents []V) (V, error)

Propose proposes a new vertex with given parents (Nebula will use this)

func (*Driver[V]) Start

func (d *Driver[V]) Start(ctx context.Context) error

Start begins the Field engine operation

func (*Driver[V]) Stop

func (d *Driver[V]) Stop(ctx context.Context) error

Stop ends the Field engine operation

func (*Driver[V]) Tick

func (d *Driver[V]) Tick(ctx context.Context) error

Tick runs one poll round over DAG heads, looks for cert/skip and commits the safe prefix.

type Proposer

type Proposer[V VID] interface {
	Propose(ctx context.Context, parents []V) (V, error)
}

Proposer builds a new vertex from frontier + sidecar votes, etc.

type Service

type Service struct{}

placeholder for epoch/cross-chain features (e.g., checkpoint bundling).

func New

func New() *Service

type Store

type Store[V VID] interface {
	Head() []V
	Get(V) (BlockView[V], bool)
	Children(V) []V
}

Store exposes local DAG state for cert/skip scans and causal reads.

type VID

type VID interface{ comparable } // vertex id

Jump to

Keyboard shortcuts

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