cmd, core, miner: add extradata validation to consensus rules #2794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisite PRs, merge these first to get rid of duplicate commits:
This PR makes the necessary consensus modifications to header validation rules so that block header
extraData
fields are enforced to be either0x64616f2d686172642d666f726b
(hex fordao-hard-fork
) for pro-forkers or everything but that for non-forkers. These rules are upheld for10
blocks straight to protect both forkers and non-forkers against malicious actors of the opposite side.Since non-forkers also need to know the actual DAO hard-fork block number to enforce themselves onto the opposite side of the network (i.e. a non-forker fast syncing needs to be aware of the headers it needs to check), this PR makes a further modification to the previous chain configurations so not only a single
ChainConfig.DAOForkNumber
is maintained (previously implicitly signalling pro-fork), but rather an explicitChainConfig.DAOForkSupport
boolean flag is added too. This way both camps can maintain the block numbers whilst also allowing both decisions.