Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Support Paris hardfork #3864

Closed
robmcl4 opened this issue Nov 3, 2022 · 1 comment
Closed

Support Paris hardfork #3864

robmcl4 opened this issue Nov 3, 2022 · 1 comment

Comments

@robmcl4
Copy link
Contributor

robmcl4 commented Nov 3, 2022

Current Situation

ganache only supports up to the grayGlacier ethereum hardfork (see src/chains/ethereum/options/src/chain-options.ts:5).

However, the Paris hardfork (aka 'The Merge') has been active for several weeks now.
Critically, this makes for odd behavior regarding EIP-4399 "Supplant DIFFICULTY opcode with PREVRANDAO".

Proposal

I propose the following changes.

  1. All blocks produced by ganache set the prevRandao header field to 0b100...00, with an option in evm_mine to set the value manually. The first bit is set to 1 so that EVM applications may test for Paris hardfork activation by checking that the PREVRANDAO value is greater than 2**64, as suggested in EIP-4399 (ctrl+f "The probability of RANDAO value").
  2. Update the @ethereumjs/vm dependency to support Block.prevRandao, and update all invocations of the EVM to use the prevRandao value as appropriate, if the Paris hardfork is active. Note that this will require a major version bump from v5 to v6 -- I am not sure how much work this would be.

Caveat: although @ethereumjs/evm does advertise support for EIP-4399, it is currently marked as experimental (see their README)

@davidmurdoch
Copy link
Member

We do have a release for support under the alpha tag: https://github.com/trufflesuite/ganache/releases/tag/v7.4.4-alpha.0

You can track our progress getting it to stable here: #3693 (comment)

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants