-
Notifications
You must be signed in to change notification settings - Fork 22
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 deployment + management scripts #140
Conversation
contracts/script/Manage.s.sol
Outdated
console2.log("Using RiscZeroVerifierRouter at address", address(verifierRouter)); | ||
|
||
// Deploy new contracts | ||
RiscZeroGroth16Verifier verifier = |
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.
Note: I need RiscZeroGroth16Verifier
here. I'd rather use IRiscZeroVerifier
, but I need access to the verifier's SELECTOR
field. Do we want to add the notion of "selector" to the interface?
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.
I didn't because it's not 1:1 in general. A router, for instance, has 0 or more selectors.
contracts/script/Manage.s.sol
Outdated
RiscZeroVerifierEmergencyStop verifierEstop = RiscZeroVerifierEmergencyStop(vm.envAddress("VERIFIER_ESTOP")); | ||
console2.log("Using RiscZeroVerifierEmergencyStop at address", address(verifierEstop)); | ||
|
||
RiscZeroGroth16Verifier verifier = RiscZeroGroth16Verifier(address(verifierEstop.verifier())); |
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.
Another instance of https://github.com/risc0/risc0-ethereum/pull/140/files#r1628862984
contracts/script/README.md
Outdated
scheduleDelay: 1 | ||
``` | ||
|
||
Save the e-stop contract address: |
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 you have thoughts on where we save these addresses more durably?
contracts/script/manage
Outdated
# Run forge via fireblocks | ||
fireblocks-json-rpc --http -- \ | ||
forge script ${SCRIPT_FILE}:${SCRIPT_FUNCTION} \ | ||
--slow --broadcast --unlocked ${FORGE_DEPLOY_FLAGS} \ |
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.
It would be nice to make it easy to run a dry-run first. Maybe extracting --broadcast
to a flag on manage
would be good.
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.
Made a suggestion on this in #145
I walked through this and made a PR with some suggestions #145. I got through the commands listed in the README, up until "Grant access to the TimelockController" where I hit an error, and I've got to get going for the day. |
- rename DeployEstopVerifier and change vm.startBroadcast() and vm.broadcast() - move common functions to base contract - simulate scheduled calls to avoid finding out they'll fail later - add a codeblock language - add --broadcast flag - fix simulation, error on unset env var
I tested the PR and didn't hit any issues. My hypothesis: the Grant access to the TimelockController flow happens after the Update the TimelockController minimum delay flow. The latter updates the min scheduling delay to 10 seconds. Thus, if you try to execute the former quickly, you'll get a revert because 10 seconds hasn't elapsed. Just a guess though. I couldn't repro the issue, so I accepted the PR. |
Adds management scripts for the smart contracts.
Quick link to readme
Deployed to Sepolia: