Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default EVM target is still paris #5267

Closed
SKYBITDev3 opened this issue May 23, 2024 · 1 comment
Closed

Default EVM target is still paris #5267

SKYBITDev3 opened this issue May 23, 2024 · 1 comment
Assignees

Comments

@SKYBITDev3
Copy link

Version of Hardhat

2.22.4

What happened?

If evmVersion version isn't explicitly set in hardhat config then compilation result is:

Compiled 152 Solidity files successfully (evm target: paris).

After explicitly setting evmVersion to cancun like this:

  solidity: {
    compilers: [
      {
        version: `0.8.26`,
        settings: {
          optimizer: {
            enabled: true,
            runs: 15000
          },
          evmVersion: `cancun`,
        }
      },
    ],
  },

then it says the evm target was cancun as expected:

Compiled 152 Solidity files successfully (evm target: cancun).

Did you guys check that #4851 actually worked?

Minimal reproduction steps

Don't explicitly set evmVersion in hardhat config and run yarn hardhat compile.

Search terms

No response

@fvictorio
Copy link
Member

Hi @SKYBITDev3, I think you are mixing up two concepts here.

#4851 is about using Cancun as the default hardfork of the Hardhat Network. That means that, for example, that transient storage opcodes are available by default. We did check that it works 🙂

The EVM target of solc is a different thing. This is what kind of opcodes will be used in the bytecode generated by solc. In this case, a paris target means that solc won't use transient storage opcodes (or any opcode introduced after paris).

The reason for this is that not all chains enable hardforks immediately. This was a problem, for example, when PUSH0 was introduced: if you used the latest version of solc with their default EVM target (which used PUSH0) but then deployed in a chain that didn't have the opcode yet, your contract will not work. So we decided to be conservative about this.

Ideally Hardhat would have a good alignment between the solc EVM target, the local hardhat network hardfork, and the (minimum) hardfork of the chains where you intend to deploy, but we are not there yet.

Now, it's true that paris is kind of an old hardfork now. We might have to upgrade the default EVM target, but we don't really have a policy of how and when to do that (see #4264)

@fvictorio fvictorio closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants