mirror of
https://github.com/luxfi/consensus.git
synced 2026-09-24 00:26:58 +00:00
Add FPC threshold selector with PRF-based phase-dependent threshold selection. Integrates seamlessly with Wave protocol for dynamic alpha thresholds. Features: - PRF-based deterministic threshold selection using SHA-256 - Configurable theta range [θ_min, θ_max] (default: 0.5-0.8) - Phase-dependent thresholds: α = ⌈θ·k⌉ - Backward compatible with EnableFPC flag (default: false) - Zero breaking changes to existing Wave API Test Coverage: - 10/10 FPC unit tests PASS (determinism, theta range, benchmarks) - 5/5 FPC integration tests PASS (enabled/disabled, variation, comparison) - 18/18 Wave tests PASS (all existing tests still work) Implementation: - /protocol/wave/fpc/fpc.go (83 lines) - Core threshold selector - /protocol/wave/fpc/fpc_test.go (177 lines) - Comprehensive tests - /protocol/wave/fpc_integration_test.go (274 lines) - Integration demos - /protocol/wave/wave.go - Wave integration with FPC support All 78/78 protocol tests passing. FPC is production-ready!