cmd, core, eth, params: implement flags to control dao fork blocks #2788
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.
This PR implements setting the
--support-dao-fork
and--oppose-dao-fork
flags. As of now they only modify a single database entry specifying whether the current default behavior should change.--support-dao-fork
will set it to either mainnet/testnet number--support-dao-fork
will leave it at its present value--oppose-dao-fork
will remove itCaveat: setting the dao number from a custom genesis file, removing it via
--oppose-dao-fork
and reenabling it via--support-dao-fork
will result in the mainnet/testnet number being set, the original private number being lost. Don't use this willy nilly on private networks; rather usegeth init genesis.json
for those scenarios.This PR further drops support to the deprecated
--genesis
flag. This is important because the--support-dao-fork
and--oppose-dao-fork
flags need to know the previous state/number in the database to ensure it's not accidentally overwritten! We do not know this with the--genesis
flag as the user might supply something we can only interpret much later in the code. Note, for main and test network we know in advance what their genesis file would contain, so that's not an issue.