Skip to content

Comments

feat[contracts]: have hardhat-deploy register L1MultiMessageRelayer on mainnet#828

Merged
smartcontracts merged 4 commits intomasterfrom
kelvin/deploy-multi-relayer
May 10, 2021
Merged

feat[contracts]: have hardhat-deploy register L1MultiMessageRelayer on mainnet#828
smartcontracts merged 4 commits intomasterfrom
kelvin/deploy-multi-relayer

Conversation

@smartcontracts
Copy link
Contributor

Description
Slightly modifies our deployment so that we'll set OVM_L2MessageRelayer = L1MultiMessageRelayer.address on mainnet.

@changeset-bot
Copy link

changeset-bot bot commented May 10, 2021

🦋 Changeset detected

Latest commit: 15351ff

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

This PR includes changesets to release 1 package
Name Type
@eth-optimism/contracts 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

@karlfloersch
Copy link
Contributor

@ben-chain @K-Ho @tynes -- We need to merge this before we perform the mainnet regenesis to make sure that the message relayer is set on L1.

Copy link
Contributor

@karlfloersch karlfloersch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM but we should] make sure others see this (tagged some folks) & give an approval before it's merged

})

// OVM_L2MessageRelayer *must* be set to multi message relayer address on mainnet.
if (hre.network.name.includes('mainnet')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed with @smartcontracts how best to only enable this for mainnet & we settled on this approach. Feedback welcome

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine but I'll pose the obvious devil's advocate: Are there situations where mainnet would be only a substring of hre.network.name, and we would still want to trigger this condition?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me as it will target one of many possible mainnet deployments at the same time

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, thinking about it more, it is probably the case that we want to trigger this logic as much as we possibly can, because the downside of not triggering it when we do want to is much greated than the downside of triggering it when we do not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, didn't see @tynes ' comment when I followed up, but sounds good 👍

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2021

Codecov Report

Merging #828 (15351ff) into master (6dc453f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #828   +/-   ##
=======================================
  Coverage   80.66%   80.66%           
=======================================
  Files          48       48           
  Lines        1903     1903           
  Branches      302      302           
=======================================
  Hits         1535     1535           
  Misses        368      368           

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 6dc453f...15351ff. Read the comment docs.

@tynes
Copy link
Contributor

tynes commented May 10, 2021

So the assumption is that OVM_L2MessageRelayer will only be set on a mainnet deployment so on all other networks it will default to address(0) which means that authentication is off by default. Ideally there is an optional CLI flag that will be passed that accepts an address and sets OVM_L2MessageRelayer to that address. This will help to automate the process of setting that address for when we deploy our next testnet


// OVM_L2MessageRelayer *must* be set to multi message relayer address on mainnet.
if (hre.network.name.includes('mainnet')) {
const OVM_L1MultiMessageRelayer = await getDeployedContract(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this method throw if the given string is not set in the address manager? We should make sure we explicitly avoid a situation where we end up calling setAddress, but the input is still 0x00..., so if it does not, we should add the check here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function doesn't pull from the address manager -- it pulls from the local list of known/deployed contracts managed by hardhat-deploy. Will throw if the given contract name does not exist.

Copy link
Collaborator

@ben-chain ben-chain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, left individual comments by accident instead of within a review. I have a couple small questions which I want to make sure are addressed explicitly before I approve but I think this is probably good to go.

@ben-chain
Copy link
Collaborator

Ideally there is an optional CLI flag that will be passed that accepts an address and sets OVM_L2MessageRelayer to that address. This will help to automate the process of setting that address for when we deploy our next testnet

I'm not sure if it's that straightforward, since the address we want OVM_L2MessageRelayer to be set to is a contract which is yet to be deployed at configuration time. With L1 Chugsplash deployments I think a straightforward solution will present itself, or otherwise we will have eliminated the authentication by then anyway in favor of #579.

@smartcontracts smartcontracts merged commit 20747fd into master May 10, 2021
@smartcontracts smartcontracts deleted the kelvin/deploy-multi-relayer branch May 10, 2021 19:30
@tynes
Copy link
Contributor

tynes commented May 10, 2021

I'm not sure if it's that straightforward, since the address we want OVM_L2MessageRelayer to be set to is a contract which is yet to be deployed at configuration time

Right now on kovan the OVM_L2MessageRelayer is an EOA - we know that EOA up front and should be able to set it as part of the deployment. Hardhat deploy also lets you reference contracts that were previously deployed as part of hre

InoMurko pushed a commit to omgnetwork/optimism that referenced this pull request May 25, 2021
…n mainnet (ethereum-optimism#828)

* feat[contracts]: have deploy register multi message relayer on L1

* chore: add changeset

* fix: minor typo in comment

* fix: remove unnecessary changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-feature Category: features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants