62 Commits
Author SHA1 Message Date
zeekayandHanzo Dev 980fcf65b4 go 1.26.8
One toolchain across the estate. The tree carried 1.26.0, .1, .3, .4 and .5
at once, so which compiler built a binary depended on which repo it came
from.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-08 23:59:21 -07:00
zeekay 7ca0f79686 Pin past the versions the proxy can no longer serve
The bulk retag moved published tags. go.sum and sum.golang.org hold the
original bytes, proxy.golang.org answers not-found, and the direct fetch
disagrees, so builds stopped at a checksum before reaching a compiler.
Pin forward to versions the proxy still serves.
2026-09-01 13:10:20 -07:00
zeekay b7ceb5fec8 Pin past the versions the proxy can no longer serve
The bulk retag moved published tags. go.sum and sum.golang.org hold the
original bytes, proxy.golang.org answers not-found, and the direct fetch
disagrees, so builds stopped at a checksum before reaching a compiler.
Pin forward to versions the proxy still serves.
2026-09-01 12:27:18 -07:00
zeekay b660d19f51 the face is Zen, and it ships from @hanzo/font
One family. Font stacks name Zen and fall back to the native faces, tokens
name the role rather than a face, and the packages that used to supply a
face now point at @hanzo/font.

Self-hosted @font-face blocks are removed rather than renamed: rewriting the
family in one would leave a src pointing at a file this repo no longer ships.
@hanzo/font carries the binaries and declares the faces, so the local copies
go with the declaration that used them.

Comments naming a face we no longer use are deleted, not reworded.
2026-09-01 08:12:22 -07:00
zeekayandHanzo Dev e413379c45 consensus: retire obsolete SDK facade and refresh vm pin
Co-authored-by: Hanzo Dev <[email protected]>
2026-08-18 22:35:43 -07:00
zeekayandHanzo Dev 2e0f07a69c deps: reconcile luxfi/pq v1.0.3 onto the hash the tag actually resolves to
The v1.0.3 tag was re-pointed by a history rewrite that scrubbed a downstream
brand name from one comment line in mode.go, so the recorded zip hash no longer
matched the remote and clean-cache builds failed with a checksum SECURITY ERROR.

The new content is canonical and the difference is that single comment — no API,
no behaviour, and the module go.mod is byte-identical across both, so the
recorded /go.mod hash is unchanged. Hash re-derived by the toolchain, not
hand-written. luxfi/pq v1.1.1 retracts v1.0.3 so the moved tag stays visible
instead of being laundered away here.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-28 22:45:37 -07:00
zeekay b3d64c7168 deps: bump crypto v1.19.17 -> v1.19.22 (BLS deserialization/aggregation hardening)
Picks up the crypto HIGH-1/RESIDUAL-C BLS boundary hardening (subgroup
check, identity-aggregate reject). go mod tidy pulls accel v1.2.2->v1.2.4
transitively and promotes zap/protobuf to direct (already imported).
Also corrects the nested examples/02-ai-payment module's stale pre-retag
luxfi/threshold v1.9.4 go.sum checksum to the canonical post-retag value.
go mod verify: all modules verified.
2026-06-23 01:32:45 -07:00
zooqueen d01dcfa1c1 feat(quasar): ConsensusCert envelope — policy-gated threshold certification
Canonical finality cert: one policy-gated envelope (VerifyConsensusCert) with
per-leg evidence modes — ThresholdSig (lattice O(1)), WeightedSigSet (independent
FIPS sigs + weighted-Merkle quorum; the only mode for SLH-DSA, never
seed-reconstructed), StarkCompressedSigSet (P3Q, same predicate, audit-gated),
ClassicalAggregate (BLS, never satisfies a PQ leg). Required legs are
policy-derived (CertPolicy.RequiredLegs), never cert bytes (Red H3 anti-downgrade);
full-tuple domain binding. WeightedQuorumCert foundation: policy-as-parameter,
message recomputed internally, strictly-increasing IDs, checked weight.

27 named envelope tests + F1-F5 + 6 CTO attacks PASS; verifier total (fuzz, zero
panics); a fuzz-found threshold-sig flags-byte malleability fixed. Fixed go.sum
[email protected] to canonical transparency-log hashes. Scrubbed ~54MB tracked binaries.
2026-06-21 20:39:11 -07:00
zeekay 0995b00972 examples/02-ai-payment: track in-tree consensus — drops the stale v1.22.84 pin and its transitive luxfi/corona edge (Corona is the canonical R-LWE threshold) 2026-06-10 23:09:39 -07:00
zeekay efa2676bb6 go: 1.26.3 → 1.26.4 (security: crypto/x509, mime, net/textproto) 2026-06-06 22:04:55 -07:00
zeekay ba0e4c96f1 corona → corona total rename — no alias, no wire compat
Per CTO directive: kill any alias, any shim. R-LWE threshold sig is
named Corona across all live code. Forward-only.

