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

Regenesis/0.4.0 #993

Merged
merged 56 commits into from
Jun 22, 2021
Merged

Regenesis/0.4.0 #993

merged 56 commits into from
Jun 22, 2021

Conversation

smartcontracts
Copy link
Contributor

Keeping track of changes here and making sure that CI passes

smartcontracts and others added 15 commits May 28, 2021 14:28
…contract (#808)

* wip: Started working on L2 contract testing revamp

* test: clean tests for ProxyEOA

* style: clean imports for ProxyEOA tests

* test: port tests for ECDSAContractAccount

* fix tests and add wrapper to dump

* fix: add em wrapper to l2 deploy

* ffix: add comments to wrapper contract

* fix: add more comments

* fix: add smock comment for unbind

* Update packages/smock/src/smockit/binding.ts
* maintenance: use dashes in chain container names

* chore: add changeset
* feat[contracts]: disable eoa upgrades temporarily

* chore: add changeset

* Update OVM_ProxyEOA.sol

* fix: turn upgrade into a noop

* lint: fix
…up data transport layer (#820)

* feat: update and improve AddressSet event

* chore: add changeset

* Update Lib_AddressManager.sol
* Remove messageNonce from BaseCrossDomainMessenger and use CTC queue lenght instead

Remove Abs_BaseCrossDomainMessenger and restore dedicated nonce generation in OVM_L2CrossDomainMessenger

Fix typo

* Remove sentMessages mapping from L1CrossDomainMessenger storage
and use the nonce to check for existence of replayed transaction

* Refactor out common library function for getting cross domain calldata

* Post rebase fixes

* Use the queueIndex to check the transaction was enqueued

* Fix tests for L1CrossDomainMessenger.replayMessage
Also make that test work with an actual CanonicalTransactionChain implementation rather than a smock

* Lint fixes

* Optimise the resolve calls into the AddressManager lib

* Rename the nonce parameter to be clear

* Update test name

Co-authored-by: ben-chain <ben@pseudonym.party>

* Rename getXDomainCalldata to encodeXDomainCalldata to match the new Lib_CrossDomainUtils

Co-authored-by: ben-chain <ben@pseudonym.party>
* optimism: bump gaslimit to 10million

* chore: add changeset

* optimism: bump max gaslimit to 10 mil

* chore: add changeset

* chore: remove unnecessary changeset

* chore: remove unnecessary changeset

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* l2geth: remove tx type

* l2geth: no longer parse type in rollup client

* chore: add changeset

* chore: remove extra sighash params

* fix: do not check txtype in integration tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* feat[contracts]: congestion price oracle

* chore: add changeset

* contracts: gas price oracle (#917)

* contracts: gas price oracle

* tests: update

* fees: fix tests

* contracts: simplify gas price oracle

* lint: fix

* test: execution price is at the 1st storage slot

* chore: rename predeploy to GasPriceOracle

* chore: rename gas price oracle test name

Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Uniswap V3 contracts require that, otherwise they throw call exceptions at deployment
* added library for predeploy addresses

* refactor tests and other packages to use exported predeploys

* revert library usage in OVM_ECDSAContractAccount

* lint

* added newline

* fixed address typos

Co-authored-by: rajivpo <rajivpatel-oconnor@Rajivs-MacBook-Pro-2.local>
Co-authored-by: smartcontracts <kelvinfichter@gmail.com>
#821)

* feat[contracts]: replace Lib_RingBuffer with a simpler Lib_Buffer

* chore: changeset

* test: add tests for Lib_Buffer

* lint: fix

* test: add extra coverage for Lib_Buffer

* Update packages/contracts/contracts/optimistic-ethereum/libraries/utils/Lib_Buffer.sol

Co-authored-by: ben-chain <ben@pseudonym.party>

* add some extra comments

Co-authored-by: ben-chain <ben@pseudonym.party>
* fix(contracts): import predeploys

* fix: lint
@changeset-bot
Copy link

changeset-bot bot commented Jun 1, 2021

🦋 Changeset detected

Latest commit: 6ad1dcb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@eth-optimism/integration-tests Minor
@eth-optimism/contracts Minor
@eth-optimism/l2geth Minor
@eth-optimism/data-transport-layer Minor
@eth-optimism/batch-submitter Patch
@eth-optimism/message-relayer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added 2-reviewers A-op-batcher Area: op-batcher A-pkg-core-utils Area: packages/core-utils A-ops Area: ops labels Jun 1, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2021

Codecov Report

Merging #993 (6ad1dcb) into develop (42decb6) will increase coverage by 3.75%.
The diff coverage is 88.17%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #993      +/-   ##
===========================================
+ Coverage    82.26%   86.01%   +3.75%     
===========================================
  Files           49       48       -1     
  Lines         1900     1931      +31     
  Branches       303      305       +2     
===========================================
+ Hits          1563     1661      +98     
+ Misses         337      270      -67     
Impacted Files Coverage Δ
...hereum/OVM/chain/OVM_CanonicalTransactionChain.sol 94.70% <ø> (+1.05%) ⬆️
...c-ethereum/OVM/chain/OVM_ChainStorageContainer.sol 80.00% <ø> (+7.27%) ⬆️
...ic-ethereum/OVM/chain/OVM_StateCommitmentChain.sol 87.50% <ø> (ø)
...cts/optimistic-ethereum/OVM/predeploys/OVM_ETH.sol 0.00% <0.00%> (ø)
...eum/OVM/predeploys/OVM_ExecutionManagerWrapper.sol 0.00% <0.00%> (ø)
...thereum/OVM/predeploys/OVM_L2ToL1MessagePasser.sol 100.00% <ø> (ø)
...thereum/OVM/predeploys/OVM_SequencerEntrypoint.sol 100.00% <ø> (+100.00%) ⬆️
...libraries/wrappers/Lib_ExecutionManagerWrapper.sol 62.50% <54.54%> (+62.50%) ⬆️
...ic-ethereum/OVM/execution/OVM_ExecutionManager.sol 74.85% <79.48%> (+0.33%) ⬆️
...VM/bridge/messaging/OVM_L2CrossDomainMessenger.sol 96.77% <90.90%> (-3.23%) ⬇️
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 42decb6...6ad1dcb. Read the comment docs.

K-Ho and others added 2 commits June 10, 2021 23:12
… (rebased) (#1065)

* feat[contracts]: better account funding for hardhat accounts

* add a sleep to avoid any potential problems

* chore: add changeset

* fix: bug with gas estimation in funding step

* fix: limit to 20 accounts max

Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
@github-actions github-actions bot added the A-ci label Jun 11, 2021
elenadimitrova and others added 10 commits June 11, 2021 21:25
* Remove abstract token gateway and deposited token implementations

* Further simplification of bridge contracts

* Standart token bridge and L2 token implementation

* Fix spacing

* Implement case when a bad deposit happens to a nonexistent L1<>L2 token pair

* Use SafeMath in common token bridge accounting

* test(contracts): fix finalizeWithdrawal test

* fix(contracts): use SafeERC20 on token deposits

* Rename OVM_L1ERC20Gateway to OVM_L1ERC20Bridge contract

* Rename iOVM_L1ERC20Gateway to iOVM_L1ERC20Bridge contract

* Cleanup gateway to bridge rename

* Better name for the mapping holding l1->l2 deposit amounts

* Use OZ SafeMath

* Rename local variables in OVM_L2DepositedERC20 from gateway to bridge

* Merge ETH and ERC20 bridge contracts

* Rename OVM_L1ERC20Bridge to OVM_L1StandardBridge and fix tests from merging the ETH and ERC20 bridges

* Better name for iAbs_BaseCrossDomainMessenger -> iOVM_CrossDomainMessenger

* Correct the bounce back of deposit sender and recipient properties

* Remove obsoleted event from OVM_L2DepositedERC20

* chore(contracts): change references from ETHGateway to Bridge

* Fix a linting error

* fix(contracts): add bridge to deployer

* Split off ERC20Bridge interface for the purposes
of being reused in custom ERC20 bridges

* Split off interface natspec definitions

* Draft version of OVM_L2DepositedERC20 splitted into a standard L2 erc20: L2StandardERC20 and
a common L2 bridge: OVM_L2StandardBridge

* style(contracts): define L1_ETH_ADDRESS as constant

* test(integration): update interface to use depositETH

* test(contracts): fix OVM_L1StandardBridge tests

* test(contracts): fix L2 Standard Bridge tests

* test(contracts): lint and remove an obsolete test case

* Fix modifier check to comply with the L2 bridge distinction from L2 token

* Simplify address <> interface casting in bridges

* Ensure natspec comments are correct
also add l1 and l2 token params to WithdrawalInitiated event for consistency

* Fix issues in L1 and L2 bridges to ensure
cross domain messages are sent only between the two bridges
also adjusted withdrawals to send to either finalizeETHWithdrawal or finalizeERC20Withdrawal
depending on which asset is being withdrawn

* Remove AddressManager from the L1 standard bridge

* REVERT ME: instruments cross domain enabled

* fix(contracts): remove Address Manager from L1 Bridge

* feat(contracts): make L2 Standard Bridge a predeploy

* WIP: update deployments for standard bridges

* WIP: update deployments for standard bridges

* l2geth: TEMP log contract calls

* chore(l2geth): replace eth gateway with standard bridge

* fix(contracts): make contract-deployment/config work

* WIP fix(integration): update integration tests for bridge

* Remove ovmEth from L1 Standard bridge as obsoleted

* Separate ERC20 standard implementation from L2 bridge

* Formatting fixes

* chore(l2geth): replace eth gateway with standard bridge

* Revert "REVERT ME: instruments cross domain enabled"

This reverts commit d5bb8f8.

* fix: lint ts

* Implement EIP-165 in the Standard L2 ERC20 token
Also switch that to be based off the OpenZeppelin default implementation plus mint and burn
Additionally remove the obsoleted iOVM_ERC20

* fix(contracts): add deployment check on bridge proxy
fix(contracts): whitespace
fix(contracts): init bridge implementation with non-zero address

* Remove dependency on Ownable contract for the StandardERC20 token on L2

* fix(contracts): update deployment scripts

* fix: lint

* remove debugging code

* fix: correct rpc get balance slot

* restore l2 cross domain messenger

* fix: lint

* Add a test for a non compliant token deposit

* Only allow EOAs to deposit ETH and ERC20

* Add comments and tests for ERC165 implementation

* Decide against using explicit ETH MOCK address as we're not using it for checks

* Fix linting issues

* Add onlyEOAContract restriction to standard bridge withdrawals

* Update codehashes in L2 Standard bridge

* fix(ops): remove unintentionally added file

* feat(contracts): add expectApproxGasCost function

* fix(integration): proper arrayify input on fundUser

* fix(integration): proper gas value checks

* Revert "Add onlyEOAContract restriction to standard bridge withdrawals"

This reverts commit 2713c06ceb2609e4f13718e1034a4d76210d9758.

* fix(contracts): removed unused expectApproxGasCost for now

* fix(contracts): update OVM_SequencerFeeVault for bridge changes

* lint

* Update deployment for L1 Bridge w/ ChugSplash

* Revert "l2geth: TEMP log contract calls"

This reverts commit 21d42259278449f221bf34605162229b3d9d4fa9.

* Apply suggestions from code review

* Apply suggestions from code review

* fix(contracts): deploy with chugsplash proxy

* fix(contracts): add working bridge and chugsplash proxy deployment

* fix(contracts,integration): 500k gas for depositETH

* comment(contracts): describe failed deposit handling on l2

* Apply suggestions from code review

Co-authored-by: ben-chain <ben@pseudonym.party>

* docs: add changeset

* fix(integration): set working l2 gas amount on funduser

* test(integration): add receive() test

* fix(contracts): reset receive to 1.2MM l2 gas

* test(examples): skip l1-l2 example test for now

* fix(contracts): drop hardcoded gas to 500k in receive()

* fix(contracts): use abi.encodeWithSignature

* fix(contracts): resolve merge conflicts

* feat(integration): add expectApprox for flexible gas testing

* fix(integration): fix failing gas tests

* fix: incorrect l2 gas for deposit

* Update utils.ts

* fix(workflow): disable l1-l2 example until npm imports are fixed

* chore: final round of PR review nits and tests

Co-authored-by: Maurelian <maurelian@protonmail.ch>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: ben-chain <ben@pseudonym.party>
Co-authored-by: Kelvin Fichter <kelvinfichter@gmail.com>
* fix: use predeploy constant lib for em wrapper

* chore: add changeset
* refactor[contracts]: move account contracts to predeploy folder

* chore: add changeset
* feat(contracts): add no-op WETH9 functionality to OVM_ETH

* working WETH deposit and withdraw + tests

* add changeset

* address PR feedback

* update WETH9 contract implementation

* add fallback to WETH9

* add fallback and revert withdraw test

* update nit comment

Co-authored-by: ben <ben@pseudonym.party>
* refactor[contracts]: move account interface to predeploy folder

* chore: add changeset
* ci: fix custom docker tag

* ci: use new env file

* ci: use outputs from previous job

* ci: fix headers of jobs

* ci: inherit canary tag from builder
* deployments: goerli 0.4.0 rc

* readme: update

* chore: add changeset
* deploy: kovan v0.4.0 rc

* chore: add changeset

* readme: update
smartcontracts and others added 9 commits June 18, 2021 16:14
* fix[dtl]: use the same L2 chain ID everywhere

* chore: add changeset
* fix[dtl]: remove old stringification function

* chore: add changeset
* fix[dtl]: log server errors as ERROR instead of INFO

* chore: add changeset
* l2geth: prevent overflow in abi encoding to ovm codec tx

* chore: add changeset
* fix: correct import path for altered contract path

* chore: add changeset
* fix[contracts]: remove part of MultiMessageRelayer deployment

* chore: add changeset
@snario snario marked this pull request as ready for review June 22, 2021 19:34
@snario snario merged commit f434379 into develop Jun 22, 2021
@snario snario deleted the regenesis/0.4.0 branch June 22, 2021 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-batcher Area: op-batcher A-ops Area: ops A-pkg-core-utils Area: packages/core-utils
Projects
None yet
Development

Successfully merging this pull request may close these issues.