-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add deploycontracts flag #1235
Add deploycontracts flag #1235
Conversation
✅ Deploy Preview for nitrodocs canceled.
|
30803b3
to
307d251
Compare
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.
LGTM.
I'm wondering if we can push some of this code down into the chain service, to keep main.go
nice and lean?
@@ -60,7 +60,7 @@ const config: HardhatUserConfig & {watcher: any} = { | |||
}, | |||
networks: { | |||
hardhat: { | |||
chainId: 31337, | |||
chainId: 1337, |
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.
Do we require / assume this chainId
in go-nitro somewhere?
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.
Yup, most of our tests and the RPC server use a chainid of 1337. The RPC server should probably accept a chain id instead of using a hardcoded one.
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.
Updated to accept a chain argument in fe77830. If none is provided we use 1337
What happens if multiple nodes try to all deploy the adjudicator contract? The check for nonzero bytecode will fail if another node has submitted a tx to deploy the adjudicator, but that tx has not yet been mined. I haven't yet found a definitive source, but it appears that a second deploy tx will not revert ethereum/go-ethereum#17881 . I'm not sure if we want to change any of our code to exploit that...probably not. |
b1a7d94
to
fe77830
Compare
Good idea, done in bb3962e |
Adds a
deploycontracts
flag to the RPC server that determines whether the RPC deploys the Create2Deployer and Nitro Adjudicator. This allows the RPC server to work against any chain JSON-RPC node instead of relying on hardhat docker.