Skip to content

Commit 52e8959

Browse files
Merge pull request #4017 from OffchainLabs/split-val
Add legacy validator back for split validator
2 parents 5ee3766 + 3417fcb commit 52e8959

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ USER user
321321
WORKDIR /home/user/
322322
ENTRYPOINT [ "/usr/local/bin/nitro" ]
323323

324-
FROM offchainlabs/nitro-node:v2.3.4-rc.5-b4cc111 AS nitro-legacy
324+
FROM offchainlabs/nitro-node:v3.7.6-c0fe95e AS nitro-legacy
325325

326326
FROM nitro-node-slim AS nitro-node
327327
USER root
@@ -356,10 +356,12 @@ USER user
356356
# We keep the code (commented out), and the docker-target, for use in case such an update is needed again.
357357
FROM nitro-node AS nitro-node-validator
358358
USER root
359+
COPY --from=nitro-legacy /usr/local/bin/nitro-val /home/user/nitro-legacy/bin/nitro-val
360+
COPY --from=nitro-legacy /usr/local/bin/jit /home/user/nitro-legacy/bin/jit
359361
RUN export DEBIAN_FRONTEND=noninteractive && \
360-
apt-get update && \
361-
apt-get install -y xxd netcat-traditional && \
362-
rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/ldconfig/aux-cache /usr/lib/python3.9/__pycache__/ /usr/lib/python3.9/*/__pycache__/ /var/log/*
362+
apt-get update && \
363+
apt-get install -y xxd netcat-traditional && \
364+
rm -rf /var/lib/apt/lists/* /usr/share/doc/* /var/cache/ldconfig/aux-cache /usr/lib/python3.9/__pycache__/ /usr/lib/python3.9/*/__pycache__/ /var/log/*
363365
COPY scripts/split-val-entry.sh /usr/local/bin
364366
ENTRYPOINT [ "/usr/local/bin/split-val-entry.sh" ]
365367
USER user

scripts/split-val-entry.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
xxd -l 32 -ps -c 40 /dev/urandom > /tmp/nitro-val.jwt
44

5+
legacyvalopts=()
56
latestvalopts=()
67
while [[ $1 == "--val-options"* ]]; do
8+
setlegacy=true
79
setlatest=true
810
if [[ $1 == "--val-options-legacy" ]]; then
911
setlatest=false
10-
echo "warning! legacy validator options set and will have no effect"
12+
fi
13+
if [[ $1 == "--val-options-latest" ]]; then
14+
setlegacy=false
1115
fi
1216
shift
1317
while [[ "$1" != "--" ]] && [[ $# -gt 0 ]]; do
18+
if $setlegacy; then
19+
legacyvalopts=( "${legacyvalopts[@]}" "$1" )
20+
fi
1421
if $setlatest; then
1522
latestvalopts=( "${latestvalopts[@]}" "$1" )
1623
fi
@@ -24,12 +31,13 @@ echo launching validation servers
2431
# add their port to wait loop
2532
# edit validation-server-configs-list to include the other nodes
2633
/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 "${latestvalopts[@]}" &
27-
# shellcheck disable=SC2043
28-
for port in 52000; do
34+
/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 "${legacyvalopts[@]}" &
35+
for port in 52000 52001; do
2936
while ! nc -w1 -z 127.0.0.10 $port; do
3037
echo waiting for validation port $port
3138
sleep 1
3239
done
3340
done
3441
echo launching nitro-node
35-
exec /usr/local/bin/nitro --validation.wasm.allowed-wasm-module-roots /home/user/target/machines --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"ws://127.0.0.10:52000"}]' "$@"
42+
exec /usr/local/bin/nitro --validation.wasm.allowed-wasm-module-roots /home/user/nitro-legacy/machines,/home/user/target/machines --node.block-validator.validation-server-configs-list='[{"jwtsecret":"/tmp/nitro-val.jwt","url":"ws://127.0.0.10:52000"}, {"jwtsecret":"/tmp/nitro-val.jwt","url":"ws://127.0.0.10:52001"}]' "$@"
43+

0 commit comments

Comments
 (0)