Skip to content

Commit 20094ff

Browse files
feat(reth): Custom timestamp validation (#114)
* Added Reth with custom timestamp validation * Upadate Cargo.toml reth version * Added github image * Added permissions to github actions * Set logs in reth container to info * Do not publish image on pull_request * Added readme in custom-reth * Change ubuntu image --------- Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
1 parent 1eb7a29 commit 20094ff

10 files changed

Lines changed: 375 additions & 10 deletions

File tree

.github/workflows/docker.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ run-name: Deploy to GHCR by @${{ github.actor }}
44
# Workflow practices adapted from https://docs.github.com/en/actions/tutorials/publish-packages/publish-docker-images
55

66
on:
7+
workflow_dispatch:
78
push:
89
branches:
910
- main
1011
tags:
1112
- "v*"
12-
pull_request:
13-
workflow_dispatch:
1413

1514
permissions:
1615
contents: read

.github/workflows/emerald.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: read
11+
packages: read
1112

1213
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR.
1314
# Ensures that we don't waste CI time, and returns results quicker.
@@ -45,14 +46,20 @@ jobs:
4546
uses: foundry-rs/foundry-toolchain@v1
4647
- name: Run Forge build
4748
run: forge build
49+
- name: Login to GitHub Container Registry
50+
uses: docker/login-action@v3
51+
with:
52+
registry: ghcr.io
53+
username: ${{ github.actor }}
54+
password: ${{ secrets.GITHUB_TOKEN }}
4855
- name: Run emerald
4956
run: |
5057
cargo build
5158
./scripts/generate_testnet_config.sh --nodes 3 --testnet-config-dir .testnet
5259
cargo run --bin emerald -- testnet --home nodes --testnet-config .testnet/testnet_config.toml
5360
ls nodes/*/config/priv_validator_key.json | xargs -I{} cargo run --bin emerald show-pubkey {} > nodes/validator_public_keys.txt
5461
cargo run --bin emerald-utils genesis --public-keys-file ./nodes/validator_public_keys.txt --devnet
55-
docker compose up -d
62+
docker compose up -d reth0 reth1 reth2 prometheus grafana otterscan
5663
./scripts/add_peers.sh --nodes 3
5764
bash scripts/spawn.bash --nodes 3 --home nodes --no-delay --no-wait
5865

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ assets
77
.testnet
88
.claude
99

10+
# Custom-reth build artifacts
11+
custom-reth/target/
12+
custom-reth/Cargo.lock
13+
1014
# Docs and env
1115
example/docs/
1216
.env

compose.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ volumes:
77
services:
88
reth0:
99
network_mode: host
10-
image: ghcr.io/paradigmxyz/reth:v1.9.2
10+
image: ghcr.io/informalsystems/custom-reth:latest
1111
container_name: reth0
1212
volumes:
1313
- reth0:/data
1414
- ./assets:/root/assets/
1515
environment:
1616
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
17+
RUST_LOG: info
1718
command:
1819
- "node"
1920
- "-vvvvv"
@@ -45,13 +46,14 @@ services:
4546
# - "--txpool.queued-max-count=50000" # default=10000
4647
reth1:
4748
network_mode: host
48-
image: ghcr.io/paradigmxyz/reth:v1.9.2
49+
image: ghcr.io/informalsystems/custom-reth:latest
4950
container_name: reth1
5051
volumes:
5152
- reth1:/data
5253
- ./assets:/root/assets/
5354
environment:
5455
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
56+
RUST_LOG: info
5557
command:
5658
- "node"
5759
- "-vvvvv"
@@ -83,13 +85,14 @@ services:
8385
# - "--txpool.queued-max-count=50000" # default=10000
8486
reth2:
8587
network_mode: host
86-
image: ghcr.io/paradigmxyz/reth:v1.9.2
88+
image: ghcr.io/informalsystems/custom-reth:latest
8789
container_name: reth2
8890
volumes:
8991
- reth2:/data
9092
- ./assets:/root/assets/
9193
environment:
9294
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
95+
RUST_LOG: info
9396
command:
9497
- "node"
9598
- "-vvvvv"
@@ -121,7 +124,7 @@ services:
121124
# - "--txpool.queued-max-count=50000" # default=10000
122125
reth3:
123126
network_mode: host
124-
image: ghcr.io/paradigmxyz/reth:v1.9.2
127+
image: ghcr.io/informalsystems/custom-reth:latest
125128
container_name: reth3
126129
volumes:
127130
- reth3:/data

custom-reth/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[workspace]
2+
# Keep this crate out of the parent workspace
3+
4+
[package]
5+
name = "custom-reth"
6+
version = "0.0.1"
7+
edition = "2021"
8+
rust-version = "1.83"
9+
license = "Apache-2.0"
10+
repository = "https://github.com/informalsystems/emerald"
11+
publish = false
12+
13+
[dependencies]
14+
# Reth dependencies, version ghcr.io/paradigmxyz/reth:v1.9.2
15+
reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2", features = [ "node", "consensus", "evm", "cli" ] }
16+
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
17+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
18+
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
19+
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
20+
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
21+
reth-payload-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.2" }
22+
alloy-rpc-types-engine = { version = "1.0" }
23+
24+
eyre = "0.6"
25+
26+
[[bin]]
27+
name = "custom-reth"
28+
path = "src/main.rs"

custom-reth/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM rustlang/rust:nightly-trixie-slim AS builder
2+
3+
RUN apt-get update && apt-get install -y \
4+
build-essential \
5+
clang \
6+
cmake \
7+
libclang-dev \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
11+
WORKDIR /build
12+
13+
COPY Cargo.toml ./
14+
COPY src ./src
15+
16+
RUN ls -la
17+
18+
RUN cargo build --release --bin custom-reth
19+
20+
FROM debian:trixie-slim
21+
22+
RUN apt-get update && apt-get install -y \
23+
ca-certificates \
24+
libssl3 \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
COPY --from=builder /build/target/release/custom-reth /usr/local/bin
28+
29+
ENTRYPOINT ["/usr/local/bin/custom-reth"]

custom-reth/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)