From 4f22b73d037ccc6104eef3b667dae5cf71aee776 Mon Sep 17 00:00:00 2001 From: Tsahi Zidenberg Date: Sun, 5 May 2024 19:36:31 -0600 Subject: [PATCH] Docker: nitro-val uses split to validate pre-stylus blocks --- Dockerfile | 10 ++++++++-- scripts/split-val-entry.sh | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bef042628..1d5d73303 100644 --- a/Dockerfile +++ b/Dockerfile @@ -292,7 +292,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ USER user -FROM nitro-node as nitro-node-dev +FROM nitro-node as nitro-node-dev-temp USER root # Copy in latest WASM module root RUN rm -f /home/user/target/machines/latest @@ -316,13 +316,19 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ USER user -FROM nitro-node-dev as nitro-node-split +FROM offchainlabs/nitro-node:v2.3.4-rc.5-b4cc111 as nitro-legacy + +FROM nitro-node-dev-temp as nitro-node-dev USER root RUN export DEBIAN_FRONTEND=noninteractive && \ apt-get update && \ apt-get install -y xxd netcat-traditional COPY scripts/split-val-entry.sh /usr/local/bin +COPY --from=nitro-legacy /home/user/target/machines /home/user/nitro-legacy/machines +RUN rm -rf /workspace/target/legacy-machines/latest +COPY --from=nitro-legacy /usr/local/bin/nitro-val /home/user/nitro-legacy/bin/nitro-val +COPY --from=nitro-legacy /usr/local/bin/jit /home/user/nitro-legacy/bin/jit ENTRYPOINT [ "/usr/local/bin/split-val-entry.sh" ] USER user diff --git a/scripts/split-val-entry.sh b/scripts/split-val-entry.sh index a5ee0709b..6f56a8ec4 100755 --- a/scripts/split-val-entry.sh +++ b/scripts/split-val-entry.sh @@ -8,11 +8,12 @@ echo launching validation servers # add their port to wait loop # edit validation-server-configs-list to include the other nodes /usr/local/bin/nitro-val --file-logging.enable=false --auth.addr 127.0.0.10 --auth.origins 127.0.0.1 --auth.jwtsecret /tmp/nitro-val.jwt --auth.port 52000 & -for port in 52000; do +/home/user/nitro-legacy/bin/nitro-val --file-logging.enable=false --auth.addr 127.0.0.10 --auth.origins 127.0.0.1 --auth.jwtsecret /tmp/nitro-val.jwt --auth.port 52001 --validation.wasm.root-path /home/user/nitro-legacy/machines & +for port in 52000 52001; do while ! nc -w1 -z 127.0.0.10 $port; do echo waiting for validation port $port sleep 1 done done echo launching nitro-node -/usr/local/bin/nitro --node.block-validator.pending-upgrade-module-root="0x8b104a2e80ac6165dc58b9048de12f301d70b02a0ab51396c22b4b4b802a16a4" --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"http://127.0.0.10:52000"}]' "$@" +/usr/local/bin/nitro --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"http://127.0.0.10:52000"}, {"jwtsecret":"/tmp/nitro-val.jwt","url":"http://127.0.0.10:52001"}]' "$@"