-
Notifications
You must be signed in to change notification settings - Fork 652
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
Deprecate truffle #3395
base: main
Are you sure you want to change the base?
Deprecate truffle #3395
Conversation
820cd52
to
b2d4167
Compare
baf1d8a
to
fdf101e
Compare
3433a12
to
14ba26b
Compare
I think we should actually upgrade to the latest openzeppelin release instead. I'm not sure if any of the vulnerabilities found since that old version affects us but we could definitely benefit from improved docstrings and implementations at the very least. |
The same goes for the compiler version, I'd bump it to the latest one. |
@scnale Re:
Solidity >= 0.8.20 include the new push0 opcode, which some Layer 2 chains such as Arbitrum do not support. If you build with that compiler and it uses that opcode, it will be impossible to deploy or run those contracts on those L2s. |
We're already handling this in the foundry config by setting the EVM version explicitly to Just to clarify: the EVM version is an option for the compiler. You can choose the target version to avoid generating bytecode incompatible with an older version. This is what foundry does for us. |
@scnale I think my main worry with that is it is a contract change to the Core, Token, and NFT bridge - which is maybe okay? (and same with bumping the solc version I suppose?) - in any case perhaps it should be done in a seperate PR given this one is already substantial and 'contract changes to Core contracts' probably increases the significance of this PR to more than it's current significance? |
348a88d
to
174c784
Compare
What does change is the output of the compiler, but no changes to the contracts themselves should be required since there aren't any breaking changes within the 0.8 series as far as I recall. I'd say that we're more at risk of introducing bugs by downgrading than upgrading. |
174c784
to
ac941e0
Compare
* change openzeppelin contract * const changes
5408915
to
91ec151
Compare
It also simplifies a few bits.
After #3877, everything in Tilt will have been ported to use Forge / Anvil instead of Truffle / Ganache.
This leaves the only remaining ganache / truffle use as |
What does this PR do?
**Goal: ** Substitute out Truffle and Ganache for Forge and Anvil
Changes:
Eth-devnet.yaml and Eth-devnet2.yaml each start up (in CI and in Tilt) a local ethereum chain using Anvil now, instead of ganache.
The Core, Token, and NFT bridge contracts now use openzeppelin v4.8.1 instead of v4.3.1 - this is an upgrade to keep consistency with the Relayer contracts. NOTE: IF making a contract change to the core, token, and NFT bridges is not desired, revert the corresponding commit (most recent as of this comment) doing this!
Forge scripts are written for:
- Deploying the Core Bridge,
- Deploying the Token Bridge,
- Deploying the NFT Bridge,
- Deploying the Core Bridge (Implementation only),
- Deploying the Token Bridge (Implementation only),
- Deploying the NFT Bridge (Implementation only),
- Deploying the Core Bridge Shutdown contract,
- Deploying the Token Bridge Shutdown contract,
- Deploying the NFT Bridge Shutdown contract,
- Registering chains on the Token Bridge (with registration VAAs passed in as input),
- Registering chains on the NFT Bridge (with registration VAAs passed in as input),
Bash scripts are written for:
- Deploying the Core Bridge,
- Deploying the Token Bridge,
- Deploying the NFT Bridge,
- Registering chains on the token bridge,
- Registering chains on the NFT bridge,
These bash scripts are used in automated devnet/CI deployments, but also can be used for manual deployments because they prompt the user for any variables that haven't been automatically passed in.
The corresponding scripts for the above that were for Truffle were deleted
The simulate_upgrade bash script (works for Core, Token, NFT bridge) was modified to work with the new deployment process
The upgrade bash script (works for Core, Token, NFT bridge) was modified to work with the new deployment process
The verify bash script (checks that deployed bytecode matches local bytecode) (works for Core, Token, NFT bridge) was modified to work with the new deployment process
Some relayer tests were modified - the mining behavior is slightly different now because in ganache, blocks were mined for every transaction as well as once every second, whereas here, we simply mine once every second. Small test modifications were enough to keep tests passing
build artifacts now live in build-forge/file.sol/file.json rather than build/contracts/file.json - some places were modified because of this
Prune the package.json in the ethereum folder a little bit - including removing the @certusone/wormhole-sdk dependency
All truffle tests were removed
Removes 'generate-abi.sh' and 'generate-abi-celo.sh' - these are scripts that use truffle and only @bruce-riley uses, and he will re-write them to use forge if he ever needs them. thank you Bruce! :)
Adds 61-ish forge tests for the Core Bridge, Token Bridge, NFT bridge that were originally written as truffle tests (and adds four TokenMigrator tests that were originally written as truffle tests)
There are a few tests here: https://github.com/wormhole-foundation/wormhole/blob/main/ethereum/test/upgrades/01_tokenbridge_feetoken_support.js that weren't rewritten - input on if these need to be rewritten would help.