Skip to content

Commit

Permalink
two separate folders
Browse files Browse the repository at this point in the history
  • Loading branch information
cody-wang-cb committed Sep 11, 2024
1 parent f218668 commit ca7fe58
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 19 deletions.
7 changes: 7 additions & 0 deletions sepolia/2024-09-11-deploy-new-PDG/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
OP_COMMIT=a81de910dc2fd9b2f67ee946466f2de70d62611a
BASE_CONTRACTS_COMMIT=5d98dab6a4f3ba60713a17417a2df7a17d77c52f

# Proposer
PERMISSIONED_DISPUTE_GAME=0xCCEfe451048Eaa7df8D0d709bE3AA30d565694D2
OLD_PROPOSER=0x20044a0d104E9e788A0C984A2B7eAe615afD046b
NEW_PROPOSER=0x037637067c1dbe6d2430616d8f54cb774daa5999
12 changes: 12 additions & 0 deletions sepolia/2024-09-11-deploy-new-PDG/Makefile
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions sepolia/2024-09-11-deploy-new-PDG/README.md
Original file line number Diff line number Diff line change
@@ -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: <SOME ADDRESS>
New proposer: 0x037637067c1DbE6d2430616d8f54Cb774Daa5999
```
20 changes: 20 additions & 0 deletions sepolia/2024-09-11-deploy-new-PDG/foundry.toml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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" -- \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -91,7 +82,7 @@ After: 0x00000000000000000000000000000000000000000000000000000000000000008
```
Key: 0x4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e
Before: 0x000000000000000000000000ccefe451048eaa7df8d0d709be3aa30d565694d2
After: 0x000000000000000000000000c7f2cf4845c6db0e1a1e91ed41bcd0fcc1b0e141
After: 0x000000000000000000000000<NEW PERMISSIONED GAME ADDRESS>
```

#### 3.3. Extract the domain hash and the message hash to approve.
Expand Down Expand Up @@ -211,7 +202,7 @@ After: 0x00000000000000000000000000000000000000000000000000000000000000009

```
Key: 0x4d5a9bd2e41301728d41c8e705190becb4e74abe869f75bdb405b63716a35f9e
Before: 0x000000000000000000000000c7f2cf4845c6db0e1a1e91ed41bcd0fcc1b0e141
Before: 0x000000000000000000000000<NEW PERMISSIONED GAME ADDRESS>
After: 0x000000000000000000000000ccefe451048eaa7df8d0d709be3aa30d565694d2
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ca7fe58

Please sign in to comment.