nebula

package
v1.21.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PollSize   int           // sample size for voting
	Alpha      float64       // threshold ratio
	Beta       uint32        // confidence threshold
	RoundTO    time.Duration // round timeout
	GenesisSet []byte        // genesis vertex set
}

Config holds configuration for Nebula consensus mode

type Nebula

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

Nebula implements DAG consensus using the internal Field engine

func NewNebula

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

NewNebula creates a new Nebula instance with Field engine

func (*Nebula[V]) GetCommittedVertices

func (n *Nebula[V]) GetCommittedVertices() []V

GetCommittedVertices returns vertices that have been committed in order

func (*Nebula[V]) GetFrontier

func (n *Nebula[V]) GetFrontier() []V

GetFrontier returns the current DAG frontier (tips)

func (*Nebula[V]) IsFinalized

func (n *Nebula[V]) IsFinalized(vertex V) bool

IsFinalized checks if a vertex is finalized in the DAG

func (*Nebula[V]) OnObserve

func (n *Nebula[V]) OnObserve(ctx context.Context, vertex V)

OnObserve should be called when observing new vertices from the network

func (*Nebula[V]) ProposeVertex

func (n *Nebula[V]) ProposeVertex(ctx context.Context, parents []V) (V, error)

ProposeVertex proposes a new vertex to the DAG

func (*Nebula[V]) Start

func (n *Nebula[V]) Start(ctx context.Context) error

Start begins Nebula DAG consensus operation

func (*Nebula[V]) Stop

func (n *Nebula[V]) Stop(ctx context.Context) error

Stop ends Nebula DAG consensus operation

func (*Nebula[V]) Tick

func (n *Nebula[V]) Tick(ctx context.Context) error

Tick performs one consensus round for DAG progression

type VID

type VID interface{ comparable }

VID represents a vertex identifier in the DAG

Jump to

Keyboard shortcuts

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