Block: do not auto-activate hardforkByBlockNumber in static BlockHeader constructor #2205
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 reverts on #2081 after a discussion with @acolytec3 on Discord, some extracts:
Example posted by @acolytec3, which was not working any more after the changes:
Reasoning to revert by @holgerd77:
I am coming more and more to the conclusion that this in
BlockHeader.fromRLPSerializedHeader()
was the wrong choice:This is again one of these implicit-options behaviors which is not clear from the outside and this also breaks the above example. If someone wants a
hardforkByBlockNumber
behavior, it is very much possible to set the respective option (that's where the option is for). If someone wants a "HF has precedense" behavior, he/she sets the explicit HF (here: London). There one would except that everything stays in the London realm (this expectation is broken here).On top I am already pretty sure that there are these use cases out there where people (mainly these dev tool guys like HH/Ganache) have some mainnet RLP serialized block with some artificial block number which should behave in a London (e.g.) context. We had such cases various times. This forcing into the block number logic will likely lead to problems for them.
I would somewhat be inclined to revert (unless I might have forgotten the strong reasoning why we introduced).