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

Add support for solc 0.8.20 and set default to Shanghai #4916

Closed
pcaversaccio opened this issue May 10, 2023 · 15 comments
Closed

Add support for solc 0.8.20 and set default to Shanghai #4916

pcaversaccio opened this issue May 10, 2023 · 15 comments

Comments

@pcaversaccio
Copy link
Contributor

pcaversaccio commented May 10, 2023

solc 0.8.20 just got released https://github.com/ethereum/solidity/releases/tag/v0.8.20

Edit: Added scope to setting default to Shanghai.

@mattsse
Copy link
Member

mattsse commented May 10, 2023

fyi @roynalnaruto

@Evalir
Copy link
Member

Evalir commented May 10, 2023

sick—we can get to this as soon as ethers gets a bump with 0.8.20 support. Ideally it would set Shanghai as the default EVM version too, so we can move over everything to it as well to be in line with the rest of the ecosystem. ( cc @DaniPopes )

@pcaversaccio
Copy link
Contributor Author

FYI (for the ones interested), I also added solc 0.8.20 support for dapptools here dapphub/dapptools#984.

@DaniPopes
Copy link
Member

DaniPopes commented May 10, 2023

Set default to "Shanghai" and added support for the PUSH0 opcode: gakonst/ethers-rs#2414
Blocked on SVM.

@Evalir
Copy link
Member

Evalir commented May 21, 2023

this was done in #4975 — should we close this and track the actual upgrade to Shanghai as default as a separate issue or edit this one?

@pcaversaccio
Copy link
Contributor Author

pcaversaccio commented May 22, 2023

Let's stick to this issue if everyone agrees, so it's easy to find for anyone who searches for the upgrade and default setting to Shanghai. Will update the title of my issue accordingly (Edit: DONE).

@pcaversaccio pcaversaccio changed the title Add support for solc 0.8.20 Add support for solc 0.8.20 and set default to Shanghai May 22, 2023
@dionysuzx
Copy link

when saying "set the default to Shanghai" does this mean 1) the compiler will target shanghai without needing to specify evm_version and 2) that anvil will also use the shanghai EVM? and i'm also curious is shanghai available for anvil now (as a non-default) and if not how do i know which EVM version anvil is running?

and one question.. what is the default evm_version now for foundry when compiling? paris? i was thinking it might be nice to have some version flag on forge / anvil cli to see which evm version is set.

@Evalir
Copy link
Member

Evalir commented May 22, 2023

Hey @d1onys1us — great questions. This means N1. N2 is actually being done right now on this PR: #5001.

The current default EVM Version is Paris, but will be set to shanghai after ethers-rs is bumped with it as default.

@pcaversaccio
Copy link
Contributor Author

what's the status here?

@dionysuzx
Copy link

what's the status here?

adding to this--how do I know if anvil is running --shanghai by default? when i do cast block against either anvil or anvil --hardfork shanghai, I am not seeing withdrawalsRoot returned in the block data.

@Evalir
Copy link
Member

Evalir commented Jun 12, 2023

We've added support for 0.8.20, but decided to keep forge on Paris as default to avoid more compatibility issues. Will be closing this.

@d1onys1us will be opening your comment as a separate issue

@AmazingAng
Copy link

How to set the test environment of Foundry to Shanghai Upgrade?

@pcaversaccio
Copy link
Contributor Author

You can do this in the foundry.toml via the evm_version option; example https://github.com/pcaversaccio/snekmate/blob/main/foundry.toml#L16.

@AmazingAng
Copy link

You can do this in the foundry.toml via the evm_version option; example https://github.com/pcaversaccio/snekmate/blob/main/foundry.toml#L16.

Thanks, I solved it using --evm-version shanghai in cmd.
But we not set default to shanghai?
The Paris version does not support PUSH0 opcode, which is not good.

@pcaversaccio
Copy link
Contributor Author

Thanks, I solved it using --evm-version shanghai in cmd.
But we not set default to shanghai?
The Paris version does not support PUSH0 opcode, which is not good.

No, too many EVM-based chains do currently not support PUSH0, which would lead to a deployment or even runtime revert if compiled via shanghai. Until the to 10 chains in terms of TVL don't support shanghai, it's a good choice to default to paris.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

6 participants