Sweep covers Go + TS + Sol + k8s YAML + JSON + LP markdown + skills
+ docs. Skipped: papers/audits/legal/licenses/blog/HISTORY (immutable
historical record).
2026-06-06 13:56:43 -07:00
zeekay f4a33243dd deps(examples): bump consensus + p2p to current floors (Wave 2G-Cascade) 2026-06-06 06:31:55 -07:00
zeekay c2e93c3942 WIP: session checkpoint 2026-06-05 (codec rip in flight) 2026-06-05 15:33:52 -07:00
zeekay b6a0f15f4f go.mod: bump go directive to 1.26.3 (security advisory) 2026-05-12 20:54:59 -07:00
zeekay faf3f78756 gofmt: cleanup after Corona purge identifier renames 2026-05-12 14:53:30 -07:00
zeekay 5783c0cb41 consensus: PQ canonical terminology (FIPS 203/204/205 + Pulsar + Lamport) 2026-05-05 17:52:32 -07:00
zeekay f651395f50 Wire consensus PQ end-to-end: real BLS+Corona+ML-DSA
- protocol/quasar/types.go: QuasarCert MarshalBinary/UnmarshalBinary
  (length-prefixed wire layout, leading byte CertSchemeQuasar=0x04),
  VerifyWithRealKeys cryptographic verification, EncodeMLDSASigs helper
- protocol/quasar/corona_gob.go: gob serializer for pulsar/threshold
  Signature
- protocol/quasar/engine.go: Certifier.AttachSigner; generateCert drives
  signer.TripleSignRound1 (real BLS share + MLDSAProof). Falls back to
  legacy SHA-256 only when no signer attached
- engine/pq/engine.go: AttachSigner/AttachVerifyKeys; VerifyQuantumSignature
  decodes QuasarCert + runs VerifyWithRealKeys; GenerateQuantumProof
  emits serialized QuasarCert
- engine/pq/crypto.go: ML-DSA-65 keypair; real GeneratePQSignature
- engine/pq/consensus.go: PQMode field; resolves via config.PQModeFromEnv
- config/pq_mode.go: PQMode enum (BLSOnly | BLSPlusMLDSA | BLSPlusCorona
  | BLSPlusGroth16 | TripleQuantum), LUX_CONSENSUS_PQ_MODE env support
- pkg/wire/policies.go: QuantumPolicy serializes real QuasarCert into
  cert.Proof; Verify decodes via UnmarshalBinary; VerifyWithKeys does
  cryptographic verification
- engine/gpu_batch_pipeline.go: gpuAvailable() wired to accel.Available();
  verifyBLSBatchGPU calls accel.BLSBatchVerify
- bench/pq_modes_bench_test.go: 5 PQ mode benches with real BLS aggregate,
  real ML-DSA-65, real Corona 2-round threshold. Storage projection
  comparison.

1237 tests pass.

Bench results (Apple M1, n=21):
  Mode             Sign     Agg      Verify   Cert     Storage 10K
  bls              312µs    8.6ms    714µs    123 B    1.17 MB
  bls-mldsa        369µs    8.5ms    3.4ms    69 KB    665 MB
  bls-rt           39ms     3.3s     1.6ms    33 KB    318 MB
  triple           40ms     3.3s     4.3ms    102 KB   981 MB
2026-05-05 10:14:09 -07:00
zeekay 299fa7336f clean: remove deprecated aliases, AI slop, backwards compat code
- Delete DeprecatedConfig/NewFromDeprecated in syncer (49 lines)
- Delete ChainVMWithNetwork/ChainVMWithHealth type aliases
- Delete QBlock, newSignerWithThreshold, VMState aliases
- Delete GetNetID (returned empty string)
- Remove all "In production" / "For now" / "placeholder" comments
- Fix examples: NewSimpleModel API, big.NewInt overflow
- Published deps for all examples (consensus v1.22.84, dex v1.4.1)
2026-02-15 14:08:02 -08:00
zeekay 3606f54d2c SECURITY: fix threshold sig bypass + BlockCert + min threshold
CRITICAL: VerifyQuasarSigWithContext no longer returns true for
IsThreshold sigs — verifies BLS bytes against group key.
CRITICAL: BlockCert.Verify returns false; VerifyWithKeys requires
real crypto verification.
HIGH: NewEngine/NewQuasar reject threshold < 2 (NewTestEngine/
NewTestQuasar for single-node testing).
13 security regression tests added.
2026-03-02 23:59:00 -08:00
zeekay 726d939e83 consensus: permissionless launch readiness
BLOCKING fixes:
- Quasar: multi-validator finalization (require QThreshold sigs)
- Stake-weighted sampling (StakeWeightedCut replaces SimpleCut)
- FPC: configurable seed via DeriveEpochSeed (was hardcoded string)
- Slashing: equivocation detection (double-vote, double-sign, downtime)
- Prism: implement Propose/Vote (was nil-return stubs)

NON-BLOCKING fixes:
- Photon: Fisher-Yates shuffle in Emit() (was returning first N)
- Field: memoized isFullyFinalized (was O(n^2) DFS)
- Remove Snow/Avalanche references from production code
- Rename snowball_compat tests to threshold_compat
- Fix wave.New callers for (Wave, error) return

New: core/slashing package with Detector, Evidence, SlashingDB
All 26 packages pass. Zero failures.
2026-03-02 23:59:00 -08:00
zeekay ad92e773f8 chore: bump Go 1.26.0 → 1.26.1
Fixes 5 stdlib CVEs (html/template, os, net/url, crypto/x509 x2).
2026-03-12 01:08:04 -07:00
zeekay 9830a1b1ec chore: update Go module dependencies 2026-03-03 15:28:57 -08:00
zeekay 257cacb84a chore: sync dependencies and format code 2026-02-04 15:44:47 -08:00
zeekay d18fd12dc7 chore: update vm to v1.0.27 (import cycle fix)
Updated vm dependency to use the version that removes the runtime
import from verify/net.go, breaking the import cycle.
2026-01-26 09:26:33 -08:00
zeekay 79eb047505 feat: unify Python SDK with MCP mesh consensus
Major changes:
- Merge pkg/wire Python types into pkg/python/lux_consensus
- Add MCP mesh consensus module (from hanzo-consensus)
- Add types.py with Candidate, Vote, Certificate for wire protocol
- Bridge functions for AI consensus -> blockchain interop
- Keep pkg/wire as Go-only wire protocol types

Python SDK now provides:
- lux_consensus: Core chain/block/vote types
- lux_consensus.types: Wire protocol (Candidate, WireVote, WireCertificate)
- lux_consensus.mcp: MCP mesh for agent-to-agent consensus

Also includes engine improvements:
- Chain syncer with persistence
- PQ crypto enhancements
- External sequencer finality example
- Protocol field/horizon/prism updates

All tests passing.
2026-01-13 09:49:03 -08:00
zeekay 5470201505 refactor: remove CGO dependencies, clean up MLX/GPU code 2026-01-11 20:39:40 -08:00
zeekay 98d989a74f chore: remove stale node dependency, update deps 2026-01-09 01:18:57 -08:00
zeekay 4e046cf50d refactor: update dependencies and engine improvements 2026-01-05 01:28:53 -08:00
zeekay 9f512ab6c1 refactor: quasar protocol improvements and test updates
- Update quasar BLS and GPU integration
- Improve epoch and threshold management
- Remove deprecated corona module
- Update integration tests for chain engine
- Enhance dynamic and dual threshold tests
- CGO_ENABLED=1 default for GPU acceleration
2026-01-03 07:01:00 -08:00
zeekay 8893e15fba chore: remove local replace directives, upgrade crypto to v1.17.31
- Remove local replace directives for crypto and lattice
- Update github.com/luxfi/crypto to v1.17.31
- DAG consensus improvements
2025-12-31 04:26:59 -08:00
zeekay 641bc4f4a9 feat(quasar): add GPU orchestrator for consensus acceleration
Add GPU orchestrator to quasar protocol for hardware-accelerated consensus:

GPU Orchestrator (protocol/quasar/gpu*.go):
- gpu.go: Pure Go stub implementation (default, !cgo build tag)
- gpu_cgo.go: CGO implementation integrating crypto/gpu and corona/gpu
- gpu_test.go: Comprehensive test suite for GPU operations

Features:
- BLS batch verification and signature aggregation
- ML-DSA post-quantum signature operations
- Threshold signature context (keygen, partial sign, combine)
- Batch hashing (SHA3-256, SHA3-512, BLAKE3)
- Corona GPU operations (NTT, polynomial ops, sampling)
- Block verification combining BLS and threshold signatures

The GPU orchestrator follows the composable architecture:
- gpu.go (pure Go default) / gpu_cgo.go (CGO opt-in)
- Integrates with corona/gpu for post-quantum threshold signatures
- Works seamlessly with and without CGO enabled

Also includes dependency updates and minor fixes.
2025-12-30 14:38:53 -08:00
zeekay e8e0251f16 Add DAG bootstrap and state types for consensus package
- Add state.SerializerConfig and state.NewSerializer for vertex serialization
- Add state.Manager interface extending State with DAG operations
- Add bootstrap.Config with all required interfaces (Blocker, Halter, LinearizableVM)
- Add bootstrap.Bootstrapper implementing BootstrapableEngine
- Add bootstrap/queue.Queue for job processing
- Add getter.Handler and getter.Getter interfaces

This enables the DAG consensus engine to be properly wired up in the node.
2025-12-25 20:19:13 -08:00
zeekay bc6d63725e Update dependencies for v1.22.27
- Update luxfi/p2p to v1.4.7
- Update luxfi/warp to v1.16.37
- Update luxfi/metric to v1.4.8
- Fix crypto import in example file
2025-12-13 17:15:07 +00:00
zeekay 4aac78700d Refactor: remove dead code, add thread safety, improve test coverage
- Remove unused packages: engine/dag/{getter,bootstrap,vertex/vertexmock},
  engine/pq/{bootstrap,block}, core/{tracker,verify}
- Add sync.RWMutex to protocol/wave for thread-safe map access
- Increase engine/dag test coverage from 11.7% to 98.3%
- Add comprehensive tests for DAG consensus, vertex, and engine
- All 27 packages pass tests, 16 at 100% coverage
2025-12-13 07:42:01 +00:00
zeekay bca5f6c9de Fix more imports/tests 2025-12-12 17:00:55 -08:00
zeekay 80d4203940 feat: add complete Quasar protocol example and comprehensive documentation
Quasar Protocol Example:
- Full demonstration of FPC + Wave + Horizon working together
- Shows real block finalization with timing
- Demonstrates all 13 DAG algorithms in action
- Complete test suite with coverage
- Interactive output with progress bars

Comprehensive Documentation (9 files, 3000+ lines):
- Main docs hub with SDK navigation
- Byzantine consensus education (from first principles)
- Complete SDK guides: Go, Python, Rust, C, C++
- Consolidated benchmarks (ONE authoritative page)
- Beginner tutorial (15-minute path to working code)
- Whitepaper integration

Documentation Features:
- Beginner-friendly (assumes zero blockchain knowledge)
- Real-world analogies (Byzantine Generals, phase transitions)
- Step-by-step tutorials with explanations
- Installation + examples for ALL 5 SDKs
- Test coverage matrix
- Performance comparison tables
- Troubleshooting guides

Test Coverage Demonstrated:
- FPC: 100% coverage, determinism + variety tests
- Horizon: All 13 algorithms tested
- Block finalization: Single to multi-validator scenarios
- Byzantine tolerance: Certificate threshold validation
- Integration: Full protocol flow

This makes Lux Consensus accessible to developers at all levels while
maintaining technical depth for experts.
2025-11-13 11:06:08 -08:00
zeekay b433ac3c53 fix: resolve all build and test issues
- Fixed cmd tools to use new consensus API (NewChain instead of NewChainEngine)
- Removed deprecated Rust tests that use old API
- Fixed golangci-lint configuration
- Applied gofmt formatting to all Go files
- All Go tests passing
- All Python tests passing
- Basic Rust tests passing
2025-11-13 00:42:20 -08:00
zeekay 4bbeffe36e fix: update all tests and commands to use new consensus API
- Fixed cmd/checker and cmd/consensus to use new Engine interface
- Fixed integration tests to use GetConfig instead of Config()
- Updated Python SDK tests for new Chain API
- Added basic Rust tests that pass
- Fixed import paths from luxfi/node to local packages
- Moved test files to proper directories
2025-11-13 00:22:56 -08:00
zeekay f5da5ba21d refactor: clean package structure with single-import SDKs
BREAKING CHANGE: Package paths have been reorganized for clarity

## Major Changes

### Package Structure
- Collapsed engine/core → engine (removed unnecessary nesting)
- Moved core/types → types (top-level types package)
- Added root facade for single-import experience
- Removed redundant factory.go

### SDK Improvements
All SDKs now provide single-import interfaces:
- Go: import "github.com/luxfi/consensus"
- Python: import lux_consensus as consensus
- Rust: use lux_consensus::*

### Documentation
- Added comprehensive introduction and architecture docs
- Created AI/ML integration guide for researchers
- Added research section with papers and experiments
- Improved sidebar organization and discoverability

### Benefits
- Shallow, obvious import paths
- One responsibility per package
- DRY, composable, orthogonal design
- Idiomatic patterns for each language
- Consistent API across all SDKs

