Skip to content

Commit 33c8cc1

Browse files
authored
Chore: Add DummyEL
2 parents ea49ea7 + 5a873be commit 33c8cc1

File tree

10 files changed

+762
-1
lines changed

10 files changed

+762
-1
lines changed

Cargo.lock

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ members = [
6565
"crypto/eth2_wallet",
6666
"crypto/kzg",
6767
"database_manager",
68+
"dummy_el",
6869
"lcli",
6970
"lighthouse",
7071
"lighthouse/environment",

dummy_el/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "dummy_el"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
7+
axum = { workspace = true }
8+
serde = { workspace = true }
9+
serde_json = { workspace = true }
10+
tokio = { workspace = true }
11+
tracing = { workspace = true }
12+
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }
13+
clap = { workspace = true }
14+
anyhow = { workspace = true }
15+
jsonwebtoken = "9"
16+
hex = { workspace = true }
17+
18+
[[bin]]
19+
name = "dummy_el"
20+
path = "src/main.rs"

dummy_el/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Multi-stage build for dummy_el
2+
FROM rust:1.88.0-bullseye AS builder
3+
4+
WORKDIR /build
5+
6+
# Copy the entire workspace (needed for workspace structure)
7+
COPY . .
8+
9+
# Build only dummy_el in release mode
10+
RUN --mount=type=cache,target=/usr/local/cargo/registry \
11+
--mount=type=cache,target=/build/target \
12+
cargo build --release -p dummy_el && \
13+
cp target/release/dummy_el /dummy_el
14+
15+
# Runtime stage with minimal Ubuntu image
16+
FROM ubuntu:22.04
17+
18+
RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-recommends \
19+
ca-certificates \
20+
&& apt-get clean \
21+
&& rm -rf /var/lib/apt/lists/*
22+
23+
# Copy the binary from builder
24+
COPY --from=builder /dummy_el /usr/local/bin/dummy_el
25+
26+
# Create a fake 'geth' binary that runs dummy_el instead
27+
# Kurtosis will call "geth init ..." and "geth --..." but we'll run dummy_el
28+
COPY --from=builder /build/dummy_el/geth-wrapper.sh /usr/local/bin/geth
29+
RUN chmod +x /usr/local/bin/geth
30+
31+
# Expose default Engine API port
32+
EXPOSE 8551

dummy_el/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Using Dummy EL
2+
3+
This is a dummy EL that can be used with proof verification nodes. These nodes do not require an EL to function since they just take in proofs.
4+
5+
## Quick Start
6+
7+
### 1. Build the Docker Image
8+
9+
From the lighthouse repository root:
10+
11+
```bash
12+
docker build -f dummy_el/Dockerfile -t dummy_el:local .
13+
```
14+
15+
### 2. Adding to Kurtosis
16+
17+
In Kurtosis, you can add the following:
18+
19+
```yaml
20+
- el_type: geth
21+
el_image: dummy_el:local
22+
```
23+
24+
Note that we need to use el_type `geth` as kurtosis will be looking for a binary named geth. We wrap calls to the Geth binary so that they are processed by our dummy_el.

dummy_el/geth-wrapper.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# This is a wrapper that pretends to be geth but actually runs dummy_el
5+
# Kurtosis calls: geth init ... && geth --authrpc.port=8551 ...
6+
# We ignore the init, and when we see the actual geth command with authrpc.port, we start dummy_el
7+
8+
echo "[dummy_el geth-wrapper] Called with: $@"
9+
10+
# Check if this is the "geth init" command and ignore it
11+
if echo "$@" | grep -q "init"; then
12+
echo "[dummy_el geth-wrapper] Ignoring 'geth init' command"
13+
exit 0
14+
fi
15+
16+
# If we're here, it's the actual geth run command
17+
# Kurtosis mounts JWT secret at /jwt/jwtsecret
18+
JWT_PATH="/jwt/jwtsecret"
19+
20+
echo "[dummy_el geth-wrapper] Starting dummy_el instead of geth"
21+
22+
# Run dummy_el with JWT if available, otherwise without
23+
if [ -f "$JWT_PATH" ]; then
24+
echo "[dummy_el geth-wrapper] Using JWT from $JWT_PATH"
25+
exec /usr/local/bin/dummy_el --host 0.0.0.0 --port 8551 --jwt-secret "$JWT_PATH"
26+
else
27+
echo "[dummy_el geth-wrapper] WARNING: No JWT file found at $JWT_PATH"
28+
exec /usr/local/bin/dummy_el --host 0.0.0.0 --port 8551
29+
fi

0 commit comments

Comments
 (0)