Skip to content

Commit 22ae136

Browse files
authored
chore: build base-reth-node w/ maxperf (#634)
* build base-reth-node w maxperf * try 2 jobs * try bumping runner * try 64core * try rm-ing op-reth as base-reth-node is rec client * update docs
1 parent 979a338 commit 22ae136

File tree

5 files changed

+16
-43
lines changed

5 files changed

+16
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ To run the node using a supported client, you can use the following command:
7575
`CLIENT=supported_client docker compose up --build`
7676

7777
Supported clients:
78-
- reth (with Flashblocks support option, see [Reth Node README](./reth/README.md))
78+
- reth (runs vanilla node by default, Flashblocks mode enabled by providing RETH_FB_WEBSOCKET_URL, see [Reth Node README](./reth/README.md))
7979
- geth
8080
- nethermind
8181

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ services:
1313
command: ["bash", "./execution-entrypoint"]
1414
volumes:
1515
- ${HOST_DATA_DIR}:/data
16-
environment:
17-
- NODE_TYPE=${NODE_TYPE:-vanilla}
1816
env_file:
1917
- ${NETWORK_ENV:-.env.mainnet} # Use .env.mainnet by default, override with .env.sepolia for testnet
2018
node:

reth/Dockerfile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ RUN . /tmp/versions.env && git clone $OP_NODE_REPO --branch $OP_NODE_TAG --singl
1313
RUN . /tmp/versions.env && cd op-node && \
1414
make VERSION=$OP_NODE_TAG op-node
1515

16-
FROM rust:1.88 AS reth
17-
18-
WORKDIR /app
19-
20-
COPY versions.env /tmp/versions.env
21-
22-
RUN apt-get update && apt-get -y upgrade && apt-get install -y git libclang-dev pkg-config curl build-essential
23-
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" ]'
27-
28-
RUN cargo build --bin op-reth --profile maxperf --manifest-path crates/optimism/bin/Cargo.toml
29-
3016
FROM rust:1.88 AS reth-base
3117

3218
WORKDIR /app
@@ -41,7 +27,7 @@ RUN . /tmp/versions.env && git clone $BASE_RETH_NODE_REPO . && \
4127
git checkout tags/$BASE_RETH_NODE_TAG && \
4228
bash -c '[ "$(git rev-parse HEAD)" = "$BASE_RETH_NODE_COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)
4329

44-
RUN cargo build --bin base-reth-node --release
30+
RUN cargo build --bin base-reth-node --profile maxperf
4531

4632
FROM ubuntu:24.04
4733

@@ -53,8 +39,7 @@ RUN mkdir -p /var/log/supervisor
5339
WORKDIR /app
5440

5541
COPY --from=op /app/op-node/bin/op-node ./
56-
COPY --from=reth /app/target/maxperf/op-reth ./
57-
COPY --from=reth-base /app/target/release/base-reth-node ./
42+
COPY --from=reth-base /app/target/maxperf/base-reth-node ./
5843
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
5944
COPY ./reth/reth-entrypoint ./execution-entrypoint
6045
COPY op-node-entrypoint .

reth/README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
11
# Running a Reth Node
22

3-
This is a unified implementation of the Reth node setup that supports running both OP Reth and Base Reth with Flashblocks support.
3+
This is an implementation of the Reth node setup that supports Flashblocks mode based on configuration.
44

55
## Setup
66

77
- See hardware requirements mentioned in the master README
8-
- For Base Reth mode: Access to a Flashblocks websocket endpoint (for `RETH_FB_WEBSOCKET_URL`)
8+
- For Flashblocks mode: Access to a Flashblocks websocket endpoint (for `RETH_FB_WEBSOCKET_URL`)
99
- We provide public websocket endpoints for mainnet and devnet, included in `.env.mainnet` and `.env.sepolia`
1010

1111
## Node Type Selection
1212

13-
Use the `NODE_TYPE` environment variable to select the implementation:
13+
The node determines its mode based on the presence of the `RETH_FB_WEBSOCKET_URL` environment variable:
1414

15-
- `NODE_TYPE=vanilla` - OP Reth implementation (default)
16-
- `NODE_TYPE=base` - Base L2 Reth implementation with Flashblocks support
15+
- **Vanilla Mode** (default): When no `RETH_FB_WEBSOCKET_URL` is provided.
16+
- **Flashblocks Mode**: When `RETH_FB_WEBSOCKET_URL` is provided.
1717

1818
## Running the Node
1919

2020
The node follows the standard `docker-compose` workflow in the master README.
2121

2222
```bash
23-
# Run OP Reth node
23+
# To run Reth node with Flashblocks support, set RETH_FB_WEBSOCKET_URL in your .env file
2424
CLIENT=reth docker-compose up
25-
26-
# Run Base L2 Reth node with Flashblocks support
27-
NODE_TYPE=base CLIENT=reth docker-compose up
2825
```
2926

3027
## Testing Flashblocks RPC Methods
3128

32-
When running in Base mode (`NODE_TYPE=base`), you can query a pending block using the Flashblocks RPC:
29+
When running in Flashblocks mode (with `RETH_FB_WEBSOCKET_URL` configured), you can query a pending block using the Flashblocks RPC:
3330

3431
```bash
3532
curl -X POST \
@@ -42,4 +39,4 @@ curl -X POST \
4239
For a complete list of supported RPC methods, refer to:
4340

4441
- [Standard Ethereum JSON-RPC](https://ethereum.org/en/developers/docs/apis/json-rpc/)
45-
- [Flashblocks RPC Methods](https://docs.base.org/chain/flashblocks#rpc-api) (Base mode only)
42+
- [Flashblocks RPC Methods](https://docs.base.org/chain/flashblocks#rpc-api) (Flashblocks mode only)

reth/reth-entrypoint

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,23 @@ METRICS_PORT="${METRICS_PORT:-6060}"
1010
DISCOVERY_PORT="${DISCOVERY_PORT:-30303}"
1111
P2P_PORT="${P2P_PORT:-30303}"
1212
ADDITIONAL_ARGS=""
13-
NODE_TYPE="${NODE_TYPE:-base}"
13+
BINARY="./base-reth-node"
1414

1515
if [[ -z "${RETH_CHAIN:-}" ]]; then
1616
echo "expected RETH_CHAIN to be set" 1>&2
1717
exit 1
1818
fi
1919

20-
# Add Flashblocks support for base mode
21-
if [[ "$NODE_TYPE" == "base" && -n "${RETH_FB_WEBSOCKET_URL:-}" ]]; then
20+
# Enable Flashblocks support if websocket URL is provided
21+
if [[ -n "${RETH_FB_WEBSOCKET_URL:-}" ]]; then
2222
ADDITIONAL_ARGS="--websocket-url=$RETH_FB_WEBSOCKET_URL"
2323
echo "Enabling Flashblocks support with endpoint: $RETH_FB_WEBSOCKET_URL"
24-
fi
25-
26-
# Select binary based on NODE_TYPE
27-
if [[ "$NODE_TYPE" == "base" ]]; then
28-
echo "Starting Base Reth node"
29-
BINARY="./base-reth-node"
3024
else
31-
echo "Starting OP Reth node"
32-
BINARY="./op-reth"
25+
echo "Running in vanilla node mode (no Flashblocks URL provided)"
3326
fi
3427

3528
# Add pruning for base
36-
if [[ "$NODE_TYPE" == "base" && "${RETH_PRUNING_ARGS+x}" = x ]]; then
29+
if [[ "${RETH_PRUNING_ARGS+x}" = x ]]; then
3730
echo "Adding pruning arguments: $RETH_PRUNING_ARGS"
3831
ADDITIONAL_ARGS="$ADDITIONAL_ARGS $RETH_PRUNING_ARGS"
3932
fi

0 commit comments

Comments
 (0)