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
2 changes: 1 addition & 1 deletion DockerfileOp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN cargo build --profile $BUILD_PROFILE --features "$FEATURES" --bin op-reth --
RUN ls -la /app/target/$BUILD_PROFILE/op-reth
RUN cp /app/target/$BUILD_PROFILE/op-reth /app/op-reth

FROM ubuntu:22.04 AS runtime
FROM ubuntu:24.04 AS runtime

RUN apt-get update && \
apt-get install -y ca-certificates libssl-dev pkg-config strace && \
Expand Down
45 changes: 45 additions & 0 deletions crates/optimism/tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Variables
DOCKER_IMAGE_NAME := op-reth
DOCKER_TAG := local
DOCKERFILE_PATH := ../../../DockerfileOp
KURTOSIS_PACKAGE := github.com/ethpandaops/optimism-package@1.4.0
DEVNET := simple-historical-proof
GO_PKG_NAME := proofs
SOURCE_DIR := $(shell pwd)

.PHONY: all build run clean help

# Default target
all: build run

# Build the op-reth Docker image
build:
@echo "Building $(DOCKER_IMAGE_NAME):$(DOCKER_TAG) Docker image..."
cd ../../../ && docker build -f $(notdir $(DOCKERFILE_PATH)) -t $(DOCKER_IMAGE_NAME):$(DOCKER_TAG) .

# Run Kurtosis with the optimism devnet
run:
@echo "Starting Optimism devnet with historical proof configuration..."
@DEVNET_PATH="./devnets/$(DEVNET).yaml"; \
if [ ! -z "$(DEVNET_CUSTOM_PATH)" ]; then \
DEVNET_PATH="$(DEVNET_CUSTOM_PATH)"; \
fi; \
kurtosis run $(KURTOSIS_PACKAGE) --args-file $$DEVNET_PATH --enclave $(DEVNET)

# Run E2E tests using Kurtosis
test-e2e-kurtosis:
@echo "Running E2E tests with Kurtosis for $(DEVNET)"
@DEVNET_PATH="$(SOURCE_DIR)/devnets/$(DEVNET).yaml"; \
if [ ! -z "$(DEVNET_CUSTOM_PATH)" ]; then \
DEVNET_PATH="$(DEVNET_CUSTOM_PATH)"; \
fi; \
export OP_DEPLOYER_ARTIFACTS="$(SOURCE_DIR)/artifacts"; \
export DEVNET_ENV_URL="ktnative://$(DEVNET)$$DEVNET_PATH"; \
export DISABLE_OP_E2E_LEGACY=true; \
export DEVSTACK_ORCHESTRATOR=sysext; \
go test -count=1 -timeout 40m -v ./$(GO_PKG_NAME)

# Stop and clean Kurtosis services
clean:
@echo "Cleaning up Kurtosis services..."
kurtosis clean -a
66 changes: 66 additions & 0 deletions crates/optimism/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# E2E tests for op-reth

This folder contains the end-to-end testing resources for op-reth. Tests use the Optimism "devstack" (from the Optimism monorepo) and Kurtosis to deploy ephemeral devnets.

This README documents common workflows and Makefile commands used to build the local Docker image, start the devnet with Kurtosis, run e2e tests, and clean up resources.

## Prerequisites

- Docker (Desktop) running on your machine
- Kurtosis CLI installed and able to reach the Kurtosis engine
- Go (to run Go-based e2e tests)

## Commands (Makefile targets)

Build the Docker image used by the devnet (tags `op-reth:local`):

```sh
make build
```

Start the Optimism devnet (default: `simple-historical-proof`):

```sh
# uses the Makefile's DEVNET variable (devnets/<DEVNET>.yaml)
make run

# or with a custom devnet YAML path
make run DEVNET_CUSTOM_PATH=/absolute/path/to/devnet.yaml
```

Run the e2e test suite that exercises the deployed devnet (Go tests):

```sh
# runs go test with a long timeout; set GO_PKG_NAME to the package to test
make test-e2e-kurtosis

# run a specific test or package
make test-e2e-kurtosis GO_PKG_NAME=path/to/pkg
```

Stop and remove Kurtosis resources (cleanup):

```sh
make clean
```

## Implementation notes

- The Makefile in this directory calls the repository root `DockerfileOp` to build an op-reth image tagged `op-reth:local`.
- The default Kurtosis package used is `github.com/ethpandaops/optimism-package@1.4.0`. The Makefile passes the YAML under `devnets/$(DEVNET).yaml` to `kurtosis run`.

## Quick workflow example

```sh
# build image
make build

# start devnet
make run

# run tests (set GO_PKG_NAME if needed)
make test-e2e-kurtosis GO_PKG_NAME=proofs

# cleanup
make clean
```
54 changes: 54 additions & 0 deletions crates/optimism/tests/devnets/simple-historical-proof.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# A simple network configuration for kurtosis (https://github.com/ethpandaops/optimism-package)
# Spins up a 2 EL/CL networks. One with op-geth/op-node and one with op-reth/op-node.

optimism_package:
faucet:
enabled: true
chains:
chain0:
# Chain with only two nodes
participants:
sequencer:
el:
type: op-geth
log_level: "debug"
cl:
type: op-node
log_level: "debug"
sequencer: true
validator:
el:
type: op-reth
# Note: we use the local image for now. This allows us to run the tests in CI pipelines without publishing new docker images every time.
image: op-reth:local
extra_params: [--proofs-history, --proofs-history.storage-path=/data/proofs-history]
cl:
type: op-node
log_level: "debug"
sequencer: false
network_params:
network: "kurtosis"
network_id: "2151908"
seconds_per_slot: 2
global_log_level: "info"
global_node_selectors: {}
global_tolerations: []
persistent: false
ethereum_package:
participants:
- el_type: geth
cl_type: teku
cl_image: consensys/teku:25.7.1
network_params:
preset: minimal
genesis_delay: 5
additional_preloaded_contracts: '
{
"0x4e59b44847b379578588920cA78FbF26c0B4956C": {
"balance": "0ETH",
"code": "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf3",
"storage": {},
"nonce": "1"
}
}
'
Loading