Remove `CChainParams` in favor of `blockchain::Behavior`
Currently we have the situation that we have CChainParams and blockchain::Parameters. Additionally we have gArgs, Settings, CBaseCainParams, blockchain::Behavior, esperanza::FinalizationParams, Consensus::Params, AdminParams, SnapshotParams.
The goal is to have a clear distinction between Settings and Parameters. Parameters are something which have a specific, unchangeable value for a network. A Setting is a user-configurable value which does not affect consensus, just the local behavior of the node with respect to maybe policy or technical details like how many threads to use, etc.
We are probably not going to get rid of gArgs as these changes would be too extensive but @scravy is determined to get rid of CChainParams and CBaseChainParams. Transitioning there is a work in progress. However new settings should go to Settings.
We can try to migrate all the gArgs to Settings, but that would definitely be a 1.0 goal, not a 0.1 goal. Maybe even a refactoring after that. And it makes merging with bitcoin hell.
Items so far:
- [ ] Move to new
blockchain::Parameterscompletely #585 - [ ] Remove
chainparamsbase.handchainparamsbase.cpp - [ ] Remove
chainparams.handchainparams.cpp - [x] Introduce default settings in a generic way #675
- [x] Consolidate new settings in a
Settingsclass #380 - [x] Make Genesis block easily buildable using a Builder pattern #272 #607
- [x] Use new Genesis block in the whole of unit-e #702
- [x] Make parameters injectable for tests (these are not settings) #679 #704
- [ ] Inline
esperanza::FinalizationParamsinblockchain::Parameters - [ ] Inline admin parameters in
blockchain::Parameters - [x] Use
blockchain::Paramatersinstead ofCChainParamsin keys #411 - [ ] Clarify which snapshot parameters are actually settings (seems to me ill-defined right now) and inline them in
blockchain::Parameters - [ ] Consolidate existing settings from
gArgstoSettings