Skip to content

Commit e4fb291

Browse files
author
wbnns
authored
Merge branch 'main' into wbnns/update-client-configs
2 parents f1e1f97 + d6794bb commit e4fb291

8 files changed

Lines changed: 94 additions & 8 deletions

File tree

.env.mainnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,7 @@ STATSD_ADDRESS="172.17.0.1"
9595
# NOTE: This feature is experimental and may lead to syncing issues
9696
# 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
9797
# 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
98-
# OP_GETH_SYNCMODE=snap
98+
# OP_GETH_SYNCMODE=snap
99+
100+
# FLASHBLOCKS (OPTIONAL - UNCOMMENT TO ENABLE)
101+
# RETH_FB_WEBSOCKET_URL=wss://mainnet.flashblocks.base.org/ws

.env.sepolia

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,7 @@ STATSD_ADDRESS="172.17.0.1"
9595
# NOTE: This feature is experimental and may lead to syncing issues
9696
# 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
9797
# 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
98-
# OP_GETH_SYNCMODE=snap
98+
# OP_GETH_SYNCMODE=snap
99+
100+
# FLASHBLOCKS (OPTIONAL - UNCOMMENT TO ENABLE)
101+
# RETH_FB_WEBSOCKET_URL=wss://mainnet.flashblocks.base.org/ws

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/geth-data/
33
/reth-data/
44
/nethermind-data/
5-
.DS_Store
5+
.DS_Store

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Base is a secure, low-cost, developer-friendly Ethereum L2 built on Optimism's [
4040
### Supported Clients
4141

4242
- `geth` (default)
43-
- `reth`
43+
- `reth` (with Flashblocks support option, see [Reth Node README](./reth/README.md))
4444
- `nethermind`
4545

4646
## Requirements

docker-compose.yml

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

reth/Dockerfile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,31 @@ WORKDIR /app
2222
RUN apt-get update && apt-get -y upgrade && apt-get install -y git libclang-dev pkg-config curl build-essential
2323

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

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

33+
FROM rust:1.85 AS reth-base
34+
35+
WORKDIR /app
36+
37+
RUN apt-get update && apt-get -y upgrade && \
38+
apt-get install -y git libclang-dev pkg-config curl build-essential && \
39+
rm -rf /var/lib/apt/lists/*
40+
41+
ENV REPO=https://github.com/base/node-reth.git
42+
ENV VERSION=main
43+
ENV COMMIT=c23179dc3531a988e483b05d306539cca99f9a5c
44+
RUN git clone $REPO --branch $VERSION --single-branch . && \
45+
git switch -c branch-$VERSION && \
46+
bash -c '[ "$(git rev-parse HEAD)" = "$COMMIT" ]' || (echo "Commit hash verification failed" && exit 1)
47+
48+
RUN cargo build --bin base-reth-node --release
49+
3350
FROM ubuntu:22.04
3451

3552
RUN apt-get update && \
@@ -41,6 +58,7 @@ WORKDIR /app
4158

4259
COPY --from=op /app/op-node/bin/op-node ./
4360
COPY --from=reth /app/target/maxperf/op-reth ./
61+
COPY --from=reth-base /app/target/release/base-reth-node ./
4462
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
4563
COPY ./reth/reth-entrypoint ./execution-entrypoint
4664
COPY op-node-entrypoint .

reth/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Running a Reth Node
2+
3+
This is a unified implementation of the Reth node set up that supports running both standard Reth or Base Reth with Flashblocks support.
4+
5+
## Setup
6+
7+
- See hardware requirements mentioned in the master README
8+
- For Base Reth mode: Access to a Flashblocks websocket endpoint (for `RETH_FB_WEBSOCKET_URL`)
9+
- We provide public websocket endpoints for mainnet and devnet, included in `.env.mainnet` and `.env.sepolia`
10+
11+
## Node Type Selection
12+
13+
Use the `NODE_TYPE` environment variable to select the implementation:
14+
15+
- `NODE_TYPE=vanilla` - Standard Reth implementation (default)
16+
- `NODE_TYPE=base` - Base L2 Reth implementation with Flashblocks support
17+
18+
## Running the Node
19+
20+
The node follows the standard `docker-compose` workflow in the master README.
21+
22+
```bash
23+
# Run standard Reth node
24+
CLIENT=reth docker-compose up
25+
26+
# Run Base L2 Reth node with Flashblocks support
27+
NODE_TYPE=base CLIENT=reth docker-compose up
28+
```
29+
30+
## Testing Flashblocks RPC Methods
31+
32+
When running in Base mode (`NODE_TYPE=base`), you can query a pending block using the Flashblocks RPC:
33+
34+
```bash
35+
curl -X POST \
36+
--data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["pending", false],"id":1}' \
37+
http://localhost:8545
38+
```
39+
40+
## Additional RPC Methods
41+
42+
For a complete list of supported RPC methods, refer to:
43+
44+
- [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)

reth/reth-entrypoint

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,25 @@ if [[ -z "$RETH_CHAIN" ]]; then
1414
exit 1
1515
fi
1616

17+
# Add Flashblocks support for base mode
18+
if [[ "$NODE_TYPE" == "base" && -n "$RETH_FB_WEBSOCKET_URL" ]]; then
19+
ADDITIONAL_ARGS="--websocket-url=$RETH_FB_WEBSOCKET_URL"
20+
echo "Enabling Flashblocks support with endpoint: $RETH_FB_WEBSOCKET_URL"
21+
fi
22+
23+
# Select binary based on NODE_TYPE
24+
if [[ "$NODE_TYPE" == "base" ]]; then
25+
echo "Starting Base Reth node"
26+
BINARY="./base-reth-node"
27+
else
28+
echo "Starting vanilla Reth node"
29+
BINARY="./op-reth"
30+
fi
31+
1732
mkdir -p $RETH_DATA_DIR
1833
echo "$OP_NODE_L2_ENGINE_AUTH_RAW" > "$OP_NODE_L2_ENGINE_AUTH"
1934

20-
exec ./op-reth node \
35+
exec $BINARY node \
2136
-vvv \
2237
--datadir="$RETH_DATA_DIR" \
2338
--log.stdout.format json \
@@ -40,4 +55,4 @@ exec ./op-reth node \
4055
--chain "$RETH_CHAIN" \
4156
--rollup.sequencer-http=$OP_RETH_SEQUENCER_HTTP \
4257
--rollup.disable-tx-pool-gossip \
43-
$ADDITIONAL_ARGS # intentionally unquoted
58+
$ADDITIONAL_ARGS # intentionally unquoted

0 commit comments

Comments
 (0)