mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
The consensus toolkit now exposes four orthogonal paradigms:
NewChain — linear Snow-family metastable (Nova)
NewDAG — DAG Snow-family metastable (Nebula)
NewPQ — post-quantum threshold Quasar
NewBFT — classical leader-rotation BFT (Simplex/HotStuff family)
NewBFT(cfg BFTConfig) wraps a fully-configured luxbft.Epoch as a
consensus.Engine. The application owns the Epoch's wiring (Storage,
Communication, Signer, BlockBuilder, WAL); the consensus toolkit
owns the lifecycle.
Orthogonality preserved across the three axes:
- consensus paradigm — picks engine (Chain/DAG/PQ/BFT)
- ChainSecurityProfile — picks admissible primitives (strict/permissive/fips)
- FinalitySchemeID — picks the threshold kernel (Pulsar/Corona/MPTC)
A BFT engine under a strict-PQ profile with Pulsar-M-65 finality is
a valid production combination: leader-rotation ordering with
PQ-threshold-signed cert envelopes — exactly the posture a
permissioned subnet might want.
Implementation:
engine/bft/engine.go — thin lifecycle adapter (Start/Stop/
HealthCheck/IsBootstrapped/AdvanceTime/
HandleMessage)
engine/bft/engine_test.go — 6 nil-safety + fail-closed tests
consensus.go — NewBFT factory, BFT type alias,
BFTConfig re-export, MustNewBFT
go.mod requires github.com/luxfi/bft v0.1.5.