Skip to content

Commit cca645a

Browse files
Merge pull request #3999 from OffchainLabs/split-val-entry-3_9
Port - Add back split-val-entry (#3998)
2 parents f5f55f8 + 25050d0 commit cca645a

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

Dockerfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -355,16 +355,14 @@ USER user
355355
# We no longer support pre-arbos-30 wasmmoduleroots (newer wasmmoduleroots can execute old blocks)
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
358-
# 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
361-
# RUN export DEBIAN_FRONTEND=noninteractive && \
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/*
365-
# COPY scripts/split-val-entry.sh /usr/local/bin
366-
# ENTRYPOINT [ "/usr/local/bin/split-val-entry.sh" ]
367-
# USER user
358+
USER root
359+
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/*
363+
COPY scripts/split-val-entry.sh /usr/local/bin
364+
ENTRYPOINT [ "/usr/local/bin/split-val-entry.sh" ]
365+
USER user
368366

369367
FROM nitro-node-validator AS nitro-node-dev
370368
USER root

scripts/split-val-entry.sh

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

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

5-
legacyvalopts=()
65
latestvalopts=()
76
while [[ $1 == "--val-options"* ]]; do
8-
setlegacy=true
97
setlatest=true
108
if [[ $1 == "--val-options-legacy" ]]; then
119
setlatest=false
12-
fi
13-
if [[ $1 == "--val-options-latest" ]]; then
14-
setlegacy=false
10+
echo "warning! legacy validator options set and will have no effect"
1511
fi
1612
shift
1713
while [[ "$1" != "--" ]] && [[ $# -gt 0 ]]; do
18-
if $setlegacy; then
19-
legacyvalopts=( "${legacyvalopts[@]}" "$1" )
20-
fi
2114
if $setlatest; then
2215
latestvalopts=( "${latestvalopts[@]}" "$1" )
2316
fi
@@ -31,12 +24,12 @@ echo launching validation servers
3124
# add their port to wait loop
3225
# edit validation-server-configs-list to include the other nodes
3326
/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[@]}" &
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
27+
# shellcheck disable=SC2043
28+
for port in 52000; do
3629
while ! nc -w1 -z 127.0.0.10 $port; do
3730
echo waiting for validation port $port
3831
sleep 1
3932
done
4033
done
4134
echo launching nitro-node
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"}]' "$@"
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"}]' "$@"

0 commit comments

Comments
 (0)