cmd/evm/internal/t8ntool, core, core/vm, miner, params: implement eip 2935: save historical block hash in state #28878
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 is a rewrite building on my previous attempt.
Because the EIP is only activated 256 blocks after the fork, and that timestamp-based fork makes things really tricky, this approach checks the contract to see if the blockhash of its 256th ancestor is non-zero. If that is the case, then it means that the EIP has been active since at least 256 blocks, and therefore it is safe to activate the new behavior. Otherwise, it will default to the older behavior.Rewrote the branch to conform to the latest version of the EIP, in which all previous 256 ancestor hashes are written to the contract at the fork. The EIP is rooted at Prague because this is the fork that is being targeted.