Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Docker: nitro-val uses split to validate pre-stylus blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed May 6, 2024
1 parent 2408c44 commit 4f22b73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
5 changes: 3 additions & 2 deletions scripts/split-val-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}]' "$@"

0 comments on commit 4f22b73

Please sign in to comment.