-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat[contracts]: have hardhat-deploy register L1MultiMessageRelayer on mainnet #828
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@eth-optimism/contracts': patch | ||
| --- | ||
|
|
||
| Set L2MessageRelayer name to L1MultiMessageRelayer when deploying to mainnet |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import { DeployFunction } from 'hardhat-deploy/dist/types' | |
| import { | ||
| deployAndRegister, | ||
| getDeployedContract, | ||
| registerAddress, | ||
| } from '../src/hardhat-deploy-ethers' | ||
|
|
||
| const deployFn: DeployFunction = async (hre) => { | ||
|
|
@@ -18,6 +19,20 @@ const deployFn: DeployFunction = async (hre) => { | |
| name: 'OVM_L1MultiMessageRelayer', | ||
| args: [Lib_AddressManager.address], | ||
| }) | ||
|
|
||
| // OVM_L2MessageRelayer *must* be set to multi message relayer address on mainnet. | ||
| if (hre.network.name.includes('mainnet')) { | ||
| const OVM_L1MultiMessageRelayer = await getDeployedContract( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| hre, | ||
| 'OVM_L1MultiMessageRelayer' | ||
| ) | ||
|
|
||
| await registerAddress({ | ||
| hre, | ||
| name: 'OVM_L2MessageRelayer', | ||
| address: OVM_L1MultiMessageRelayer.address | ||
| }) | ||
karlfloersch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| deployFn.dependencies = ['Lib_AddressManager'] | ||
|
|
||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
mainnetwould be only a substring ofhre.network.name, and we would still want to trigger this condition?There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