From fb84e63ff0230e0dac53587edbad0b803d989ba1 Mon Sep 17 00:00:00 2001 From: Barry Date: Thu, 23 Oct 2025 14:19:01 +0800 Subject: [PATCH 1/8] update --- test-pp-op/4-migrate-op.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/test-pp-op/4-migrate-op.sh b/test-pp-op/4-migrate-op.sh index 53391e527c828..d73a44a93f387 100755 --- a/test-pp-op/4-migrate-op.sh +++ b/test-pp-op/4-migrate-op.sh @@ -149,13 +149,24 @@ migrate() { fi echo "GETH_CMD: $GETH_CMD" - ${GETH_CMD} --datadir=${OP_DATA_DIR} --gcmode=archive migrate --state.scheme=hash --ignore-addresses=0x000000000000000000000000000000005ca1ab1e --chaindata=${ERIGON_CHAINDATA_DIR} --smt-db-path=${ERIGON_SMTDATA_DIR} --output merged.genesis.json ${OP_GENESIS_PATH} 2>&1 | tee migrate.log + # Build the base command + MIGRATE_CMD="${GETH_CMD} --datadir=${OP_DATA_DIR} --gcmode=archive migrate --state.scheme=hash --ignore-addresses=0x000000000000000000000000000000005ca1ab1e --chaindata=${ERIGON_CHAINDATA_DIR} --smt-db-path=${ERIGON_SMTDATA_DIR} --output merged.genesis.json" - LOG_BLOCK=$(grep -A 5 "Update rollup.json file with the following information l2" migrate.log | tail -n 5) - L2_NUMBER=$(echo "$LOG_BLOCK" | grep '"number"' | sed 's/[^0-9]*\([0-9]*\).*/\1/') - L2_HASH=$(echo "$LOG_BLOCK" | grep '"hash"' | sed 's/.*"\(0x[0-9a-fA-F]*\)".*/\1/') - echo "L2_NUMBER: $L2_NUMBER" - echo "L2_HASH: $L2_HASH" + # Add --override-proposer if TIMELOCK_OVERRIDE_PROPOSER_ADDRESS is set and non-empty + if [ -n "${TIMELOCK_OVERRIDE_PROPOSER_ADDRESS:-}" ]; then + MIGRATE_CMD="$MIGRATE_CMD --override-proposer=${TIMELOCK_OVERRIDE_PROPOSER_ADDRESS}" + fi + + # Add --override-executor if TIMELOCK_OVERRIDE_EXECUTOR_ADDRESS is set and non-empty + if [ -n "${TIMELOCK_OVERRIDE_EXECUTOR_ADDRESS:-}" ]; then + MIGRATE_CMD="$MIGRATE_CMD --override-executor=${TIMELOCK_OVERRIDE_EXECUTOR_ADDRESS}" + fi + + # Add the genesis path at the end + MIGRATE_CMD="$MIGRATE_CMD ${OP_GENESIS_PATH}" + + # Execute the command + $MIGRATE_CMD 2>&1 | tee migrate.log # Update eip1559DenominatorCanyon to match eip1559Denominator in rollup.json echo "🔧 Updating eip1559DenominatorCanyon to match eip1559Denominator..." From a33c9365d8a3d2ef016771c57e9215b0166fdee3 Mon Sep 17 00:00:00 2001 From: Vui-Chee Date: Thu, 23 Oct 2025 15:10:39 +0800 Subject: [PATCH 2/8] Drop debug --- test-pp-op/utils.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/test-pp-op/utils.sh b/test-pp-op/utils.sh index a1d3d2d8ccd9f..80eaaaf03b246 100644 --- a/test-pp-op/utils.sh +++ b/test-pp-op/utils.sh @@ -1,6 +1,5 @@ #!/bin/bash set -e -set -x # init-erigon.sh runs outside the container. ROOT_DIR=$(which git &>/dev/null && git rev-parse --show-toplevel || echo "/data") From 701d0eb9c9caeaf6fc1eb02d63850ad421c447db Mon Sep 17 00:00:00 2001 From: Vui-Chee Date: Thu, 23 Oct 2025 15:28:18 +0800 Subject: [PATCH 3/8] Restore L2 num + hash after migrate --- test-pp-op/4-migrate-op.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test-pp-op/4-migrate-op.sh b/test-pp-op/4-migrate-op.sh index d73a44a93f387..b34624e272506 100755 --- a/test-pp-op/4-migrate-op.sh +++ b/test-pp-op/4-migrate-op.sh @@ -168,6 +168,16 @@ migrate() { # Execute the command $MIGRATE_CMD 2>&1 | tee migrate.log + LOG_BLOCK=$(grep -A 5 "Update rollup.json file with the following information l2" migrate.log | tail -n 5) + L2_NUMBER=$(echo "$LOG_BLOCK" | grep '"number"' | sed 's/[^0-9]*\([0-9]*\).*/\1/') + L2_HASH=$(echo "$LOG_BLOCK" | grep '"hash"' | sed 's/.*"\(0x[0-9a-fA-F]*\)".*/\1/') + echo "L2_NUMBER: $L2_NUMBER" + echo "L2_HASH: $L2_HASH" + + jq --argjson num "$L2_NUMBER" --arg hash "$L2_HASH" \ + '.genesis.l2.number = $num | .genesis.l2.hash = $hash' \ + config-op/rollup.json > config-op/rollup.json.tmp && mv config-op/rollup.json.tmp config-op/rollup.json + # Update eip1559DenominatorCanyon to match eip1559Denominator in rollup.json echo "🔧 Updating eip1559DenominatorCanyon to match eip1559Denominator..." From d2d47d70d9a60c7dc49753db988d1da1951e98e4 Mon Sep 17 00:00:00 2001 From: Vui-Chee Date: Thu, 23 Oct 2025 15:29:05 +0800 Subject: [PATCH 4/8] Revert to allow deploy contracts to succeed --- Dockerfile-contracts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-contracts b/Dockerfile-contracts index 457efb953d146..7fae591865bb3 100644 --- a/Dockerfile-contracts +++ b/Dockerfile-contracts @@ -29,7 +29,7 @@ RUN --mount=type=cache,target=/root/.cache \ # Create final contracts image with artifacts, foundry tools, and op-deployer FROM debian:bookworm-slim WORKDIR /app -# RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates +RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates # Set environment variables for Go ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt From 9225d8517867e876a74a3a0bd638ada86a2c6ad5 Mon Sep 17 00:00:00 2001 From: Vui-Chee Date: Thu, 23 Oct 2025 15:36:13 +0800 Subject: [PATCH 5/8] Omit debug from build script --- test-pp-op/build_images.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/test-pp-op/build_images.sh b/test-pp-op/build_images.sh index 1f3d78988a83e..11a598914a708 100755 --- a/test-pp-op/build_images.sh +++ b/test-pp-op/build_images.sh @@ -1,6 +1,5 @@ #!/bin/bash set -e -set -x # ============================================================================= # Build Images Script From 974cd12f68b737b404aae711c805696b2763bb09 Mon Sep 17 00:00:00 2001 From: Vui-Chee Date: Thu, 23 Oct 2025 16:21:36 +0800 Subject: [PATCH 6/8] Pull out game factory adress from .env --- test-pp-op/m2-migrate.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test-pp-op/m2-migrate.sh b/test-pp-op/m2-migrate.sh index 9f16f4071d47a..e3cb000da23cc 100755 --- a/test-pp-op/m2-migrate.sh +++ b/test-pp-op/m2-migrate.sh @@ -284,6 +284,7 @@ extract_configuration_fields() { echo 'DISPUTE_GAME_FINALITY_DELAY_SECONDS='\$(grep '^DISPUTE_GAME_FINALITY_DELAY_SECONDS=' .env | cut -d'=' -f2) && \ echo 'CHALLENGE_PERIOD_SECONDS='\$(grep '^CHALLENGE_PERIOD_SECONDS=' .env | cut -d'=' -f2) && \ echo 'WITHDRAWAL_DELAY_SECONDS='\$(grep '^WITHDRAWAL_DELAY_SECONDS=' .env | cut -d'=' -f2) && \ + echo 'DISPUTE_GAME_FACTORY_ADDRESS='\$(grep '^DISPUTE_GAME_FACTORY_ADDRESS=' .env | cut -d'=' -f2) && \ echo 'TRANSACTOR='\$(grep '^TRANSACTOR=' .env | cut -d'=' -f2)" echo "" From d282d91c907c8c2972469dff6cb64e255da58306 Mon Sep 17 00:00:00 2001 From: Barry Date: Thu, 23 Oct 2025 16:25:52 +0800 Subject: [PATCH 7/8] update --- test-pp-op/m2-migrate.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test-pp-op/m2-migrate.sh b/test-pp-op/m2-migrate.sh index 9f16f4071d47a..d9f9397b3d26e 100755 --- a/test-pp-op/m2-migrate.sh +++ b/test-pp-op/m2-migrate.sh @@ -585,6 +585,24 @@ echo "Step 7: Review Configuration After Copy" echo "==============================================" extract_configuration_fields "after" +echo "" +echo "==============================================" +echo "Step 8: Copy diff.genesis.json from container" +echo "==============================================" + +# Check if diff.genesis.json exists in container +if docker exec ${CONTAINER_NAME} test -f /app/test-pp-op/diff.genesis.json; then + echo "Copying diff.genesis.json from container..." + if docker cp ${CONTAINER_NAME}:/app/test-pp-op/diff.genesis.json ${BACKUP_DIR}/diff.genesis.json; then + echo "✅ diff.genesis.json copied successfully to ${BACKUP_DIR}/diff.genesis.json" + else + echo "⚠️ Warning: Failed to copy diff.genesis.json" + fi +else + echo "⚠️ Warning: diff.genesis.json not found in container" + echo " Expected location: /app/test-pp-op/diff.genesis.json" +fi + echo "" echo "==============================================" echo "✅ Migration process completed successfully!" From 662c07e823f037de4696b05f02006b3248ee48ad Mon Sep 17 00:00:00 2001 From: Barry Date: Thu, 23 Oct 2025 18:07:07 +0800 Subject: [PATCH 8/8] update --- test-pp-op/m3-verify.sh | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 test-pp-op/m3-verify.sh diff --git a/test-pp-op/m3-verify.sh b/test-pp-op/m3-verify.sh new file mode 100755 index 0000000000000..33ca4cd9baa44 --- /dev/null +++ b/test-pp-op/m3-verify.sh @@ -0,0 +1,43 @@ +#!/bin/bash +set -e +set -x + +IMAGE_NAME="op-geth-migrate:latest" +CONTAINER_NAME="op-verify-container" +RAMDISK_PATH="${RAMDISK_PATH:-/mnt/ramdisk_op}" +ERIGON_DATA_DIR="${ERIGON_DATA_DIR:-/data/erigon-data}" +OP_GETH_DATA_DIR="${RAMDISK_PATH}/test-pp-op/data/op-geth-seq" + +echo "Verifying migration in ramdisk..." +echo " Erigon: ${ERIGON_DATA_DIR}/chaindata" +echo " OP-Geth: ${OP_GETH_DATA_DIR}" + +# Basic checks +[ -d "${ERIGON_DATA_DIR}/chaindata" ] || { echo "❌ Erigon chaindata not found at ${ERIGON_DATA_DIR}/chaindata"; exit 1; } +[ -d "${OP_GETH_DATA_DIR}" ] || { echo "❌ OP-Geth data not found at ${OP_GETH_DATA_DIR}"; exit 1; } + +# Cleanup old container +docker rm -f ${CONTAINER_NAME} 2>/dev/null || true + +# Start container +docker run -d --name ${CONTAINER_NAME} \ + -v ${ERIGON_DATA_DIR}:/data/erigon-data \ + -v ${RAMDISK_PATH}:${RAMDISK_PATH} \ + ${IMAGE_NAME} sleep infinity + +sleep 2 + +# Run verification +echo "Running verification..." +docker exec -it ${CONTAINER_NAME} geth verifyMigrate \ + --chaindata=/data/erigon-data/chaindata \ + --datadir=${OP_GETH_DATA_DIR} \ + --standalone-smt=true + +RESULT=$? + +# Cleanup +docker rm -f ${CONTAINER_NAME} 2>/dev/null || true + +exit $RESULT +