-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
op-contracts: Add script to upgrade from 1.8.0 L2OO to 1.8.0 permissioned. #13315
Open
ajsutton
wants to merge
19
commits into
proposal/op-contracts/v1.8.0
Choose a base branch
from
aj/holocene-permissioned-upgrade
base: proposal/op-contracts/v1.8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,701
−0
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
aff4224
Add first pass at v1.8.0 l200 -> permissioned upgrade script
ajsutton 17e67cb
Deploy new mips.
ajsutton 459d324
Load all contract implementation addresses from the latest contracts …
ajsutton 27bf014
Reuse existing Mips deployment.
ajsutton 119a14b
Add MIPS address to standard-addresses.json
ajsutton 67fae3a
Fix shellcheck warnings.
ajsutton 9e9e090
Fix more shellcheck warnings.
ajsutton 0a434ad
Fix forge fmt and print errors to stderr.
ajsutton 1dacbca
Pass contracts-version as an arg when building docker image.
ajsutton c157b9b
Preserve gas paying token in SystemConfig
ajsutton 5fe98a0
Remove incorrect comma.
ajsutton bb3bca0
Fix SystemConfig.initialize types
ajsutton 4ef629e
More initialize adjustments.
ajsutton ec09713
deploy-script: Verify permissioned game impl is set correctly.
ajsutton b7047b3
Add readme that links to runbook.
ajsutton d777742
Skip re-initializing the SystemConfig.
ajsutton c9db20b
Add note that SystemConfig version may not be changed if already runn…
ajsutton 92155c9
Do not expect SystemConfig impl address to change.
ajsutton 6679829
Remove unused variable.
ajsutton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/.env.example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
############################################## | ||
# ↓ Required ↓ # | ||
############################################## | ||
|
||
# Can be "mainnet" or "sepolia" | ||
NETWORK= | ||
|
||
# Etherscan API key used to verify contract bytecode | ||
ETHERSCAN_API_KEY= | ||
|
||
# RPC URL for the L1 network that matches $NETWORK | ||
ETH_RPC_URL= | ||
|
||
# Private key used to deploy the new contracts for this upgrade | ||
PRIVATE_KEY= |
1 change: 1 addition & 0 deletions
1
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
410 changes: 410 additions & 0 deletions
410
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/DeployUpgrade.s.sol
Large diffs are not rendered by default.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Use a base image with necessary tools | ||
FROM ubuntu:20.04 | ||
|
||
ARG REV | ||
ARG RELEASE=op-contracts/v$REV | ||
|
||
# Install required packages | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
bash \ | ||
curl \ | ||
build-essential \ | ||
jq \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:${PATH}" | ||
|
||
# Install just | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin | ||
|
||
# Install foundryup | ||
RUN curl -L https://foundry.paradigm.xyz | bash | ||
ENV PATH="/root/.foundry/bin:${PATH}" | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Clone the repository at the target branch | ||
RUN git clone -b $RELEASE https://github.com/ethereum-optimism/optimism.git . | ||
|
||
# Set the working directory to the root of the monorepo | ||
WORKDIR /app | ||
|
||
# Install correct foundry version | ||
RUN just update-foundry | ||
|
||
# Set the working directory to the root of the contracts package | ||
WORKDIR /app/packages/contracts-bedrock | ||
|
||
# Install dependencies | ||
RUN just install | ||
|
||
# Build the contracts package | ||
RUN just prebuild forge-build | ||
|
||
COPY . ./scripts/upgrades/v1.8.0-permissioned | ||
|
||
# Deliberately run the upgrade script with invalid args to trigger a build | ||
RUN forge script ./scripts/upgrades/v1.8.0-permissioned/DeployUpgrade.s.sol || true | ||
|
||
# Set the working directory to where upgrade.sh is located | ||
WORKDIR /app/packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned | ||
|
||
ENV CONTRACTS_VERSION=$REV | ||
|
||
# Set the entrypoint to the main.sh script | ||
ENTRYPOINT ["./scripts/main.sh"] |
15 changes: 15 additions & 0 deletions
15
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# v1.8.0 L2OO to Permissioned Fault Proofs Upgrader | ||
|
||
This directory contains a repeatable task for upgrading a chain running `op-contracts/v1.8.0` in L2OO configuration | ||
to `op-contracts/v1.8.0` in permissioned fault proofs configuration. | ||
|
||
## Dependencies | ||
|
||
- [`docker`](https://docs.docker.com/engine/install/) | ||
- [`just`](https://github.com/casey/just) | ||
- [`foundry`](https://getfoundry.sh/) | ||
|
||
## Usage | ||
|
||
For full instructions, including the required preparation and infrastructure changes to perform this upgrade, refer to | ||
the [full runbook](https://github.com/ethereum-optimism/superchain-ops/blob/a8a3f2a1aeda8d916081be3f4e2a8526286faa4d/runbooks/1.8.0-l2oo-to-permissioned-fps.md). | ||
30 changes: 30 additions & 0 deletions
30
packages/contracts-bedrock/scripts/upgrades/v1.8.0-permissioned/justfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Default recipe to list help menu. | ||
default: | ||
@just --list | ||
|
||
# Run the deployment / upgrade generation image. If the image is not present locally, | ||
# it will be built. | ||
run deploy-config-path deployment-path output-folder-path="$(pwd)/output/" *args='': | ||
#!/bin/bash | ||
if [ ! "$(docker images -q op-v1.8.0-permissioned:local 2> /dev/null)" ]; then | ||
just build-image | ||
fi | ||
|
||
mkdir -p {{output-folder-path}} | ||
|
||
# Run the deployment. | ||
docker run -it \ | ||
--rm \ | ||
-v $(realpath {{output-folder-path}}):/outputs \ | ||
-v $(realpath {{deploy-config-path}}):/deploy_config.json \ | ||
-v $(realpath {{deployment-path}}):/deployment.json \ | ||
--env-file=.env \ | ||
op-v1.8.0-permissioned:local /deploy_config.json /deployment.json {{args}} | ||
|
||
# Build the image locally. | ||
build-image contracts-version="1.8.0": | ||
docker build \ | ||
-t op-v1.8.0-permissioned:local \ | ||
-f Dockerfile \ | ||
--build-arg REV={{contracts-version}} \ | ||
. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We'll need to update this link one the runbook is merged.