This refactor provides a clean, intuitive developer experience where
one import is enough and things work one way only.
2025-11-12 21:40:00 -08:00
zeekay 0ccb400ef7 feat: add Go MLX GPU acceleration
Implements MLX GPU acceleration for Go consensus with github.com/luxfi/mlx:

Features:
- MLXBackend with adaptive batch processing
- Automatic GPU/CPU device selection
- Neural network inference on GPU
- Throughput tracking and optimization

Example Usage:
```go
backend, _ := ai.NewMLXBackend(32)
backend.ProcessVotesBatch(votes)
fmt.Println("Throughput:", backend.GetThroughput())
```

Build with: go build -tags mlx

Completes MLX support across all SDKs:
- ✅ Go (github.com/luxfi/mlx)
- ✅ C++ (MLX C++ bindings)
- ✅ Python (mlx-py)
- ✅ All SDKs tested and working
2025-11-10 10:53:46 -08:00
zeekay 38733854c5 fix: Update to Go 1.25.4, remove go-ethereum, fix CI lint
- Upgrade Go version from 1.25.1 to 1.25.4 (latest stable)
- Remove go-ethereum dependency and use luxfi/geth instead
- Update op_stack example to import from luxfi/geth
- Fix golangci-lint to use project Go version instead of bundled version
- Install golangci-lint via go install to ensure correct Go version

This addresses CI lint failures where golangci-lint was using Go 1.24
instead of the required Go 1.25+.
2025-11-06 13:57:34 -08:00
zeekay be5e1cc3e3 Further cleanup, new benchmarks 2025-11-06 10:44:39 -08:00
zeekay 1fe336b8b2 feat: add Python client requirements 2025-11-06 10:41:23 -08:00
zeekay 1fae7f63c4 fix: remove incomplete code and add working examples
- Remove ai/integration.go.wip (incomplete, undefined types)
- Remove examples/ai-marketplace (incomplete, build failures)
- Remove examples/03-qzmq-networking (undefined types)
- Add working examples: simple-bridge, ai-payment, python-client
- Fix test/integration: remove unused import

All tests passing ✅
2025-11-06 10:40:59 -08:00
zeekay 06544bd943 Refactor, cleaner arch 2025-11-06 10:32:37 -08:00
zeekay 8e45bcd029 refactor: Go-idiomatic package layout
Reorganize consensus packages following Go conventions and best practices:

Protocol Consolidation:
- Move prism/, photon/, wave/ → protocol/ directory
- Consolidate all protocol implementations under single namespace
- Follows standard library pattern (encoding/json, encoding/xml)

Package Naming:
- Rename validators/ → validator/ (singular, lowercase per Go convention)
- Aligns with stdlib patterns (net/http, database/sql)

Import Path Updates:
- Update all 241 Go files with new import paths
- github.com/luxfi/consensus/prism → protocol/prism
- github.com/luxfi/consensus/photon → protocol/photon
- github.com/luxfi/consensus/wave → protocol/wave
- github.com/luxfi/consensus/validators → validator

Benefits:
- Clear separation: core (contracts) vs protocol (algorithms) vs engine (runtime)
- Improved discoverability (all protocols under protocol/)
- Consistent with Go naming conventions
- Zero breaking changes to core APIs
- Easier to add new protocol implementations

Test Results:
- All 67+ tests passing across 21 packages
- 100% test coverage maintained
- No performance regression

Structure:
consensus/
├── core/           # Pure contracts (interfaces, zero deps)
├── protocol/       # Consensus algorithms & mechanics
│   ├── prism/      # Polling/quorum primitives
│   ├── photon/     # Unary consensus
│   ├── wave/       # N-ary consensus (FPC)
│   └── ...         # Other protocol phases
├── engine/         # Runtime glue (runs protocols)
└── validator/      # Validator management (singular)
2025-11-06 04:19:26 -08:00
zeekay c18437f410 Update consensus 2025-11-06 02:36:49 -08:00
zeekay 952479193f consensus: Fix ContextInitializable to use *Context instead of context.Context
- Change ContextInitializable.InitCtx to accept *consensusctx.Context
- Change Contextualizable.InitializeContext to accept *consensusctx.Context
- Update XAssetID, QuantumNetworkID, GetQuantumIDs to use *consensusctx.Context
- Matches upstream avalanchego pattern where Context is consensus-specific type
2025-10-29 14:08:50 -07:00
zeekay b0a2417957 Update tests, coverage 2025-10-26 12:31:28 -07:00
zeekay 2f4d6b5d9e Update copyright 2025-09-26 02:10:39 +00:00