unit-e icon indicating copy to clipboard operation
unit-e copied to clipboard

Remove `CChainParams` in favor of `blockchain::Behavior`

Open scravy opened this issue 6 years ago • 0 comments

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::Parameters completely #585
  • [ ] Remove chainparamsbase.h and chainparamsbase.cpp
  • [ ] Remove chainparams.h and chainparams.cpp
  • [x] Introduce default settings in a generic way #675
  • [x] Consolidate new settings in a Settings class #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::FinalizationParams in blockchain::Parameters
  • [ ] Inline admin parameters in blockchain::Parameters
  • [x] Use blockchain::Paramaters instead of CChainParams in 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 gArgs to Settings

scravy avatar Mar 01 '19 15:03 scravy