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
55 changes: 50 additions & 5 deletions apps/evm/single/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ This directory contains the implementation of a single EVM sequencer using Rollk

- Go 1.20 or later
- Docker and Docker Compose
- Access to the go-execution-evm repository

## Starting the Aggregator Node
## Starting the Sequencer Node

1. Both EVM and DA layers must be running before starting the aggregator
1. For the EVM layer, Reth can be conveniently run using `docker compose` from the go-execution-evm repository.
1. Both EVM and DA layers must be running before starting the sequencer
1. For the EVM layer, Reth can be conveniently run using `docker compose` from <path_to>/execution/evm/docker.
2. For the DA layer, local-da can be built and run from the `rollkit/da/cmd/local-da` directory.

2. Build the sequencer:
Expand All @@ -37,7 +36,11 @@ This directory contains the implementation of a single EVM sequencer using Rollk
--rollkit.signer.passphrase secret
```

Note: Replace `<path_to>` with the actual path to your go-execution-evm repository.
Note: Replace `<path_to>` with the actual path to the rollkit repository. If you'd ever like to restart a fresh node, make sure to remove the originally created sequencer node directory using:

```bash
rm -rf ~/.evm-single
```

## Configuration

Expand All @@ -48,3 +51,45 @@ The sequencer can be configured using various command-line flags. The most impor
- `--evm.jwt-secret`: JWT secret for EVM communication
- `--evm.genesis-hash`: Genesis hash of the EVM chain
- `--rollkit.node.block_time`: Block time for the Rollkit node

## Rollkit EVM Full Node

1. The sequencer must be running before starting any Full Node. You can run the EVM layer of the Full Node using `docker-compose -f docker-compose-full-node.yml` from <path_to>/execution/evm/docker.

2. Initialize the full node:
```bash
./evm-single init --home ~/.evm-single-full-node
```
3. Copy the genesis file from the sequencer node:
```bash
cp ~/.evm-single/config/genesis.json ~/.evm-single-full-node/config/genesis.json
```
4. Identify the sequencer node's P2P address from its logs. It will look similar to:
```
1:55PM INF listening on address=/ip4/127.0.0.1/tcp/7676/p2p/12D3KooWJ1J5W7vpHuyktcvc71iuduRgb9pguY9wKMNVVPwweWPk module=main
```

Create an environment variable with the P2P address:
```bash
export P2P_ID="12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh"
```

5. Start the full node:

```bash
./evm-single start \
--home ~/.evm-single-full-node \
--evm.jwt-secret $(cat ../../../execution/evm/docker/jwttoken/jwt.hex) \
--evm.genesis-hash 0x2b8bbb1ea1e04f9c9809b4b278a8687806edc061a356c7dbc491930d8e922503 \
--rollkit.rpc.address=127.0.0.1:46657 \
--rollkit.p2p.listen_address=/ip4/127.0.0.1/tcp/7677 \
--rollkit.p2p.peers=/ip4/127.0.0.1/tcp/7676/p2p/$P2P_ID \
--evm.engine-url http://localhost:8561 \
--evm.eth-url http://localhost:8555
```

If you'd ever like to restart a fresh node, make sure to remove the originally created full node directory using:

```bash
rm -rf ~/.evm-single-full-node
```
83 changes: 54 additions & 29 deletions apps/evm/single/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: "3.8"

services:
reth:
container_name: reth
rollkit-reth:
container_name: rollkit-reth
restart: unless-stopped
image: ghcr.io/paradigmxyz/reth:v1.4.6
image: ghcr.io/rollkit/lumen:latest
ports:
- "9001:9001" # metrics
- "30303:30303" # eth/66 peering
Expand All @@ -15,29 +15,54 @@ services:
- ./chain:/root/chain:ro
- ./jwttoken:/root/jwt:ro
- logs:/root/logs
entrypoint: /bin/sh -c
command:
- |
reth node \
--chain /root/chain/genesis.json \
--metrics 0.0.0.0:9001 \
--log.file.directory /root/logs \
--authrpc.addr 0.0.0.0 \
--authrpc.port 8551 \
--authrpc.jwtsecret /root/jwt/jwt.hex \
--http --http.addr 0.0.0.0 --http.port 8545 \
--http.api "eth,net,web3,txpool" \
--ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api eth,net,web3 \
--engine.persistence-threshold 0 \
--engine.memory-block-buffer-target 0 \
--disable-discovery \
--txpool.pending-max-count 200000 \
--txpool.pending-max-size 200 \
--txpool.queued-max-count 200000 \
--txpool.queued-max-size 200 \
--txpool.max-account-slots 2048 \
--txpool.max-new-txns 2048 \
--txpool.additional-validation-tasks 16
- node
- --chain
- /root/chain/genesis.json
- --metrics
- 0.0.0.0:9001
- --log.file.directory
- /root/logs
- --authrpc.addr
- 0.0.0.0
- --authrpc.port
- "8551"
- --authrpc.jwtsecret
- /root/jwt/jwt.hex
- --http
- --http.addr
- 0.0.0.0
- --http.port
- "8545"
- --http.api
- eth,net,web3,txpool
- --ws
- --ws.addr
- 0.0.0.0
- --ws.port
- "8546"
- --ws.api
- eth,net,web3
- --engine.persistence-threshold
- "0"
- --engine.memory-block-buffer-target
- "0"
- --disable-discovery
- --txpool.pending-max-count
- "200000"
- --txpool.pending-max-size
- "200"
- --txpool.queued-max-count
- "200000"
- --txpool.queued-max-size
- "200"
- --txpool.max-account-slots
- "2048"
- --txpool.max-new-txns
- "2048"
- --txpool.additional-validation-tasks
- "16"
- --rollkit.enable
networks:
- rollkit-network

Expand All @@ -50,18 +75,18 @@ services:
- rollkit-network

rollkit-evm-single:
image: ghcr.io/rollkit/rollkit-evm-single:v0.1.5
image: ghcr.io/rollkit/rollkit-evm-single:v0.1.6
depends_on:
reth:
rollkit-reth:
condition: service_started
local-da:
condition: service_started
Comment on lines +80 to 83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Raise: verify depends_on conditions.

In Compose v3.8, condition: service_started is not supported locally (only Swarm); use healthchecks with condition: service_healthy or custom wait logic.

🤖 Prompt for AI Agents
In apps/evm/single/docker-compose.yml around lines 55 to 58, the use of
'condition: service_started' under 'depends_on' is not supported in Compose v3.8
for local environments. Replace 'condition: service_started' with healthchecks
for the respective services and update the condition to 'service_healthy'.
Define appropriate healthcheck configurations for the services to ensure they
are fully ready before dependent services start.

volumes:
- evm-single-data:/data
entrypoint: /usr/bin/entrypoint.sh
environment:
- EVM_ENGINE_URL=http://reth:8551
- EVM_ETH_URL=http://reth:8545
- EVM_ENGINE_URL=http://rollkit-reth:8551
- EVM_ETH_URL=http://rollkit-reth:8545
- EVM_JWT_SECRET=f747494bb0fb338a0d71f5f9fe5b5034c17cc988c229b59fd71e005ee692e9bf
- EVM_GENESIS_HASH=0x2b8bbb1ea1e04f9c9809b4b278a8687806edc061a356c7dbc491930d8e922503
- EVM_BLOCK_TIME=1s
Expand Down
1 change: 1 addition & 0 deletions block/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (m *Manager) SyncLoop(ctx context.Context, errCh chan<- error) {
"daHeight", daHeight,
"hash", dataHash,
"height", dataHeight,
"txs", len(data.Txs),
)

if m.dataCache.IsSeen(dataHash) {
Expand Down
89 changes: 89 additions & 0 deletions execution/evm/docker/docker-compose-full-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: "rollkit-reth-full-node"

services:
jwt-init-full-node:
container_name: jwt-init-full-node
image: alpine:3.19
volumes:
- ./jwttoken:/jwt
healthcheck:
test: ["CMD", "test", "-f", "/jwt/jwt.hex"]
interval: 5s
timeout: 5s
retries: 3
command: >
/bin/sh -c "mkdir -p /jwt &&
if [ ! -f /jwt/jwt.hex ]; then
apk add --no-cache openssl &&
openssl rand -hex 32 | tr -d '\n' > /jwt/jwt.hex;
fi"

rollkit-reth-full-node:
container_name: rollkit-reth-full-node
restart: unless-stopped
image: ghcr.io/rollkit/lumen:latest
depends_on:
jwt-init-full-node:
condition: service_completed_successfully
ports:
- "9011:9001" # metrics
- "30313:30303" # eth/66 peering
- "8555:8545" # rpc
- "8561:8551" # engine
- "8556:8546" # ws
volumes:
- ./chain:/root/chain:ro
- ./jwttoken:/root/jwt:ro
- logs-full-node:/root/logs
command:
- node
- --chain
- /root/chain/genesis.json
- --metrics
- 0.0.0.0:9001
- --log.file.directory
- /root/logs
- --authrpc.addr
- 0.0.0.0
- --authrpc.port
- "8551"
- --authrpc.jwtsecret
- /root/jwt/jwt.hex
- --http
- --http.addr
- 0.0.0.0
- --http.port
- "8545"
- --http.api
- eth,net,web3,txpool
- --ws
- --ws.addr
- 0.0.0.0
- --ws.port
- "8546"
- --ws.api
- eth,net,web3
- --engine.persistence-threshold
- "0"
- --engine.memory-block-buffer-target
- "0"
- --disable-discovery
- --txpool.pending-max-count
- "200000"
- --txpool.pending-max-size
- "200"
- --txpool.queued-max-count
- "200000"
- --txpool.queued-max-size
- "200"
- --txpool.max-account-slots
- "2048"
- --txpool.max-new-txns
- "2048"
- --txpool.additional-validation-tasks
- "16"
- --rollkit.enable

volumes:
logs-full-node:
driver: local
88 changes: 58 additions & 30 deletions execution/evm/docker/docker-compose.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "reth"
name: "rollkit-reth"

services:
jwt-init:
Expand All @@ -18,46 +18,74 @@ services:
openssl rand -hex 32 | tr -d '\n' > /jwt/jwt.hex;
fi"

reth:
container_name: reth
rollkit-reth:
container_name: rollkit-reth
restart: unless-stopped
image: ghcr.io/paradigmxyz/reth:v1.4.6
image: ghcr.io/rollkit/lumen:latest
depends_on:
jwt-init:
condition: service_completed_successfully
ports:
- "9001:9001" # metrics
- "9001:9001" # metrics
- "30303:30303" # eth/66 peering
- "8545:8545" # rpc
- "8551:8551" # engine
- "8546:8546" # ws
- "8545:8545" # HTTP RPC
- "8551:8551" # Engine API (authenticated)
- "8546:8546" # WebSocket RPC
volumes:
- ./chain:/root/chain:ro
- ./jwttoken:/root/jwt:ro
- logs:/root/logs
entrypoint: /bin/sh -c
# environment:
# - RUST_LOG=info,lumen=debug,lumen_node=debug,lumen_rollkit=debug
# - RUST_BACKTRACE=1
command:
- |
reth node \
--chain /root/chain/genesis.json \
--metrics 0.0.0.0:9001 \
--log.file.directory /root/logs \
--authrpc.addr 0.0.0.0 \
--authrpc.port 8551 \
--authrpc.jwtsecret /root/jwt/jwt.hex \
--http --http.addr 0.0.0.0 --http.port 8545 \
--http.api "eth,net,web3,txpool" \
--ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api eth,net,web3 \
--engine.persistence-threshold 0 \
--engine.memory-block-buffer-target 0 \
--disable-discovery \
--txpool.pending-max-count 200000 \
--txpool.pending-max-size 200 \
--txpool.queued-max-count 200000 \
--txpool.queued-max-size 200 \
--txpool.max-account-slots 2048 \
--txpool.max-new-txns 2048 \
--txpool.additional-validation-tasks 16
- node
- --chain
- /root/chain/genesis.json
- --metrics
- 0.0.0.0:9001
- --log.file.directory
- /root/logs
- --authrpc.addr
- 0.0.0.0
- --authrpc.port
- "8551"
- --authrpc.jwtsecret
- /root/jwt/jwt.hex
- --http
- --http.addr
- 0.0.0.0
- --http.port
- "8545"
- --http.api
- eth,net,web3,txpool
- --ws
- --ws.addr
- 0.0.0.0
- --ws.port
- "8546"
- --ws.api
- eth,net,web3
- --engine.persistence-threshold
- "0"
- --engine.memory-block-buffer-target
- "0"
- --disable-discovery
- --txpool.pending-max-count
- "200000"
- --txpool.pending-max-size
- "200"
- --txpool.queued-max-count
- "200000"
- --txpool.queued-max-size
- "200"
- --txpool.max-account-slots
- "2048"
- --txpool.max-new-txns
- "2048"
- --txpool.additional-validation-tasks
- "16"
- --rollkit.enable

volumes:
logs:
Expand Down
Loading