Skip to content

Commit

Permalink
Fix deploy scripts for devnet allocs
Browse files Browse the repository at this point in the history
  • Loading branch information
pcw109550 committed Jun 10, 2024
1 parent a42440e commit 71cdef7
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
23 changes: 12 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ jobs:
- "packages/contracts-bedrock/tsconfig.build.tsbuildinfo"
- ".devnet/allocs-l1.json"
- ".devnet/allocs-l2.json"
- ".devnet/allocs-l2-delta.json"
- ".devnet/allocs-l2-delta.json"
- ".devnet/allocs-l2-ecotone.json"
- ".devnet/addresses.json"
- "packages/contracts-bedrock/deploy-config/devnetL1.json"
- "packages/contracts-bedrock/deployments/devnetL1"
Expand Down Expand Up @@ -247,23 +248,22 @@ jobs:
cp /tmp/workspace/.devnet/allocs-l1.json .devnet/allocs-l1.json
cp /tmp/workspace/.devnet/allocs-l2.json .devnet/allocs-l2.json
cp /tmp/workspace/.devnet/allocs-l2-delta.json .devnet/allocs-l2-delta.json
cp /tmp/workspace/.devnet/allocs-l2-ecotone.json .devnet/allocs-l2-ecotone.json
cp /tmp/workspace/.devnet/addresses.json .devnet/addresses.json
cp /tmp/workspace/packages/contracts-bedrock/deploy-config/devnetL1.json devnetL1.json
cp -r /tmp/workspace/packages/contracts-bedrock/deployments/devnetL1 devnetL1
working_directory: rvsol
- run:
name: Patch L1 Allocs
# allocs-l1.json has the form as # we need json as the form {"accounts": ... }
# We need value of "accounts" key for foundry loadAlloc method
command: jq .accounts .devnet/allocs-l1.json > allocs-l1-patched.json
name: Copy L1 Allocs
command: cp .devnet/allocs-l1.json allocs-l1.json
working_directory: rvsol
- run:
name: Generate allocs including asterisc
command: >
ASTERISC_PRESTATE=./prestate-proof.json
TARGET_L2_DEPLOYMENT_FILE=./devnetL1/.deploy
TARGET_L2_DEPLOY_CONFIG=./devnetL1.json
TARGET_L1_ALLOC=./allocs-l1-patched.json
TARGET_L1_ALLOC=./allocs-l1.json
DEPLOYMENT_OUTFILE=./deployments/devnetL1/.deploy
STATE_DUMP_PATH=./allocs-l1-asterisc.json
./scripts/create_poststate_after_deployment.sh
Expand All @@ -275,10 +275,9 @@ jobs:
jq -s '.[0] * .[1]' ./deployments/devnetL1/.deploy ./devnetL1/.deploy | tee .devnet-asterisc/addresses.json
working_directory: rvsol
- run:
name: Patch L1 Allocs
# we need json as the form {"accounts": ... } for op-e2e
name: Copy L1 Allocs
command: |
jq '{accounts: .}' ./allocs-l1-asterisc.json > .devnet-asterisc/allocs-l1.json
cp ./allocs-l1-asterisc.json .devnet-asterisc/allocs-l1.json
working_directory: rvsol
- run:
name: Patch .deploy
Expand All @@ -298,7 +297,8 @@ jobs:
name: Copy L2 Allocs
command: |
cp .devnet/allocs-l2.json .devnet-asterisc/allocs-l2.json
cp .devnet/allocs-l2-delta.json .devnet-asterisc/allocs-l2-delta.json
cp .devnet/allocs-l2-delta.json .devnet-asterisc/allocs-l2-delta.json
cp .devnet/allocs-l2-ecotone.json .devnet-asterisc/allocs-l2-ecotone.json
working_directory: rvsol
- persist_to_workspace:
root: rvsol
Expand Down Expand Up @@ -333,6 +333,7 @@ jobs:
cp /tmp/workspace/.devnet-asterisc/allocs-l1.json .devnet/allocs-l1.json
cp /tmp/workspace/.devnet-asterisc/allocs-l2.json .devnet/allocs-l2.json
cp /tmp/workspace/.devnet-asterisc/allocs-l2-delta.json .devnet/allocs-l2-delta.json
cp /tmp/workspace/.devnet-asterisc/allocs-l2-ecotone.json .devnet/allocs-l2-ecotone.json
cp /tmp/workspace/.devnet-asterisc/addresses.json .devnet/addresses.json
mkdir -p packages/contracts-bedrock
cp -r /tmp/workspace/packages/contracts-bedrock/deploy-config packages/contracts-bedrock
Expand All @@ -358,4 +359,4 @@ jobs:
path: /testlogs
when: always
- store_test_results:
path: /tmp/test-results
path: /tmp/test-results
3 changes: 2 additions & 1 deletion rvsol/scripts/create_poststate_after_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ set -eo pipefail

