Help us shape the future of Go! Take the 2026 Go Developer Survey

consensus

package
v1.28.29 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

README

Consensus Package (Node-Side Integration)

This package provides node-side glue around the canonical consensus engine in github.com/luxfi/consensus. It does NOT implement the consensus protocol — it only wires the engine into the node's chain manager, indexer, and IPC layers.

Overview

The consensus package contains:

  • Acceptor: Callback mechanism invoked when consensus accepts a block / vertex. Adapts chain-ID-keyed runtime contexts to the node's indexer and warp IPC.
  • Quasar: Node-side wiring around consensus/protocol/quasar (BLS + Corona hybrid finality). Adapts P-Chain validator state, BLS signing keys, and the Corona threshold coordinator.

Package Structure

consensus/
  acceptor.go     # Acceptor interface + chain-ID-keyed AcceptorGroup
  quasar/         # Node-side wrapper around luxfi/consensus/protocol/quasar
  zap/            # ZAP agentic-consensus / DID bridge (self-contained)

Acceptor

The Acceptor interface is called before containers are committed as accepted:

type Acceptor interface {
    Accept(rt *runtime.Runtime, containerID ids.ID, container []byte) error
}

Multiple acceptors can be registered per chain via AcceptorGroup.

Quasar Integration

The quasar/ subpackage wraps github.com/luxfi/consensus/protocol/quasar and provides node-specific wiring:

  1. P-Chain provider — feeds live validator state from PlatformVM's validator manager into the engine.
  2. Quantum fallback signer — adapts the node's BLS signing key.
  3. Corona coordinator stub — placeholder until real threshold key material is loaded.

The actual hybrid finality protocol (BLS + Corona + ML-DSA threshold signing) lives in luxfi/consensus. See that repository for protocol details, parameter tuning, and benchmarks.

Documentation

Overview

Package consensus provides node-side consensus integration for the Lux node.

The canonical consensus protocol implementation lives in the github.com/luxfi/consensus module. This package only contains the node-side glue (Acceptor callbacks, Quasar wiring) needed to wire the consensus engine into the node's chain manager and indexer.

Components

Acceptor: Callback interface invoked before blocks are committed as accepted. Multiple acceptors can be registered per chain via AcceptorGroup. This is the node-side hook that adapts consensus acceptance to chain-ID-keyed runtime contexts (indexer, warp, IPC).

Quasar: Node-side wiring around github.com/luxfi/consensus/protocol/quasar. The quasar subpackage adapts P-Chain validator state, BLS signers, and the Corona threshold coordinator into the canonical consensus engine.

Quasar Integration

The Quasar engine achieves hybrid finality by running two signature paths in parallel:

  • BLS Path: Fast aggregate signatures from 2/3+ validators
  • Corona Path: Post-quantum threshold signatures (t-of-n)

Blocks achieve quantum finality only when both paths complete successfully.

See github.com/luxfi/consensus for the canonical protocol implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acceptor

type Acceptor interface {
	// Accept must be called before [containerID] is committed to the VM as
	// accepted.
	//
	// If the returned error is non-nil, the chain associated with [ctx] should
	// shut down and not commit [container] or any other container to its
	// database as accepted.
	Accept(rt *runtime.Runtime, containerID ids.ID, container []byte) error
}

Acceptor is implemented when a struct is monitoring if a message is accepted

type AcceptorGroup

type AcceptorGroup interface {
	// Calling Accept() calls all of the registered acceptors for the relevant
	// chain.
	Acceptor

	// RegisterAcceptor causes [acceptor] to be called every time an operation
	// is accepted on chain [chainID].
	// If [dieOnError], chain [chainID] stops if Accept returns a non-nil error.
	RegisterAcceptor(chainID ids.ID, acceptorName string, acceptor Acceptor, dieOnError bool) error

	// DeregisterAcceptor removes an acceptor from the group.
	DeregisterAcceptor(chainID ids.ID, acceptorName string) error
}

func NewAcceptorGroup

func NewAcceptorGroup(log log.Logger) AcceptorGroup

Directories

Path Synopsis
Package quasar provides hybrid quantum-safe consensus finality.
Package quasar provides hybrid quantum-safe consensus finality.
Package zap provides ZAP (Zero-copy Agent Protocol) integration for Lux consensus.
Package zap provides ZAP (Zero-copy Agent Protocol) integration for Lux consensus.

Jump to

Keyboard shortcuts

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