Skip to content

Commit deb01f4

Browse files
feat: update nethermind Dockerfile to use base-consensus instead of op-node
Replace Go op-node build stage with Rust base-consensus stage. Update nethermind-entrypoint to use BASE_NODE_* auth vars and OP_NETHERMIND_NETWORK for --config flag. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent fcd5cfd commit deb01f4

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

nethermind/Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
FROM golang:1.24 AS op
2-
3-
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
1+
FROM rust:1.88 AS base-consensus
42

53
WORKDIR /app
64

75
COPY versions.env /tmp/versions.env
86

9-
RUN . /tmp/versions.env && git clone $OP_NODE_REPO --branch $OP_NODE_TAG --single-branch . && \
10-
git switch -c branch-$OP_NODE_TAG && \
11-
bash -c '[ "$(git rev-parse HEAD)" = "$OP_NODE_COMMIT" ]'
7+
RUN apt-get update && apt-get -y upgrade && \
8+
apt-get install -y git libclang-dev pkg-config curl build-essential && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
RUN . /tmp/versions.env && git clone $BASE_NODE_REPO . && \
12+
git checkout tags/$BASE_NODE_TAG && \
13+
bash -c '[ "$(git rev-parse HEAD)" = "$BASE_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)
1214

13-
RUN . /tmp/versions.env && cd op-node && \
14-
just VERSION=$OP_NODE_TAG op-node
15+
RUN cargo build --bin base-consensus --profile maxperf
1516

1617
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build
1718

@@ -42,9 +43,9 @@ RUN mkdir -p /var/log/supervisor
4243
WORKDIR /app
4344

4445
COPY --from=build /publish ./
45-
COPY --from=op /app/op-node/bin/op-node ./
46+
COPY --from=base-consensus /app/target/maxperf/base-consensus ./
4647
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
4748
COPY nethermind/nethermind-entrypoint ./execution-entrypoint
48-
COPY op-node-entrypoint .
49+
COPY base-consensus-entrypoint .
4950

5051
CMD ["/usr/bin/supervisord"]

nethermind/nethermind-entrypoint

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ P2P_PORT="${P2P_PORT:-30303}"
1414
ADDITIONAL_ARGS=""
1515

1616
# Check if required variables are set
17-
if [[ -z "$OP_NODE_NETWORK" ]]; then
18-
echo "Expected OP_NODE_NETWORK to be set" 1>&2
17+
if [[ -z "$BASE_NODE_NETWORK" ]]; then
18+
echo "Expected BASE_NODE_NETWORK to be set" 1>&2
1919
exit 1
2020
fi
2121

2222
# Create necessary directories
2323
mkdir -p "$NETHERMIND_DATA_DIR"
2424

2525
# Write the JWT secret
26-
if [[ -z "$OP_NODE_L2_ENGINE_AUTH_RAW" ]]; then
27-
echo "Expected OP_NODE_L2_ENGINE_AUTH_RAW to be set" 1>&2
26+
if [[ -z "$BASE_NODE_L2_ENGINE_AUTH_RAW" ]]; then
27+
echo "Expected BASE_NODE_L2_ENGINE_AUTH_RAW to be set" 1>&2
2828
exit 1
2929
fi
30-
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
30+
echo "$BASE_NODE_L2_ENGINE_AUTH_RAW" > "$BASE_NODE_L2_ENGINE_AUTH"
3131

3232
# Additional arguments based on environment variables
3333
if [[ -n "${OP_NETHERMIND_BOOTNODES:-}" ]]; then
@@ -44,15 +44,15 @@ fi
4444

4545
# Execute Nethermind
4646
exec ./nethermind \
47-
--config="$OP_NODE_NETWORK" \
47+
--config="$OP_NETHERMIND_NETWORK" \
4848
--datadir="$NETHERMIND_DATA_DIR" \
4949
--Optimism.SequencerUrl=$OP_SEQUENCER_HTTP \
5050
--log="$NETHERMIND_LOG_LEVEL" \
5151
--JsonRpc.Enabled=true \
5252
--JsonRpc.Host=0.0.0.0 \
5353
--JsonRpc.WebSocketsPort="$WS_PORT" \
5454
--JsonRpc.Port="$RPC_PORT" \
55-
--JsonRpc.JwtSecretFile="$OP_NODE_L2_ENGINE_AUTH" \
55+
--JsonRpc.JwtSecretFile="$BASE_NODE_L2_ENGINE_AUTH" \
5656
--JsonRpc.EngineHost=0.0.0.0 \
5757
--JsonRpc.EnginePort="$AUTHRPC_PORT" \
5858
--HealthChecks.Enabled=true \

0 commit comments

Comments
 (0)