From aca2711c2f8a0aa1eb641116efcd91c294eee856 Mon Sep 17 00:00:00 2001 From: William Law Date: Tue, 4 Nov 2025 12:11:58 -0500 Subject: [PATCH 1/6] build base-reth-node w maxperf --- reth/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reth/Dockerfile b/reth/Dockerfile index ff54aab2..3fd0dfca 100644 --- a/reth/Dockerfile +++ b/reth/Dockerfile @@ -41,7 +41,7 @@ RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \ git checkout tags/$BASE_RETH_NODE_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1) -RUN cargo build --bin base-reth-node --release +RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc FROM ubuntu:24.04 @@ -54,7 +54,7 @@ WORKDIR /app COPY --from=op /app/op-node/bin/op-node ./ COPY --from=reth /app/target/maxperf/op-reth ./ -COPY --from=reth-base /app/target/release/base-reth-node ./ +COPY --from=reth-base /app/target/maxperf/base-reth-node ./ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY ./reth/reth-entrypoint ./execution-entrypoint COPY op-node-entrypoint . From 829123e21ea110a4a5cffdbcc50e5d70ed62b21e Mon Sep 17 00:00:00 2001 From: William Law Date: Tue, 4 Nov 2025 13:14:37 -0500 Subject: [PATCH 2/6] try 2 jobs --- reth/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reth/Dockerfile b/reth/Dockerfile index 3fd0dfca..9e770670 100644 --- a/reth/Dockerfile +++ b/reth/Dockerfile @@ -25,7 +25,7 @@ RUN . /tmp/versions.env && git clone $OP_RETH_REPO --branch $OP_RETH_TAG --singl git switch -c branch-$OP_RETH_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$OP_RETH_COMMIT" ]' -RUN cargo build --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml +RUN cargo build --bin op-reth --profile maxperf --jobs 2 --manifest-path crates/optimism/bin/Cargo.toml FROM rust:1.88 AS reth-base @@ -41,7 +41,7 @@ RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \ git checkout tags/$BASE_RETH_NODE_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1) -RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc +RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc --jobs 2 FROM ubuntu:24.04 From 2c1626beb886cb60a7f5d45c51953b4ddf52262a Mon Sep 17 00:00:00 2001 From: William Law Date: Tue, 4 Nov 2025 13:32:30 -0500 Subject: [PATCH 3/6] try bumping runner --- .github/workflows/docker.yml | 4 ++-- reth/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index db284b84..5c7242a5 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -90,10 +90,10 @@ jobs: matrix: settings: - arch: linux/amd64 - runs-on: ubuntu-24.04 + runs-on: ubuntu-24.04-16core features: jemalloc,asm-keccak,optimism - arch: linux/arm64 - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-24.04-arm-16core features: jemalloc,optimism runs-on: ${{ matrix.settings.runs-on }} steps: diff --git a/reth/Dockerfile b/reth/Dockerfile index 9e770670..3fd0dfca 100644 --- a/reth/Dockerfile +++ b/reth/Dockerfile @@ -25,7 +25,7 @@ RUN . /tmp/versions.env && git clone $OP_RETH_REPO --branch $OP_RETH_TAG --singl git switch -c branch-$OP_RETH_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$OP_RETH_COMMIT" ]' -RUN cargo build --bin op-reth --profile maxperf --jobs 2 --manifest-path crates/optimism/bin/Cargo.toml +RUN cargo build --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml FROM rust:1.88 AS reth-base @@ -41,7 +41,7 @@ RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \ git checkout tags/$BASE_RETH_NODE_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1) -RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc --jobs 2 +RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc FROM ubuntu:24.04 From 78bbb5a5cccc475a1fe07943583f19f7e6871852 Mon Sep 17 00:00:00 2001 From: William Law Date: Tue, 4 Nov 2025 14:01:22 -0500 Subject: [PATCH 4/6] try 64core --- .github/workflows/docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5c7242a5..3184f214 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -90,10 +90,10 @@ jobs: matrix: settings: - arch: linux/amd64 - runs-on: ubuntu-24.04-16core + runs-on: ubuntu-24.04-64core features: jemalloc,asm-keccak,optimism - arch: linux/arm64 - runs-on: ubuntu-24.04-arm-16core + runs-on: ubuntu-24.04-arm-64core features: jemalloc,optimism runs-on: ${{ matrix.settings.runs-on }} steps: From f40acff6ff221fc9e37ccd14dae2ce760bfb13d6 Mon Sep 17 00:00:00 2001 From: William Law Date: Wed, 5 Nov 2025 10:53:44 -0500 Subject: [PATCH 5/6] try rm-ing op-reth as base-reth-node is rec client --- .github/workflows/docker.yml | 4 ++-- reth/Dockerfile | 17 +---------------- reth/reth-entrypoint | 10 +--------- 3 files changed, 4 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 3184f214..db284b84 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -90,10 +90,10 @@ jobs: matrix: settings: - arch: linux/amd64 - runs-on: ubuntu-24.04-64core + runs-on: ubuntu-24.04 features: jemalloc,asm-keccak,optimism - arch: linux/arm64 - runs-on: ubuntu-24.04-arm-64core + runs-on: ubuntu-24.04-arm features: jemalloc,optimism runs-on: ${{ matrix.settings.runs-on }} steps: diff --git a/reth/Dockerfile b/reth/Dockerfile index 3fd0dfca..a0138937 100644 --- a/reth/Dockerfile +++ b/reth/Dockerfile @@ -13,20 +13,6 @@ RUN . /tmp/versions.env && git clone $OP_NODE_REPO --branch $OP_NODE_TAG --singl RUN . /tmp/versions.env && cd op-node && \ make VERSION=$OP_NODE_TAG op-node -FROM rust:1.88 AS reth - -WORKDIR /app - -COPY versions.env /tmp/versions.env - -RUN apt-get update && apt-get -y upgrade && apt-get install -y git libclang-dev pkg-config curl build-essential - -RUN . /tmp/versions.env && git clone $OP_RETH_REPO --branch $OP_RETH_TAG --single-branch . && \ - git switch -c branch-$OP_RETH_TAG && \ - bash -c '[ "$(git rev-parse HEAD)" = "$OP_RETH_COMMIT" ]' - -RUN cargo build --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml - FROM rust:1.88 AS reth-base WORKDIR /app @@ -41,7 +27,7 @@ RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \ git checkout tags/$BASE_RETH_NODE_TAG && \ bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1) -RUN cargo build --bin base-reth-node --profile maxperf --features jemalloc +RUN cargo build --bin base-reth-node --profile maxperf FROM ubuntu:24.04 @@ -53,7 +39,6 @@ RUN mkdir -p /var/log/supervisor WORKDIR /app COPY --from=op /app/op-node/bin/op-node ./ -COPY --from=reth /app/target/maxperf/op-reth ./ COPY --from=reth-base /app/target/maxperf/base-reth-node ./ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY ./reth/reth-entrypoint ./execution-entrypoint diff --git a/reth/reth-entrypoint b/reth/reth-entrypoint index 31e40e0f..f8a856ea 100755 --- a/reth/reth-entrypoint +++ b/reth/reth-entrypoint @@ -11,6 +11,7 @@ DISCOVERY_PORT="${DISCOVERY_PORT:-30303}" P2P_PORT="${P2P_PORT:-30303}" ADDITIONAL_ARGS="" NODE_TYPE="${NODE_TYPE:-base}" +BINARY="./base-reth-node" if [[ -z "${RETH_CHAIN:-}" ]]; then echo "expected RETH_CHAIN to be set" 1>&2 @@ -23,15 +24,6 @@ if [[ "$NODE_TYPE" == "base" && -n "${RETH_FB_WEBSOCKET_URL:-}" ]]; then echo "Enabling Flashblocks support with endpoint: $RETH_FB_WEBSOCKET_URL" fi -# Select binary based on NODE_TYPE -if [[ "$NODE_TYPE" == "base" ]]; then - echo "Starting Base Reth node" - BINARY="./base-reth-node" -else - echo "Starting OP Reth node" - BINARY="./op-reth" -fi - # Add pruning for base if [[ "$NODE_TYPE" == "base" && "${RETH_PRUNING_ARGS+x}" = x ]]; then echo "Adding pruning arguments: $RETH_PRUNING_ARGS" From 9a49e0b5f3e239c5b66d023724619943e9a562e0 Mon Sep 17 00:00:00 2001 From: William Law Date: Wed, 12 Nov 2025 13:46:15 -0500 Subject: [PATCH 6/6] update docs --- README.md | 2 +- docker-compose.yml | 2 -- reth/README.md | 19 ++++++++----------- reth/reth-entrypoint | 9 +++++---- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 90ac2912..1cbaad17 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ To run the node using a supported client, you can use the following command: `CLIENT=supported_client docker compose up --build` Supported clients: - - reth (with Flashblocks support option, see [Reth Node README](./reth/README.md)) + - reth (runs vanilla node by default, Flashblocks mode enabled by providing RETH_FB_WEBSOCKET_URL, see [Reth Node README](./reth/README.md)) - geth - nethermind diff --git a/docker-compose.yml b/docker-compose.yml index 1ad38b79..fc7cebe1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,8 +13,6 @@ services: command: ["bash", "./execution-entrypoint"] volumes: - ${HOST_DATA_DIR}:/data - environment: - - NODE_TYPE=${NODE_TYPE:-vanilla} env_file: - ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet node: diff --git a/reth/README.md b/reth/README.md index 43908173..edf8e92c 100644 --- a/reth/README.md +++ b/reth/README.md @@ -1,35 +1,32 @@ # Running a Reth Node -This is a unified implementation of the Reth node setup that supports running both OP Reth and Base Reth with Flashblocks support. +This is an implementation of the Reth node setup that supports Flashblocks mode based on configuration. ## Setup - See hardware requirements mentioned in the master README -- For Base Reth mode: Access to a Flashblocks websocket endpoint (for `RETH_FB_WEBSOCKET_URL`) +- For Flashblocks mode: Access to a Flashblocks websocket endpoint (for `RETH_FB_WEBSOCKET_URL`) - We provide public websocket endpoints for mainnet and devnet, included in `.env.mainnet` and `.env.sepolia` ## Node Type Selection -Use the `NODE_TYPE` environment variable to select the implementation: +The node determines its mode based on the presence of the `RETH_FB_WEBSOCKET_URL` environment variable: -- `NODE_TYPE=vanilla` - OP Reth implementation (default) -- `NODE_TYPE=base` - Base L2 Reth implementation with Flashblocks support +- **Vanilla Mode** (default): When no `RETH_FB_WEBSOCKET_URL` is provided. +- **Flashblocks Mode**: When `RETH_FB_WEBSOCKET_URL` is provided. ## Running the Node The node follows the standard `docker-compose` workflow in the master README. ```bash -# Run OP Reth node +# To run Reth node with Flashblocks support, set RETH_FB_WEBSOCKET_URL in your .env file CLIENT=reth docker-compose up - -# Run Base L2 Reth node with Flashblocks support -NODE_TYPE=base CLIENT=reth docker-compose up ``` ## Testing Flashblocks RPC Methods -When running in Base mode (`NODE_TYPE=base`), you can query a pending block using the Flashblocks RPC: +When running in Flashblocks mode (with `RETH_FB_WEBSOCKET_URL` configured), you can query a pending block using the Flashblocks RPC: ```bash curl -X POST \ @@ -42,4 +39,4 @@ curl -X POST \ For a complete list of supported RPC methods, refer to: - [Standard Ethereum JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/) -- [Flashblocks RPC Methods](https://docs.base.org/chain/flashblocks#rpc-api) (Base mode only) +- [Flashblocks RPC Methods](https://docs.base.org/chain/flashblocks#rpc-api) (Flashblocks mode only) diff --git a/reth/reth-entrypoint b/reth/reth-entrypoint index f8a856ea..59d533f7 100755 --- a/reth/reth-entrypoint +++ b/reth/reth-entrypoint @@ -10,7 +10,6 @@ METRICS_PORT="${METRICS_PORT:-6060}" DISCOVERY_PORT="${DISCOVERY_PORT:-30303}" P2P_PORT="${P2P_PORT:-30303}" ADDITIONAL_ARGS="" -NODE_TYPE="${NODE_TYPE:-base}" BINARY="./base-reth-node" if [[ -z "${RETH_CHAIN:-}" ]]; then @@ -18,14 +17,16 @@ if [[ -z "${RETH_CHAIN:-}" ]]; then exit 1 fi -# Add Flashblocks support for base mode -if [[ "$NODE_TYPE" == "base" && -n "${RETH_FB_WEBSOCKET_URL:-}" ]]; then +# Enable Flashblocks support if websocket URL is provided +if [[ -n "${RETH_FB_WEBSOCKET_URL:-}" ]]; then ADDITIONAL_ARGS="--websocket-url=$RETH_FB_WEBSOCKET_URL" echo "Enabling Flashblocks support with endpoint: $RETH_FB_WEBSOCKET_URL" +else + echo "Running in vanilla node mode (no Flashblocks URL provided)" fi # Add pruning for base -if [[ "$NODE_TYPE" == "base" && "${RETH_PRUNING_ARGS+x}" = x ]]; then +if [[ "${RETH_PRUNING_ARGS+x}" = x ]]; then echo "Adding pruning arguments: $RETH_PRUNING_ARGS" ADDITIONAL_ARGS="$ADDITIONAL_ARGS $RETH_PRUNING_ARGS" fi