- 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
Add CoronaPubKey field to GetValidatorOutput and WarpValidator
structs to support hybrid BLS+Corona quantum-safe signatures.
Part of the quantum-safe Warp messaging upgrade.
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.
Rationale: Bag is a fundamental data type, not a utility
Changes:
- Moved utils/bag/ → types/bag/
- Updated imports in error_propagation_test.go
- Updated imports in network_test.go
- Updated package documentation
Why types/ over utils/:
- Bag is a multiset data structure (fundamental type)
- SetThreshold/Threshold methods are type-level features
- More semantic: types contain data structures, utils contain helpers
Canonical import: github.com/luxfi/consensus/types/bag
All tests passing:
- ✅ Chain engine: 28 tests (0.438s)
- ✅ Integration: all tests (59s)
Next: Node should kill utils/bag and import consensus/types/bag
Add GetWarpValidatorSets() and GetWarpValidatorSet() methods to the
validators.State interface for accessing BLS-enabled validator sets
required for Warp message signing.
Changes:
- Add WarpValidator and WarpSet types to represent Warp-capable validators
- Add GetWarpValidatorSets(ctx, heights, netIDs) for batch lookups
- Add GetWarpValidatorSet(ctx, height, netID) for single lookups
- Regenerate mocks with new interface methods
- Add comprehensive test coverage for Warp accessor methods
- Update mockState in validators_test.go to implement new methods
All tests passing: 5/5 new tests, all existing tests still pass.
- doc.go: Convert spaces to tabs for proper Go formatting
- validator/validatorstest/test.go: Add validators import alias
- engine/chain/chaintest/test_blocks.go: Add consensustest import alias
- engine/chain/block/blocktest/test.go: Add consensustest import alias
These formatting fixes resolve all lint errors from golangci-lint.
- Removed wavefpc references from Makefile (moved to protocol/wave)
- Fixed duplicate Engine interface by renaming to SimpleEngine in message.go
- Consolidated validator and validators directories into single validators package
- Removed empty util directory
- Fixed package declarations to match directory names
- Updated all imports from validator to validators
This completes the consensus repository reorganization with:
- All protocols in /protocol/
- All engines in /engine/
- No duplicate directories or packages
- Consistent package naming
- Replace all snowball/snowflake references with photon/pulse/wave terminology
- Update test function names to use new nomenclature (TestPhotonBinary, TestWaveMultiChoice, etc.)
- Fix TestParameters Beta value from 1 to 2 to prevent immediate finalization
- Fix wave preference update logic to properly reset non-voted choices
- Make photon Add() method idempotent to allow re-adding same choice
- Rename test files: binary_snowball_test.go → photon_binary_test.go, etc.
- Update struct field names: snowflakePreference → wavePreference/pulsePreference
- Change Nnary to MultiChoice throughout the codebase
- Update comments to remove avalanche-specific terminology
Most tests now pass with the new terminology. Some test failures remain in
the main consensus package that need further investigation, but core protocol
implementations (photon, pulse, wave, prism, quasar) are working correctly.