Skip to content
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

Nitro testnode migration test #207

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@
[submodule "arbitrator/langs/bf"]
path = arbitrator/langs/bf
url = https://github.com/OffchainLabs/stylus-sdk-bf.git
[submodule "orbit-actions"]
path = orbit-actions
url = git@github.com:EspressoSystems/orbit-actions.git
branch = espresso-migration
22 changes: 22 additions & 0 deletions migration/create-espresso-integrated-nitro-node.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

ESPRESSO_VERSION=ghcr.io/espressosystems/nitro-espresso-integration/nitro-node-dev:integration
lightClientAddr=0xb6eb235fa509e3206f959761d11e3777e16d0e98
espresso=true

cd ../nitro-testnode

# docker pull and tag the espresso integration nitro node.
docker pull $ESPRESSO_VERSION

docker tag $ESPRESSO_VERSION espresso-integration-testnode

# write the espresso configs to the config volume
echo == Writing configs
docker compose run scripts write-config --espresso $espresso --lightClientAddress $lightClientAddr

# do whatever other espresso setup is needed.

# run esprsso-integrated nitro node for sequencing.
docker compose up espresso-sequencer --detach
31 changes: 31 additions & 0 deletions migration/migration-test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail

#enter the testnode directory
cd ../nitro-testnode

#Initialize a standard network not compatible with espresso
./test-node.bash --simple --init --detach

#start espresso sequencer node
docker compose up espresso-dev-node --detach

#shutdown nitro node'
docker stop nitro-testnode-sequencer-1
# return to the migration directory to execute the script for starting an espresso-integrated nitro node
cd ../migration

#start nitro node in new docker container with espresso image (create a new script to do this from pieces of test-node.bash)
./create-espresso-integrated-nitro-node.bash

#source env files needed by forge
source /test-env/.env

#forge script to deploy new OSP entry and upgrade actions
export NEW_OSP_ENTRY=`forge script --chain $CHAIN_NAME ../orbit-actions/contracts/parent-chain/contract-upgrades/DeployEspressoOsp.s.sol:DeployEspressoOsp --rpc-url $RPC_URL --broadcast --verify -vvvv | tail -n 1 | tr -d '\r\n'` # save ospentryaddr here to propegate to next part of script.
#forge script to execute upgrade actions
forge script --chain $CHAIN_NAME ../orbit-actions/contracts/parent-chain/contract-upgrades/DeployAndExecuteEspressoMigrationActions.s.sol --rpc-url $RPC_URL --broadcast --verify -vvvv
#check the upgrade happened


#./test-node.bash --espresso --latest-espresso-image --validate --tokenbridge --init --detach
13 changes: 13 additions & 0 deletions migration/test-env/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# env vars for chain name and rpc_url
export CHAIN_NAME="1337"
export RPC_URL="http://localhost:8545"
# env vars for new OSP deployment
export HOTSHOT_ADDRESS=""
# env vars for osp migration action contract
export NEW_WASM_MODULE_ROOT="0x43683fe4e619e9ee7c0d959259d10ff2a38f4325a2b8936c47d9162704fe072a"
export CURRENT_OSP_ENTRY="0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97"
export CURRENT_WASM_MODULE_ROOT="0xbc1026ff45c20ea97e9e6057224a5668ea78d8f885c9b14fc849238e8ef5c5dc"
export ROLLUP_ADDRESS="0xF2099c4783921f44Ac988B67e743DAeFd4A00efd"
export PROXY_ADMIN="0x94e2090Fb86906C799A67263e6beAe528b81B3D6"
# env vars for ArbOS upgrade action.
export UPGRADE_TIMESTAMP="1723664126"
1 change: 1 addition & 0 deletions orbit-actions
Submodule orbit-actions added at 261b14
Loading