# Run at rvsol/

DEPLOY_PRIVATE_KEY="${DEPLOY_PRIVATE_KEY:-"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"}" # foundry pre-funded account #1
# foundry pre-funded account #4: gnosis safe's owner(0x90F79bf6EB2c4f870365E785982E1f101E93b906)
DEPLOY_PRIVATE_KEY="${DEPLOY_PRIVATE_KEY:-"0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6"}"
ASTERISC_PRESTATE="${ASTERISC_PRESTATE:-"/../rvgo/bin/prestate-proof.json"}"

if [ -z "${TARGET_L2_DEPLOYMENT_FILE}" ]; then
Expand Down
12 changes: 5 additions & 7 deletions rvsol/scripts/devnet_allocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,25 @@ mkdir -p packages/contracts-bedrock
cp -r ${MONOREPO_ROOT}/packages/contracts-bedrock/deploy-config packages/contracts-bedrock
mkdir -p packages/contracts-bedrock/deployments/devnetL1
cp -r ${MONOREPO_ROOT}/packages/contracts-bedrock/deployments/devnetL1 packages/contracts-bedrock/deployments
# Patch L1 Allocs
jq .accounts .devnet/allocs-l1.json > /tmp/allocs-l1-patched.json

# Generate L1 Allocs including asterisc
# copy everything locally due to foundry permission issues
cp ./rvgo/bin/prestate-proof.json ./rvsol/prestate-proof.json
cp -r packages/contracts-bedrock/deployments/devnetL1 ./rvsol/devnetL1
cp packages/contracts-bedrock/deploy-config/devnetL1.json ./rvsol/devnetL1.json
cp /tmp/allocs-l1-patched.json ./rvsol/allocs-l1-patched.json
cp .devnet/allocs-l1.json ./rvsol/allocs-l1.json
cd ./rvsol && ASTERISC_PRESTATE=./prestate-proof.json \
TARGET_L2_DEPLOYMENT_FILE=./devnetL1/.deploy \
TARGET_L2_DEPLOY_CONFIG=./devnetL1.json \
TARGET_L1_ALLOC=./allocs-l1-patched.json \
TARGET_L1_ALLOC=./allocs-l1.json \
DEPLOYMENT_OUTFILE=./deployments/devnetL1/.deploy \
STATE_DUMP_PATH=./allocs-l1-asterisc.json \
./scripts/create_poststate_after_deployment.sh
cd ..
# Create address.json
jq -s '.[0] * .[1]' ./rvsol/devnetL1/.deploy ./rvsol/deployments/devnetL1/.deploy | tee .devnet/addresses.json
# Patch L1 Allocs: we need json as the form {"accounts": ... } for op-e2e
jq '{accounts: .}' ./rvsol/allocs-l1-asterisc.json > .devnet/allocs-l1.json
cp ./rvsol/allocs-l1-asterisc.json .devnet/allocs-l1.json
# Patch .deploy
cp .devnet/addresses.json packages/contracts-bedrock/deployments/devnetL1/.deploy
# Remove tmps
cd rvsol && rm -rf prestate-proof.json devnetL1 devnetL1.json allocs-l1-patched.json deployments ./allocs-l1-asterisc.json
cd rvsol && rm -rf prestate-proof.json devnetL1 devnetL1.json allocs-l1.json deployments ./allocs-l1-asterisc.json

0 comments on commit 71cdef7

Please sign in to comment.