dag

package
v1.19.13 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Overview

Package dag provides DAG consensus functionality

Package dag implements consensus for Directed Acyclic Graphs.

DAG handles parallel transactions with causal dependencies, where vertices can reference multiple parents. The consensus pipeline flows: photon → wave → focus → (prism + horizon) → flare → nebula. This enables concurrent transaction processing while respecting causality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// GetVtx gets a vertex by ID
	GetVtx(context.Context, ids.ID) (Transaction, error)

	// BuildVtx builds a new vertex
	BuildVtx(context.Context) (Transaction, error)

	// ParseVtx parses a vertex from bytes
	ParseVtx(context.Context, []byte) (Transaction, error)

	// Start starts the engine
	Start(context.Context, uint32) error

	// Shutdown shuts down the engine
	Shutdown(context.Context) error
}

Engine defines the DAG consensus engine interface

func New

func New() Engine

New creates a new DAG engine

type Transaction

type Transaction interface {
	ID() ids.ID
	Parent() ids.ID
	Height() uint64
	Bytes() []byte
	Verify(context.Context) error
	Accept(context.Context) error
	Reject(context.Context) error
}

Transaction represents a DAG transaction

type Tx

type Tx interface {
	ID() ids.ID
	ParentIDs() []ids.ID
	Bytes() []byte
	Verify(context.Context) error
	Accept(context.Context) error
	Reject(context.Context) error
}

Tx represents a transaction in the DAG

Directories

Path Synopsis
vertexmock
Package vertexmock provides mock implementations for DAG vertices
Package vertexmock provides mock implementations for DAG vertices

Jump to

Keyboard shortcuts

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