horizon

package
v1.22.46 Latest Latest
Warning

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

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

Documentation

Overview

Package horizon houses DAG order-theory predicates.

It answers reachability, LCA, and antichain queries, and provides small helpers for certificate/skip detection under a DAG model. In the metaphor, the "event horizon" is the boundary beyond which reordering cannot affect committed history; here, it's a precise predicate over the poset.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPath

func FindPath[V comparable](store dag.Store[V], from, to V) ([]V, bool)

FindPath finds a path between two vertices in the DAG

func TransitiveClosure

func TransitiveClosure[V comparable](store dag.Store[V], vertex V) []V

TransitiveClosure computes the transitive closure of a vertex in the DAG

func ValidateCertificate

func ValidateCertificate[V comparable](store dag.Store[V], cert Certificate[V], isValid func(V) bool) bool

ValidateCertificate checks if a certificate is valid given a validator function

Types

type Certificate

type Certificate[V comparable] struct {
	Vertex    V
	Proof     []V
	Threshold int
}

Certificate represents a proof that a vertex has achieved consensus

type Meta

type Meta interface {
	ID() VertexID
	Author() string
	Round() uint64
	Parents() []VertexID
}

type Params

type Params struct{ N, F int }

type SkipList

type SkipList[V comparable] struct {
	Levels map[V][]V
}

SkipList represents a skip list data structure for efficient DAG traversal

func BuildSkipList

func BuildSkipList[V comparable](store dag.Store[V], vertices []V) *SkipList[V]

BuildSkipList constructs a skip list from DAG vertices for efficient navigation

type VertexID

type VertexID [32]byte

type View

type View interface {
	Get(VertexID) (Meta, bool)
	ByRound(round uint64) []Meta
	Supports(from VertexID, author string, round uint64) bool
}

Jump to

Keyboard shortcuts

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