Page MenuHomePhabricator

Configuration changes should minimize potential to hardfork
Open, NormalPublic

Description

When doing refactors around CChainParams, @schancel brought up that this code allows for writing code that could cause configuration changes to trigger hardforks. Investigate to see if we can eliminate or at least reduce the surface for hardforks to activate on configuration changes.

Event Timeline

jasonbcox triaged this task as Normal priority.Jan 23 2018, 21:17
jasonbcox created this task.

Some reference diffs for the CChainParams refactors:
https://reviews.bitcoinabc.org/D1010
https://reviews.bitcoinabc.org/D1028

So, my suggestion would be to do the opposite:

  1. Expand Consensus::Params to include things like hardfork times.
  2. Add a way to configure hardfork times at the top level function for block validation.
  3. Strip Config from all the block validation, and instead only accept Consensus::Params.