Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true
# OP_GETH_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301
# OP_NETHERMIND_BOOTNODES=enode://87a32fd13bd596b2ffca97020e31aef4ddcc1bbd4b95bb633d16c1329f654f34049ed240a36b449fda5e5225d70fe40bc667f53c304b71f8e68fc9d448690b51@3.231.138.188:30301,enode://ca21ea8f176adb2e229ce2d700830c844af0ea941a1d8152a9513b966fe525e809c3a6c73a2c18a12b74ed6ec4380edf91662778fe0b79f6a591236e49e176f9@184.72.129.189:30301,enode://acf4507a211ba7c1e52cdf4eef62cdc3c32e7c9c47998954f7ba024026f9a6b2150cd3f0b734d9c78e507ab70d59ba61dfe5c45e1078c7ad0775fb251d7735a2@3.220.145.177:30301,enode://8a5a5006159bf079d06a04e5eceab2a1ce6e0f721875b2a9c96905336219dbe14203d38f70f3754686a6324f786c2f9852d8c0dd3adac2d080f4db35efc678c5@3.231.11.52:30301,enode://cdadbe835308ad3557f9a1de8db411da1a260a98f8421d62da90e71da66e55e98aaa8e90aa7ce01b408a54e4bd2253d701218081ded3dbe5efbbc7b41d7cef79@54.198.153.150:30301
# OP_GETH_SYNCMODE=snap

# For Flashblocks node
# RETH_FB_WEBSOCKET_URL=wss://mainnet.flashblocks.base.org/ws
3 changes: 3 additions & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ OP_NODE_ROLLUP_LOAD_PROTOCOL_VERSIONS=true
# OP_GETH_BOOTNODES=enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301,enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301
# OP_NETHERMIND_BOOTNODES=enode://548f715f3fc388a7c917ba644a2f16270f1ede48a5d88a4d14ea287cc916068363f3092e39936f1a3e7885198bef0e5af951f1d7b1041ce8ba4010917777e71f@18.210.176.114:30301,enode://6f10052847a966a725c9f4adf6716f9141155b99a0fb487fea3f51498f4c2a2cb8d534e680ee678f9447db85b93ff7c74562762c3714783a7233ac448603b25f@107.21.251.55:30301
# OP_GETH_SYNCMODE=snap

# For Flashblocks node
# RETH_FB_WEBSOCKET_URL=wss://sepolia.flashblocks.base.org/ws
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/geth-data/
/reth-data/
/nethermind-data/
.DS_Store
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ docker compose up --build
>
> Supported clients:
> - geth
> - reth
> - reth (with Flashblocks support option, see [Reth Node README](./reth/README.md))
> - nethermind

4. You should now be able to `curl` your Base node:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
command: [ "bash", "./execution-entrypoint" ]
volumes:
- ${HOST_DATA_DIR}:/data
environment:
- NODE_TYPE=${NODE_TYPE:-vanilla}
env_file:
- ${NETWORK_ENV:?.env.mainnet} # Requires NETWORK_ENV to be set, defaults to mainnet
node:
Expand Down
22 changes: 20 additions & 2 deletions reth/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,31 @@ WORKDIR /app
RUN apt-get update && apt-get -y upgrade && apt-get install -y git libclang-dev pkg-config curl build-essential

ENV REPO=https://github.com/paradigmxyz/reth.git
ENV VERSION=v1.3.11
ENV COMMIT=e0e85aa10b98fa92d32c3e820c7ed2cee0b02931
ENV VERSION=v1.3.12
ENV COMMIT=6f8e7258f4733279080e4bd8345ce50538a40d6e
RUN git clone $REPO --branch $VERSION --single-branch . && \
git switch -c branch-$VERSION && \
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]'

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

FROM rust:1.85 AS reth-base

WORKDIR /app

RUN apt-get update && apt-get -y upgrade && \
apt-get install -y git libclang-dev pkg-config curl build-essential && \
rm -rf /var/lib/apt/lists/*

ENV REPO=https://github.com/base/node-reth.git
ENV VERSION=main
ENV COMMIT=c23179dc3531a988e483b05d306539cca99f9a5c
RUN git clone $REPO --branch $VERSION --single-branch . && \
git switch -c branch-$VERSION && \
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)

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

FROM ubuntu:22.04

RUN apt-get update && \
Expand All @@ -41,6 +58,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 supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./reth/reth-entrypoint ./execution-entrypoint
COPY op-node-entrypoint .
Expand Down
45 changes: 45 additions & 0 deletions reth/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Running a Reth Node

This is a unified implementation of the Reth node set up that supports running both standard Reth or Base Reth with Flashblocks support.

## Setup

- See hardware requirements mentioned in the master README
- For Base Reth 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:

- `NODE_TYPE=vanilla` - Standard Reth implementation (default)
- `NODE_TYPE=base` - Base L2 Reth implementation with Flashblocks support

## Running the Node

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

```bash
# Run standard Reth node
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:

```bash
curl -X POST \
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending", false],"id":1}' \
http://localhost:8545
```

## Additional RPC Methods

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)
21 changes: 19 additions & 2 deletions reth/reth-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,32 @@ RPC_PORT="${RPC_PORT:-8545}"
WS_PORT="${WS_PORT:-8546}"
AUTHRPC_PORT="${AUTHRPC_PORT:-8551}"
METRICS_PORT="${METRICS_PORT:-6060}"
ADDITIONAL_ARGS=""

if [[ -z "$RETH_CHAIN" ]]; then
echo "expected RETH_CHAIN to be set" 1>&2
exit 1
fi

# Add Flashblocks support for base mode
if [[ "$NODE_TYPE" == "base" && -n "$RETH_FB_WEBSOCKET_URL" ]]; then
ADDITIONAL_ARGS="--websocket-url=$RETH_FB_WEBSOCKET_URL"
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 vanilla Reth node"
BINARY="./op-reth"
fi

mkdir -p $RETH_DATA_DIR
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"

exec ./op-reth node \
exec $BINARY node \
-vvv \
--datadir="$RETH_DATA_DIR" \
--log.stdout.format log-fmt \
Expand All @@ -35,4 +51,5 @@ exec ./op-reth node \
--metrics=0.0.0.0:"$METRICS_PORT" \
--chain "$RETH_CHAIN" \
--rollup.sequencer-http=$RETH_SEQUENCER_HTTP \
--rollup.disable-tx-pool-gossip
--rollup.disable-tx-pool-gossip \
$ADDITIONAL_ARGS