Skip to content

Bold upgrade improvements #134

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boldupgrader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM node:20-bookworm-slim
RUN apt-get update && \
apt-get install -y git docker.io python3 make gcc g++ curl jq
ARG BOLD_CONTRACTS_BRANCH=bold-merge-script
ARG BOLD_CONTRACTS_BRANCH=main
WORKDIR /workspace
RUN git clone --no-checkout https://github.com/OffchainLabs/nitro-contracts.git ./
RUN git checkout ${BOLD_CONTRACTS_BRANCH}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ services:
args:
BOLD_CONTRACTS_BRANCH: ${BOLD_CONTRACTS_BRANCH:-}
environment:
- L1_RPC_URL=http://geth:8545
- CUSTOM_RPC_URL=http://geth:8545
- L1_PRIV_KEY=0xdc04c5399f82306ec4b4d654a342f40e2e0620fe39950d967e1e574b32d4dd36
- CONFIG_NETWORK_NAME=local
- DEPLOYED_CONTRACTS_DIR=./scripts/files/
Expand Down
21 changes: 16 additions & 5 deletions test-node.bash
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ BLOCKSCOUT_VERSION=offchainlabs/blockscout:v1.1.0-0e716c8
DEFAULT_NITRO_CONTRACTS_VERSION="v2.1.1-beta.0"
DEFAULT_TOKEN_BRIDGE_VERSION="v1.2.2"

# The is the latest bold-merge commit in nitro-contracts at the time
DEFAULT_BOLD_CONTRACTS_VERSION="42d80e40"
# The is the latest bold-upgrade-qol-improvements commit in nitro-contracts at the time
DEFAULT_BOLD_CONTRACTS_VERSION="9016cf1c"

# Set default versions if not overriden by provided env vars
: ${NITRO_CONTRACTS_BRANCH:=$DEFAULT_NITRO_CONTRACTS_VERSION}
Expand Down Expand Up @@ -587,15 +587,26 @@ if $force_init; then
stakeTokenAddress=`docker compose run scripts create-weth --deployer l2owner --deposit 100 | tail -n 1 | awk '{ print $NF }'`
echo BOLD stake token address: $stakeTokenAddress
docker compose run scripts transfer-erc20 --token $stakeTokenAddress --l1 --amount 100 --from l2owner --to validator

echo == Deploying v3.1 templates
docker compose run -e DEPLOYER_PRIVKEY=$l2ownerKey -e MAX_DATA_SIZE=117964 boldupgrader deploy-factory --network custom

echo == Preparing BOLD upgrade
docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-prepare
docker compose run boldupgrader script:bold-prepare --network custom
# retry this 10 times because the staker might not have made a node yet
for i in {1..10}; do
docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-populate-lookup && break || true
docker compose run boldupgrader script:bold-populate-lookup --network custom && break || true
echo "Failed to populate lookup table, retrying..."
sleep 10
done
docker compose run -e TESTNODE_MODE=true -e ROLLUP_ADDRESS=$rollupAddress -e STAKE_TOKEN=$stakeTokenAddress boldupgrader script:bold-local-execute
docker compose run boldupgrader script:bold-local-execute --network custom

echo == Update new configuration
docker compose run --entrypoint sh rollupcreator -c "jq '.[].rollup.rollup = \"0xa134abA9268643057091b15f99eb32D0D526190f\" | .[].rollup.\"stake-token\" = \"0x43C9c3Ab961c49f8d42227628617747b1da7bcF0\"' /config/l2_chain_info.json > /config/l2_chain_info_temp.json && mv /config/l2_chain_info_temp.json /config/l2_chain_info.json"
docker compose run --entrypoint sh rollupcreator -c "jq '.node.bold.enable = true | .node.bold.strategy = \"MakeNodes\" | .node.bold.\"rpc-block-number\" = \"latest\"' /config/sequencer_config.json > /config/sequencer_config_temp.json && mv /config/sequencer_config_temp.json /config/sequencer_config.json"

echo == Restart nodes
docker compose restart $INITIAL_SEQ_NODES
fi

if $l3node; then
Expand Down