mirror of
https://github.com/luxfi/node.git
synced 2026-07-27 03:39:39 +00:00
cpuBLSVerify / cpuMLDSAVerify previously did length checks and returned true for any well-formed input — a no-GPU node would ACCEPT FORGED signatures once LP-210 wires the GPU pipeline into block-accept. Now they perform REAL verification via luxfi/crypto pure-Go primitives: - BLS: bls.Verify after PublicKeyFromCompressedBytes/SignatureFromBytes (enforces exact length, on-curve, subgroup membership; malformed => false). - ML-DSA: pub.VerifySignature (FIPS-204 nil-context), pk 1952, sig 3309. - Corona + ZK: FAIL CLOSED (return false) — luxfi/crypto has no pure-Go verifier and the Corona GPU kernel is the known-wrong-prime BLOCKED kernel; never rubber-stamp an unverified signature. ML-DSA signature size corrected 3293 (stale round-3 Dilithium3) -> 3309 (FIPS-204 ML-DSA-65) in MLDSAWork doc + gpuMLDSAVerify flatten width, so the CPU oracle and GPU path size the signature identically; pinned by TestMLDSA_WorkStructSizeIsCanonical. Tests rebuilt to carry REAL valid BLS/ML-DSA signatures (was random bytes the old format-only check accepted). TestCPUVerify_RealOracle proves: valid accepted, forged rejected, Corona+ZK fail closed. All green. go.sum: 7 luxfi modules (chains, keys, kms, sdk, staking, zap) had their content hashes refreshed to the canonical registry values after an upstream re-tag (same versions, same go.mod — source re-tag only). 'go mod verify' = all modules verified. Surgical patch (7 lines), minimal go.sum preserved. (cherry picked from commit e40f04b112f8b5d15223325199db4b981f05878c)
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:
- P-Chain provider — feeds live validator state from PlatformVM's validator manager into the engine.
- Quantum fallback signer — adapts the node's BLS signing key.
- 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.