Skip to content

Commit 2336893

Browse files
authored
Automate Node Upgrade Process: Update Dependencies (#477)
* Changes to automate dependency versions * update base reth node version
1 parent 5a871ba commit 2336893

File tree

4 files changed

+67
-60
lines changed

4 files changed

+67
-60
lines changed

geth/Dockerfile

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
FROM golang:1.22 AS op
1+
FROM golang:1.23 AS op
2+
3+
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
24

35
WORKDIR /app
46

5-
ENV REPO=https://github.com/ethereum-optimism/optimism.git
6-
ENV VERSION=v1.13.2
7-
ENV COMMIT=c8b9f62736a7dad7e569719a84c406605f4472e6
8-
RUN git clone $REPO --branch op-node/$VERSION --single-branch . && \
9-
git switch -c branch-$VERSION && \
10-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
7+
COPY versions.env /tmp/versions.env
118

12-
# Install 'just'
13-
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
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" ]'
1412

15-
RUN cd op-node && \
16-
make VERSION=$VERSION op-node
13+
RUN . /tmp/versions.env && cd op-node && \
14+
make VERSION=$OP_NODE_TAG op-node
1715

1816
FROM golang:1.22 AS geth
1917

2018
WORKDIR /app
2119

22-
RUN apt-get update && \
23-
apt-get install -y \
24-
build-essential
25-
26-
ENV REPO=https://github.com/ethereum-optimism/op-geth.git
27-
ENV VERSION=v1.101503.4
28-
ENV COMMIT=2b9abb39077cb88f6e8a513f09a5ea2c2569dfed
29-
RUN git clone $REPO --branch $VERSION --single-branch . && \
30-
git switch -c branch-$VERSION && \
31-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
20+
COPY versions.env /tmp/versions.env
21+
22+
RUN . /tmp/versions.env && git clone $OP_GETH_REPO --branch $OP_GETH_TAG --single-branch . && \
23+
git switch -c branch-$OP_GETH_TAG && \
24+
bash -c '[ "$(git rev-parse HEAD)" = "$OP_GETH_COMMIT" ]'
3225

3326
RUN go run build/ci.go install -static ./cmd/geth
3427

nethermind/Dockerfile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
FROM golang:1.23 AS op
22

3+
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
4+
35
WORKDIR /app
46

5-
ENV REPO=https://github.com/ethereum-optimism/optimism.git
6-
ENV VERSION=v1.13.3
7-
ENV COMMIT=b1e7c63bb2ffea46771c302bcb05f72ba1a7bf61
8-
RUN git clone $REPO --branch op-node/$VERSION --single-branch . && \
9-
git switch -c branch-$VERSION && \
10-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
7+
COPY versions.env /tmp/versions.env
118

12-
# Install 'just'
13-
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
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" ]'
1412

15-
RUN cd op-node && \
16-
just VERSION=$VERSION op-node
13+
RUN . /tmp/versions.env && cd op-node && \
14+
just VERSION=$OP_NODE_TAG op-node
1715

1816
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build
1917

@@ -22,12 +20,12 @@ ARG TARGETARCH
2220

2321
WORKDIR /app
2422

25-
ENV REPO=https://github.com/NethermindEth/nethermind.git
26-
ENV VERSION=1.31.11
27-
ENV COMMIT=2be1890ee4f21f921a471de058dcb57937bd9b90
28-
RUN git clone $REPO --branch $VERSION --single-branch . && \
29-
git switch -c $VERSION
30-
RUN bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
23+
COPY versions.env /tmp/versions.env
24+
25+
RUN . /tmp/versions.env && git clone $NETHERMIND_REPO --branch $NETHERMIND_TAG --single-branch . && \
26+
git switch -c $NETHERMIND_TAG && \
27+
bash -c '[ "$(git rev-parse HEAD)" = "$NETHERMIND_COMMIT" ]'
28+
3129
RUN TARGETARCH=${TARGETARCH#linux/} && \
3230
arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
3331
echo "Using architecture: $arch" && \

reth/Dockerfile

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,45 @@
1-
FROM golang:1.22 AS op
1+
FROM golang:1.23 AS op
2+
3+
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
24

35
WORKDIR /app
46

5-
ENV REPO=https://github.com/ethereum-optimism/optimism.git
6-
ENV VERSION=v1.13.2
7-
ENV COMMIT=c8b9f62736a7dad7e569719a84c406605f4472e6
8-
RUN git clone $REPO --branch op-node/$VERSION --single-branch . && \
9-
git switch -c branch-$VERSION && \
10-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
7+
COPY versions.env /tmp/versions.env
118

12-
# Install 'just'
13-
RUN curl -sSfL 'https://just.systems/install.sh' | bash -s -- --to /usr/local/bin
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" ]'
1412

15-
RUN cd op-node && \
16-
make VERSION=$VERSION op-node
13+
RUN . /tmp/versions.env && cd op-node && \
14+
make VERSION=$OP_NODE_TAG op-node
1715

1816
FROM rust:1.87 AS reth
1917

2018
WORKDIR /app
2119

20+
COPY versions.env /tmp/versions.env
21+
2222
RUN apt-get update && apt-get -y upgrade && apt-get install -y git libclang-dev pkg-config curl build-essential
2323

24-
ENV REPO=https://github.com/paradigmxyz/reth.git
25-
ENV VERSION=v1.4.3
26-
ENV COMMIT=fe3653ffe602d4e85ad213e8bd9f06e7b710c0c5
27-
RUN git clone $REPO --branch $VERSION --single-branch . && \
28-
git switch -c branch-$VERSION && \
29-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'
24+
RUN . /tmp/versions.env && git clone $OP_RETH_REPO --branch $OP_RETH_TAG --single-branch . && \
25+
git switch -c branch-$OP_RETH_TAG && \
26+
bash -c '[ "$(git rev-parse HEAD)" = "$OP_RETH_COMMIT" ]'
3027

3128
RUN cargo build --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml
3229

3330
FROM rust:1.87 AS reth-base
3431

3532
WORKDIR /app
3633

34+
COPY versions.env /tmp/versions.env
35+
3736
RUN apt-get update && apt-get -y upgrade && \
3837
apt-get install -y git libclang-dev pkg-config curl build-essential && \
3938
rm -rf /var/lib/apt/lists/*
4039

41-
ENV REPO=https://github.com/base/node-reth.git
42-
ENV VERSION=v0.1.2
43-
ENV COMMIT=7fe1d4e7c74d322d2cf78df55db40e14f466cfc6
44-
RUN git clone $REPO . && \
45-
git checkout tags/$VERSION && \
46-
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)
40+
RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \
41+
git checkout tags/$BASE_RETH_NODE_TAG && \
42+
bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)
4743

4844
RUN cargo build --bin base-reth-node --release
4945

versions.env

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export OP_NODE_TAG=op-node/v1.13.3
2+
export OP_NODE_COMMIT=b1e7c63bb2ffea46771c302bcb05f72ba1a7bf61
3+
export OP_NODE_REPO=https://github.com/ethereum-optimism/optimism.git
4+
5+
export OP_GETH_TAG=v1.101503.4
6+
export OP_GETH_COMMIT=2b9abb39077cb88f6e8a513f09a5ea2c2569dfed
7+
export OP_GETH_REPO=https://github.com/ethereum-optimism/op-geth.git
8+
9+
export OP_RETH_TAG=v1.4.3
10+
export OP_RETH_COMMIT=fe3653ffe602d4e85ad213e8bd9f06e7b710c0c5
11+
export OP_RETH_REPO=https://github.com/paradigmxyz/reth.git
12+
13+
export NETHERMIND_TAG=1.31.11
14+
export NETHERMIND_COMMIT=2be1890ee4f21f921a471de058dcb57937bd9b90
15+
export NETHERMIND_REPO=https://github.com/NethermindEth/nethermind.git
16+
17+
export BASE_RETH_NODE_TAG=v0.1.2
18+
export BASE_RETH_NODE_COMMIT=7fe1d4e7c74d322d2cf78df55db40e14f466cfc6
19+
export BASE_RETH_NODE_REPO=https://github.com/base/node-reth.git
20+

0 commit comments

Comments
 (0)