Transition contracts to use buidler#170
Conversation
…po into YAS-467/rollup-contracts/refactor
|
Whoops, forgot to add the lint script back in. |
|
Likely difficult to review until #166 is merged |
|
Ok, this now includes the changes already merged to master via #166 |
| /// <reference types="@nomiclabs/buidler-ethers/src/type-extensions" /> | ||
| /// <reference types="@nomiclabs/buidler-waffle/src/type-extensions" /> No newline at end of file |
There was a problem hiding this comment.
Just want to make sure these are supposed to be commented out
There was a problem hiding this comment.
Yeah it's just the weird way that typescript has you explicitly identify typing files (https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html).
karlfloersch
left a comment
There was a problem hiding this comment.
I glanced over everything and overall it looks good! Had a comment here and there but for the most part everything looks in order! I won't say that I really digested every line because most of it just looked like refactoring, so assuming all the old tests are still running (which it seemed to be the case) it LGTM!!!!
| DEPLOY_NETWORK='local' | ||
|
|
||
| # Only if deploying locally | ||
| DEPLOY_LOCAL_URL='http://127.0.0.1:8545' |
There was a problem hiding this comment.
Did this config move to another place? Or is it just not required anymore?
There was a problem hiding this comment.
Ah I'm going to rewrite the deployment scripts since we've had some API changes in the contracts. So I'll include this as part of a new PR.
| @@ -0,0 +1,34 @@ | |||
| import * as path from 'path' | |||
There was a problem hiding this comment.
- This is dope!!!!!! I'm excited to see if we can use buidler for our fullnode tests!
- Should this live in this package? Would we ever use this plugin in the
contractspackage? My guess would be that if we do any transpilation in the contract unit tests, that we would only be transpiling directly & not hook into the low level of buidler. Does that vibe with your intuitions?
There was a problem hiding this comment.
Talked about it in a different forum -- Kelvin suggested / I think the move is to keep the plugin here for now, and then in a new PR move it into it's own package similar to how we have the truffle plugins in a different package -- https://github.com/ethereum-optimism/optimism-monorepo/tree/9b94f0d317b719d2f6b7b48a2eae0bc9c69c5307/packages/ovm-truffle-provider-wrapper
There was a problem hiding this comment.
Hey 👋 I'm one of the authors of Buidler, and just happened to found this browsing github. I'm really curious about this override. Do you do this to run solc nightlies, or do you use your own version/fork of solc? Do you have any idea about what would make this easier to achieve? Thanks!
There was a problem hiding this comment.
Hey @alcuadrado! We currently make use of a custom solidity compiler (translating certain L1-related op codes into operations that can be executed on L2). Since buidler only allows version strings by default, we had to make this slight modification to allow paths to custom solc wrappers. I think it'd be great to allow for path/custom config variables within the solc config.
There was a problem hiding this comment.
If this isn't something you can/want to support natively, an easier change could be to split the steps where the compiler is initialized and the files are compiled into two internal tasks. That'd allow us to simply hook into the compilation step like a normal plugin (instead of overriding the task entirely).
There was a problem hiding this comment.
Thanks for the feedback, @kfichter! We are currently going through an overhaul of the compilation pipeline, so we'll take your ideas into account. If you want to follow it, or propose any other thing, here's the issue track ihttps://github.com/NomicFoundation/hardhat/issues/553
| ZERO_ADDRESS, | ||
| true, | ||
| ]) | ||
| const data = executionManager.interface.encodeFunctionData( |
There was a problem hiding this comment.
Am I correct that there's a "better" way to do this in Ethers 5? I vaguely remember that being the case
There was a problem hiding this comment.
Ah yeah I think this was it -- ethers-io/ethers.js#535 (comment)
| @@ -1,10 +1,10 @@ | |||
| import '../../../setup' | |||
There was a problem hiding this comment.
Just noticed (unrelated to the PR but relevant) -- the filename uses the out of date "purity checking" term and should be changed to "safety checking"
There was a problem hiding this comment.
Ah yeah I'll change that in the next PR.
| const nonce = 1 | ||
| const expectedAddress = utils.getContractAddress({ | ||
| from: wallet1.address, | ||
| from: await wallet1.getAddress(), |
There was a problem hiding this comment.
woah interesting that the get address is async! is that a buidler thing?
There was a problem hiding this comment.
It's a little weird. Buidler uses Signer accounts by default. I ended up having to sort of reimplement the getWallets() behavior anyway, so I may switch everything back to use Wallet instances later on.
* feat: dependency set refactor * fix: deploy script variable name * fix: pr * fix: pr
* feat: add shared lockbox (#126) * feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * chore: update compiler version * feat: integrate portal to lockbox (#139) * feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert * feat: add liquidity migrator contract with its unit test and interface (#128) * feat: create shared lockbox contract with its interface and unit tests * chore: polish tests and interfaces * chore: run pre-pr * chore: improve natspec * chore: run pre-pr * feat: add liqudity migrator contract with its unit test and interface * chore: remove underscore on stack var * chore: add todo * chore: run pre-pr * chore: add contract title natspec and proxied * refactor: integrate testing suite with common test * chore: pre-pr * chore: add spec test * feat: integrate system config with superchain config (#140) * feat: integrate portal to lockbox * fix: pr fixes * test: refactor assert * feat: integrate system config with superchain config * fix: remove OPCM interop * test: add dependency counter test * feat: manage dependency set on superchain config (#138) * chore: add zero dependencies check (#142) * fix: pre pr * feat: Add pause check (#145) * feat: Add pause check Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> * test: add tests natspecs --------- Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> * fix: pre pr and interfaces imports * feat: add upgrader role to superchain config (#163) * feat: use superchain config lockbox in portal (#164) * feat: use superchain config lockbox in portal * test: add new sharedlockbox test * fix: pre pr * feat: liquidity migrator deployment (#166) * feat: liquidity migrator deployment * test: fix comment * test: fix internal variables names * feat: dependency set refactor (#170) * feat: dependency set refactor * fix: deploy script variable name * fix: pr * fix: pr * fix: pre pr * fix: semgrep * fix: merge conflict * [WIP] feat: new lockbox (#192) * chore: partial implementation comments * feat: new lockbox * feat: introduce dependency manager predeploy * feat: remove timestamp check from CrossL2Inbox * feat: introduce cluster manager role and remove immutables * fix: remove unnecessary code, fix tests and setup * feat: use unstructured storage and OZ v5 * fix: L2ToL2CDM dependency set check * fix: dependency manager gas limit * feat: refactor interop feature contracts (#200) * feat: refactor interop feature contracts * fix: add noops comment * feat: adds OptimismPortal migrated flag * test: add missing tests * fix: portal interop storage naming --------- Co-authored-by: Skeletor Spaceman <skeletorspaceman@gmail.com> * fix: pre pr, setup and tests * fix: remove system config interop and add interop portal target check (#205) * fix: remove system config interop and add interop portal check * fix: interop portal target check order * fix: remove wrong comment * fix: refactor portal noops function (#206) * test: add dependency manager and portal interop tests (#209) * feat: initialize shared lockbox in interop portal (#211) * feat: initialize shared lockbox in interop portal * fix: refactor shared lockbox storage getter * fix: lockbox pr fixes (#214) * fix: pre pr * fix: semver lock * fix: semver lock * feat: descope dependency manager (#242) * feat: descope dependency manager * test: fix tests * test: fix tests * chore: improve eth liquidity test (#248) * fix: internal review fixes (#243) * fix: I-0 * fix: I-1 * fix: I-2 * fix: I-3 * fix: I-6 * fix: I-7 * fix: I-9 * fix: pre pr * fix: pre pr * fix: portal withdrawal checks (#255) * fix: portal withdrawal checks * fix: include current withdrawal check * fix: remove unused interop contracts (#256) * test: fix flake tests (#257) * fix: adjust op-deployer interop scripts (#262) * fix: pre pr * fix op-deployer tests * remove dependency code * fix lint * use Bob account --------- Co-authored-by: Disco <131301107+0xDiscotech@users.noreply.github.com> Co-authored-by: AgusDuha <81362284+agusduha@users.noreply.github.com> Co-authored-by: agusduha <agusnduha@gmail.com> Co-authored-by: 0xParticle <particle@defi.sucks> Co-authored-by: gotzenx <78360669+gotzenx@users.noreply.github.com> Co-authored-by: Joxess <joxes@defi.sucks> Co-authored-by: Skeletor Spaceman <skeletorspaceman@gmail.com>
* add semgrep * minor * count time * lint check * print time even fail * dedup test * env checks * avoid duplicated build of contracts
instead of copying the entire buffer, de-reference twice to make a new mutable reference of the input u8 array
## Overview Adjusts the `RollupConfig` type to backwards-activate forks. Right now, if partially constructed with only a later fork timestamp set, prior forks aren't activated. This causes inconsistency in testing in `kona` in a way that's easy to miss.
Implements end to end tests for proof collection. These tests create a blockchain, run the backfill job, then run the live collector. The live collector executes on top of the backfilled state and it already checks that the state root matches, so the tests just ensure that it runs without errors. Fixes #170 --------- Co-authored-by: Emilia Hane <elsaemiliaevahane@gmail.com>
Description
Builds upon #166.
This PR transitions our contracts to use buidler. I didn't want to clutter this PR too much, so haven't cleaned up the tests. Tests are passing locally but I'll make sure its working well in CI. No significant changes to the way that contracts are compiled or deployed, we just have a cleaner API now.
Going to retroactively make a ticket for this since it's become its own task.
Contributing Agreement