mirror of
https://github.com/Xahau/xahaud.git
synced 2026-04-29 15:37:46 +00:00
Extract all Xahau consensus extension logic (RNG commit-reveal entropy
and Export validator multisign collection) from Consensus.h and
RCLCxAdaptor into a dedicated ConsensusExtensions class owned by
Application.
Implements all 10 lifecycle hooks from the design doc:
onRoundStart, onTrustedPeerMessage, onTrustedPeerProposal,
decoratePosition, decorateMessage, onTick, onPreBuild,
onAcceptComplete, isSidecarSet, onAcquiredSidecarSet
Key design decisions:
- ConsensusTick<> template in ConsensusTypes.h keeps dependency
direction clean (generic consensus defines contract, extensions
implement it)
- extensionsTick<> shared template in ConsensusExtensionsTick.h
ensures CSF test framework runs the same state machine as production
- ExportSigCollector ownership moved from global singleton to CE
- Sidecar acquisition routed through RCLConsensus mutex for thread
safety (isExtensionSet + gotExtensionSet)
- RCLCxAdaptor reduced to thin ce() accessor + generic consensus
interface methods
Files:
new: ConsensusExtensions.h/.cpp, ConsensusExtensionsTick.h
reduced: Consensus.h (-1060 lines), RCLConsensus.cpp (-1400 lines)
updated: ConsensusTypes.h, Application.h/.cpp, NetworkOPs.cpp,
PeerImp.cpp, Export.cpp, ExportSigCollector.h, Peer.h
7/7 testnet scenarios + 1463 consensus + 260 Export unit tests pass.