-
Notifications
You must be signed in to change notification settings - Fork 45
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
deploy: Delta production deployment scripts #631
Conversation
abfdc7b
to
fa54845
Compare
6fe1198
to
24ce428
Compare
24ce428
to
5346634
Compare
- Allows deploying proxy without registering them on controller - Fixes the names of the deployments that are saved/overridden - Deploying only the target will not set the "main" deployment file - Deploying with a proxy will not set the ManagerProxy deployment
The Governor already exposes an execute() function that will call the timelock (treasury) internally, so we don't need to expose the treasury directly to calls by anyone.
5346634
to
ff30c77
Compare
FTR I've created a fork on Tenderly and ran the deployment script over there to ensure the expected behavior:
Will follow-up later with simulating the governance script to register contracts on controller. |
It doesnt want registration so just call deploy()
Good to already have pre-tested scripts for the deployment steps.
@yondonfu FYI added 2 more utilities here:
LMK if you'd suggest anything, like including that "verify delta deployment" task in here as well or if its fine like this. Tomorrow I plan on merging this and running the contract deploys. Will ping you about how we should merge this into |
FTR this is the second fork I made, where I ran both the contract deploys and the governance actions: https://dashboard.tenderly.co/shared/fork/2f6f7f38-4c86-4b24-a165-2b535747ba26/transactions Unfortunately, controlling the block number of the fork is harder than I thought, so I couldn't advance the round to test treasury contribution. What I might do next is make a fork right at the beginning of a round, so I can initialize it myself after making the deploy. The code changes for that deploy is on this branch: vg/chore/delta-deployment...vg/fork-test-2 |
You should be able to control the block number using the evm_increaseBlocks Tenderly RPC call when connected to the fork JSON RPC URL. |
Yeah, I did do that and expected it to work, but it just stayed on the same block. I used this task and it has no effect no matter how many blocks I increase: import {task} from "hardhat/config"
import {ethers} from "ethers"
const BLOCK_PERIOD = 12 // seconds
task(
"evm-increase-blocks",
"Helper task to increase the block number in the current EVM"
)
.addOptionalPositionalParam(
"blocks",
"How many blocks to increase by (defaults to 1)"
)
.setAction(async (taskArgs, hre) => {
const {network} = hre
const provider = network.provider
const blocks = parseInt(taskArgs.blocks ?? "1")
await provider.send("evm_increaseBlocks", [
ethers.utils.hexValue(blocks) // hex encoded number of blocks to increase
])
// helpfully increase the time by 12s per block as well
await provider.send("evm_increaseTime", [
ethers.utils.hexValue(BLOCK_PERIOD * blocks) // hex encoded number of seconds
])
}) Maybe it is increasing the L2 block number instead of the observed L1 block number. Couldn't find any docs on increase L1 block number on an arbitrum fork instead. |
OK I managed to deploy an Was then able to adjust the block to the next round after deploy, initialize that round and run some reward calls observing the 10% of the rewards going to the treasury [1] :) All transactions inspectable on the fork here [2] and the corresponding code/deployment registry on that same branch [3] Pending now only updating the deploy docs here and merging the PR into [1] https://dashboard.tenderly.co/livepeer/livepeer/fork/2f6f7f38-4c86-4b24-a165-2b535747ba26/simulation/6b163c5d-9c29-46a4-9cbd-31a8ce446d87 |
Unintended close 😅 |
0174938
to
3534c23
Compare
Ah I think you're right that's probably what is happening. |
* hardhat: Fix .env files * hardhat: Migrate to newer etherscan verify plugin * tasks: Create task to verify all deployed contracts * doc: Add instructions on how to deploy to a network * deploy: Move treasury deploy to deploy_contracts * deploy: Update deployer to support delta deployment - Allows deploying proxy without registering them on controller - Fixes the names of the deployments that are saved/overridden - Deploying only the target will not set the "main" deployment file - Deploying with a proxy will not set the ManagerProxy deployment * deploy: Create delta deployment script * deploy: Allow only governor to execute treasury proposals The Governor already exposes an execute() function that will call the timelock (treasury) internally, so we don't need to expose the treasury directly to calls by anyone. * utils: Split deployAndRegister func from ContractDeployer * deploy,doc: Address other PR comments * deploy: Fix deploy_poll script It doesnt want registration so just call deploy() * tasks: Create task to renounce admin role post-deploy Good to already have pre-tested scripts for the deployment steps. * doc: Add docs on delta deploy steps * doc: Address comments on deploy steps doc
* hardhat: Fix .env files * hardhat: Migrate to newer etherscan verify plugin * tasks: Create task to verify all deployed contracts * doc: Add instructions on how to deploy to a network * deploy: Move treasury deploy to deploy_contracts * deploy: Update deployer to support delta deployment - Allows deploying proxy without registering them on controller - Fixes the names of the deployments that are saved/overridden - Deploying only the target will not set the "main" deployment file - Deploying with a proxy will not set the ManagerProxy deployment * deploy: Create delta deployment script * deploy: Allow only governor to execute treasury proposals The Governor already exposes an execute() function that will call the timelock (treasury) internally, so we don't need to expose the treasury directly to calls by anyone. * utils: Split deployAndRegister func from ContractDeployer * deploy,doc: Address other PR comments * deploy: Fix deploy_poll script It doesnt want registration so just call deploy() * tasks: Create task to renounce admin role post-deploy Good to already have pre-tested scripts for the deployment steps. * doc: Add docs on delta deploy steps * doc: Address comments on deploy steps doc
What does this pull request do? Explain your changes. (required)
This is to update and create deployment scripts in order to update Delta (LIP-91 and LIP-92)
to production.
Specific updates (required)
ContractDeployer
to support deploy-only (no register) modedeploy_audit.ts
script to update the contracts in question and print required governance commandsHow did you test each of these updates (required)
Does this pull request close any open issues?
Implements PRO-32
Checklist:
yarn test
pass