From ca7fe58ee63b5cda32d53be4912e6be9030a622f Mon Sep 17 00:00:00 2001 From: Cody Wang Date: Wed, 11 Sep 2024 13:04:34 -0400 Subject: [PATCH] two separate folders --- sepolia/2024-09-11-deploy-new-PDG/.env | 7 +++++++ sepolia/2024-09-11-deploy-new-PDG/Makefile | 12 +++++++++++ sepolia/2024-09-11-deploy-new-PDG/README.md | 20 +++++++++++++++++++ .../2024-09-11-deploy-new-PDG/foundry.toml | 20 +++++++++++++++++++ .../script/DeployNewPDG.s.sol | 1 - .../.env | 0 .../Makefile | 5 ----- .../README.md | 17 ++++------------ .../foundry.toml | 0 .../script/RollbackProposer.s.sol | 3 +++ .../script/UpdateProposer.s.sol | 0 11 files changed, 66 insertions(+), 19 deletions(-) create mode 100644 sepolia/2024-09-11-deploy-new-PDG/.env create mode 100644 sepolia/2024-09-11-deploy-new-PDG/Makefile create mode 100644 sepolia/2024-09-11-deploy-new-PDG/README.md create mode 100644 sepolia/2024-09-11-deploy-new-PDG/foundry.toml rename sepolia/{2024-09-09-update-proposer => 2024-09-11-deploy-new-PDG}/script/DeployNewPDG.s.sol (92%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/.env (100%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/Makefile (86%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/README.md (93%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/foundry.toml (100%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/script/RollbackProposer.s.sol (94%) rename sepolia/{2024-09-09-update-proposer => 2024-09-11-update-proposer}/script/UpdateProposer.s.sol (100%) diff --git a/sepolia/2024-09-11-deploy-new-PDG/.env b/sepolia/2024-09-11-deploy-new-PDG/.env new file mode 100644 index 0000000..777c7a4 --- /dev/null +++ b/sepolia/2024-09-11-deploy-new-PDG/.env @@ -0,0 +1,7 @@ +OP_COMMIT=a81de910dc2fd9b2f67ee946466f2de70d62611a +BASE_CONTRACTS_COMMIT=5d98dab6a4f3ba60713a17417a2df7a17d77c52f + +# Proposer +PERMISSIONED_DISPUTE_GAME=0xCCEfe451048Eaa7df8D0d709bE3AA30d565694D2 +OLD_PROPOSER=0x20044a0d104E9e788A0C984A2B7eAe615afD046b +NEW_PROPOSER=0x037637067c1dbe6d2430616d8f54cb774daa5999 diff --git a/sepolia/2024-09-11-deploy-new-PDG/Makefile b/sepolia/2024-09-11-deploy-new-PDG/Makefile new file mode 100644 index 0000000..352bc01 --- /dev/null +++ b/sepolia/2024-09-11-deploy-new-PDG/Makefile @@ -0,0 +1,12 @@ +include ../../Makefile +include ../.env +include .env + +ifndef LEDGER_ACCOUNT +override LEDGER_ACCOUNT = 1 # Sepolia using hd-path of 1 +endif + +# Proposer +.PHONY: execute-deploy-dispute-game +execute-deploy-dispute-game: + forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) DeployNewPDG diff --git a/sepolia/2024-09-11-deploy-new-PDG/README.md b/sepolia/2024-09-11-deploy-new-PDG/README.md new file mode 100644 index 0000000..f3eade4 --- /dev/null +++ b/sepolia/2024-09-11-deploy-new-PDG/README.md @@ -0,0 +1,20 @@ +# Deploy new PermissionedDisputeGame + +Status: ready to execute + +## Objective + +We are deploying a new `PermissionedDisputeGame` so that it has the new proposer address + +This runbook implements scripts which allow system owner to execute: +1. `DeployNewPDG` -- Deploys a new `PermissionedDisputeGame` with the new proposer address. + +The values we are sending are statically defined in the `.env`. + +## Deploy the new PDG +This step doesn't have to be done with multisig, we can use an EoA to deploy. We should see the following output from the console +``` +== Logs == + New permissioned dispute game address: + New proposer: 0x037637067c1DbE6d2430616d8f54Cb774Daa5999 +``` diff --git a/sepolia/2024-09-11-deploy-new-PDG/foundry.toml b/sepolia/2024-09-11-deploy-new-PDG/foundry.toml new file mode 100644 index 0000000..72c3224 --- /dev/null +++ b/sepolia/2024-09-11-deploy-new-PDG/foundry.toml @@ -0,0 +1,20 @@ +[profile.default] +src = 'src' +out = 'out' +libs = ['lib'] +broadcast = 'records' +fs_permissions = [ {access = "read-write", path = "./"} ] +optimizer = true +optimizer_runs = 999999 +solc_version = "0.8.15" +# via-ir = true +remappings = [ + '@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock/', + '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts', + '@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts', + '@rari-capital/solmate/=lib/solmate/', + '@base-contracts/=lib/base-contracts', + '@solady/=lib/solady/src/' +] + +# See more config options https://github.com/foundry-rs/foundry/tree/master/config \ No newline at end of file diff --git a/sepolia/2024-09-09-update-proposer/script/DeployNewPDG.s.sol b/sepolia/2024-09-11-deploy-new-PDG/script/DeployNewPDG.s.sol similarity index 92% rename from sepolia/2024-09-09-update-proposer/script/DeployNewPDG.s.sol rename to sepolia/2024-09-11-deploy-new-PDG/script/DeployNewPDG.s.sol index 64324aa..e1d243b 100644 --- a/sepolia/2024-09-09-update-proposer/script/DeployNewPDG.s.sol +++ b/sepolia/2024-09-11-deploy-new-PDG/script/DeployNewPDG.s.sol @@ -7,7 +7,6 @@ import "forge-std/Script.sol"; contract DeployNewPDG is Script { address internal NEW_PROPOSER = vm.envAddress("NEW_PROPOSER"); address internal PERMISSIONED_DISPUTE_GAME = vm.envAddress("PERMISSIONED_DISPUTE_GAME"); - address internal DISPUTE_GAME_FACTORY_PROXY_OWNER = vm.envAddress("DISPUTE_GAME_FACTORY_PROXY_OWNER"); function run() public { PermissionedDisputeGame pdg = PermissionedDisputeGame(PERMISSIONED_DISPUTE_GAME); diff --git a/sepolia/2024-09-09-update-proposer/.env b/sepolia/2024-09-11-update-proposer/.env similarity index 100% rename from sepolia/2024-09-09-update-proposer/.env rename to sepolia/2024-09-11-update-proposer/.env diff --git a/sepolia/2024-09-09-update-proposer/Makefile b/sepolia/2024-09-11-update-proposer/Makefile similarity index 86% rename from sepolia/2024-09-09-update-proposer/Makefile rename to sepolia/2024-09-11-update-proposer/Makefile index b3b7935..e0aa2ab 100644 --- a/sepolia/2024-09-09-update-proposer/Makefile +++ b/sepolia/2024-09-11-update-proposer/Makefile @@ -6,11 +6,6 @@ ifndef LEDGER_ACCOUNT override LEDGER_ACCOUNT = 1 # Sepolia using hd-path of 1 endif -# Proposer -.PHONY: execute-deploy-dispute-game -execute-deploy-dispute-game: - forge script --rpc-url $(L1_RPC_URL) --private-key $(PRIVATE_KEY) DeployNewPDG - .PHONY: sign-update-proposer sign-update-proposer: $(GOPATH)/bin/eip712sign --ledger --hd-paths "m/44'/60'/$(LEDGER_ACCOUNT)'/0/0" -- \ diff --git a/sepolia/2024-09-09-update-proposer/README.md b/sepolia/2024-09-11-update-proposer/README.md similarity index 93% rename from sepolia/2024-09-09-update-proposer/README.md rename to sepolia/2024-09-11-update-proposer/README.md index 67dcfdc..9f62783 100644 --- a/sepolia/2024-09-09-update-proposer/README.md +++ b/sepolia/2024-09-11-update-proposer/README.md @@ -7,20 +7,11 @@ Status: ready to execute We are updating proposer address for sepolia to a key that is managed by the internal key management service. This runbook implements scripts which allow system owner to execute: -1. `DeployNewPDG` -- Deploys a new `PermissionedDisputeGame` with the new proposer address. -2. `UpdateProposer` -- Upgrade `DisputeGameFactory` to have the new `PermissionedDisputeGame`. -3. `RollbackProposer` -- Rollback the `DisputeGame` upgrade. +1. `UpdateProposer` -- Upgrade `DisputeGameFactory` to have the new `PermissionedDisputeGame`. +2. `RollbackProposer` -- Rollback the `DisputeGame` upgrade. The values we are sending are statically defined in the `.env`. -## Deploy the new PDG -This step doesn't have to be done with multisig, we can use an EoA to deploy. We should see the following output from the console -``` -== Logs == - New permissioned dispute game address: 0xC7f2Cf4845C6db0e1a1e91ED41Bcd0FcC1b0E141 - New proposer: 0x037637067c1DbE6d2430616d8f54Cb774Daa5999 -``` - ## Approving the Update transaction ### 1. Update repo and move to the appropriate folder: @@ -91,7 +82,7 @@ After: 0x00000000000000000000000000000000000000000000000000000000000000008 ``` Key: 0x4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e Before: 0x000000000000000000000000ccefe451048eaa7df8d0d709be3aa30d565694d2 -After: 0x000000000000000000000000c7f2cf4845c6db0e1a1e91ed41bcd0fcc1b0e141 +After: 0x000000000000000000000000 ``` #### 3.3. Extract the domain hash and the message hash to approve. @@ -211,7 +202,7 @@ After: 0x00000000000000000000000000000000000000000000000000000000000000009 ``` Key: 0x4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e -Before: 0x000000000000000000000000c7f2cf4845c6db0e1a1e91ed41bcd0fcc1b0e141 +Before: 0x000000000000000000000000 After: 0x000000000000000000000000ccefe451048eaa7df8d0d709be3aa30d565694d2 ``` diff --git a/sepolia/2024-09-09-update-proposer/foundry.toml b/sepolia/2024-09-11-update-proposer/foundry.toml similarity index 100% rename from sepolia/2024-09-09-update-proposer/foundry.toml rename to sepolia/2024-09-11-update-proposer/foundry.toml diff --git a/sepolia/2024-09-09-update-proposer/script/RollbackProposer.s.sol b/sepolia/2024-09-11-update-proposer/script/RollbackProposer.s.sol similarity index 94% rename from sepolia/2024-09-09-update-proposer/script/RollbackProposer.s.sol rename to sepolia/2024-09-11-update-proposer/script/RollbackProposer.s.sol index 4ac844e..6e168ae 100644 --- a/sepolia/2024-09-09-update-proposer/script/RollbackProposer.s.sol +++ b/sepolia/2024-09-11-update-proposer/script/RollbackProposer.s.sol @@ -30,6 +30,9 @@ contract RollbackProposer is MultisigBuilder { } function _buildCalls() internal view override returns (IMulticall3.Call3[] memory) { + PermissionedDisputeGame newPdgImpl = PermissionedDisputeGame(PERMISSIONED_DISPUTE_GAME); + require(newPdgImpl.proposer() == OLD_PROPOSER, "Deploy: proposer is incorrect"); + IMulticall3.Call3[] memory calls = new IMulticall3.Call3[](1); calls[0] = IMulticall3.Call3({ target: DISPUTE_GAME_FACTORY_PROXY, diff --git a/sepolia/2024-09-09-update-proposer/script/UpdateProposer.s.sol b/sepolia/2024-09-11-update-proposer/script/UpdateProposer.s.sol similarity index 100% rename from sepolia/2024-09-09-update-proposer/script/UpdateProposer.s.sol rename to sepolia/2024-09-11-update-proposer/script/UpdateProposer.s.sol