Skip to content

Commit 00c1154

Browse files
authored
feat: add goevmlab (#246)
1 parent 1bd64ea commit 00c1154

4 files changed

Lines changed: 343 additions & 1 deletion

File tree

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Build goevmlab docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repository:
7+
description: The source goevmlab repository to build from
8+
default: holiman/goevmlab
9+
type: string
10+
required: true
11+
ref:
12+
description: The branch, tag or SHA to checkout and build from
13+
default: main
14+
type: string
15+
required: true
16+
docker_tag:
17+
description: Override target docker tag (defaults to the above source ref if left blank)
18+
type: string
19+
required: false
20+
21+
jobs:
22+
prepare:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
platforms: ${{ steps.setup.outputs.platforms }}
26+
target_tag: ${{ steps.tag.outputs.docker_tag }}
27+
steps:
28+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
- name: Prepare Matrix
30+
id: setup
31+
uses: ./.github/actions/prepare
32+
with:
33+
client: 'goevmlab'
34+
- name: Generate target tag
35+
id: tag
36+
uses: ./.github/actions/docker-tag
37+
with:
38+
input: ${{ inputs.docker_tag || inputs.ref }}
39+
deploy:
40+
needs:
41+
- prepare
42+
runs-on: ${{ matrix.runner }}
43+
continue-on-error: true
44+
strategy:
45+
matrix:
46+
include: ${{fromJson(needs.prepare.outputs.platforms)}}
47+
outputs:
48+
git_commit_hash: ${{ steps.set_output.outputs.git_commit_hash }}
49+
steps:
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
- uses: ./.github/actions/install-deps
52+
with:
53+
repository: ${{ inputs.repository }}
54+
- uses: ./.github/actions/deploy
55+
id: deploy
56+
with:
57+
source_repository: ${{ inputs.repository }}
58+
source_ref: ${{ inputs.ref }}
59+
target_tag: ${{ needs.prepare.outputs.target_tag }}-${{ matrix.slug }}
60+
target_repository: ethpandaops/goevmlab
61+
target_dockerfile: ./goevmlab/Dockerfile
62+
platform: ${{ matrix.platform }}
63+
64+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
65+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
66+
MACOS_PASSWORD: "${{ secrets.MACOS_PASSWORD }}"
67+
GOPROXY: "${{ vars.GOPROXY }}"
68+
69+
# This step captures the git commit hash from the deploy action for job output
70+
- name: Set job output
71+
id: set_output
72+
run: echo "git_commit_hash=${{ steps.deploy.outputs.git_commit_hash }}" >> $GITHUB_OUTPUT
73+
shell: bash
74+
manifest:
75+
needs:
76+
- prepare
77+
- deploy
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
81+
- uses: ./.github/actions/manifest
82+
with:
83+
source_repository: ${{ inputs.repository }}
84+
source_ref: ${{ inputs.ref }}
85+
target_tag: ${{ needs.prepare.outputs.target_tag }}
86+
target_repository: ethpandaops/goevmlab
87+
platforms: ${{ needs.prepare.outputs.platforms }}
88+
harbor_registry: ${{ vars.HARBOR_REGISTRY }}
89+
HARBOR_USERNAME: "${{ vars.HARBOR_USERNAME }}"
90+
HARBOR_PASSWORD: "${{ secrets.HARBOR_PASSWORD }}"
91+
git_commit_hash: ${{ needs.deploy.outputs.git_commit_hash }}
92+
93+
DOCKER_USERNAME: "${{ vars.DOCKER_USERNAME }}"
94+
DOCKER_PASSWORD: "${{ secrets.DOCKER_PASSWORD }}"
95+
notify:
96+
name: Discord Notification
97+
runs-on: ubuntu-latest
98+
needs:
99+
- prepare
100+
- deploy
101+
- manifest
102+
if: failure()
103+
steps:
104+
- name: Notify
105+
uses: nobrayner/discord-webhook@1766a33bf571acdcc0678f00da4fb83aad01ebc7 # v1
106+
with:
107+
github-token: ${{ secrets.github_token }}
108+
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}

config.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@
666666
target:
667667
tag: fulu
668668
repository: ethpandaops/rustic-builder
669-
669+
670670
#############
671671
# mev-boost #
672672
#############
@@ -686,3 +686,13 @@
686686
target:
687687
tag: main
688688
repository: ethpandaops/mev-boost-relay
689+
690+
#################
691+
# goevmlab #
692+
#################
693+
- source:
694+
repository: holiman/goevmlab
695+
ref: main
696+
target:
697+
tag: main
698+
repository: ethpandaops/goevmlab

goevmlab/Dockerfile

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
#
2+
# The Mega Dockerfile
3+
#
4+
# This dockerfile is an attempt to bundle the following components into
5+
# one big dockerfile:
6+
#
7+
# - [x] Goevmlab binary 'generic-fuzzer'
8+
# - [x] Go-ethereum binary 'evm'
9+
# - [x] Erigon binary 'evm'
10+
# - [x] EvmOne vm binary 'evmone'
11+
# - [x] Reth VM binary 'revme'
12+
# - [x] Besu
13+
# - [x] Nethermind
14+
# - [x] Nimbus-eth1
15+
#
16+
17+
#---------------------------------------------------------------
18+
# golang-builder (debian-based)
19+
#---------------------------------------------------------------
20+
FROM golang:latest as golang-builder
21+
22+
#
23+
# Go-evmlab
24+
#
25+
26+
RUN git clone https://github.com/holiman/goevmlab --depth 1
27+
RUN cd goevmlab && \
28+
go build ./cmd/generic-fuzzer && \
29+
go build ./cmd/generic-generator && \
30+
go build ./cmd/checkslow && \
31+
go build ./cmd/minimizer && \
32+
go build ./cmd/repro && \
33+
go build ./cmd/runtest && \
34+
go build ./cmd/tracediff && \
35+
go build ./cmd/traceview && \
36+
go test -c ./evms
37+
#
38+
# GETH
39+
#
40+
41+
RUN git clone https://github.com/ethereum/go-ethereum --depth 1
42+
RUN cd go-ethereum && go run build/ci.go install -static ./cmd/evm
43+
44+
#
45+
# Erigon
46+
#
47+
RUN git clone https://github.com/ledgerwatch/erigon --depth 1
48+
RUN cd erigon && mkdir /erigon/ && make evm && \
49+
cp ./build/bin/evm /erigon_vm && \
50+
cp $(bash ./turbo/silkworm/silkworm_lib_path.sh) /libsilkworm_capi.so
51+
52+
53+
#
54+
# NIMBUS-ETH1
55+
#
56+
57+
RUN apt-get update -q && apt-get install -qy --no-install-recommends make
58+
RUN git clone https://github.com/status-im/nimbus-eth1.git --depth 1 --recurse-submodules && \
59+
cd nimbus-eth1 && make -j8 update && \
60+
make -j8 evmstate && cp ./tools/evmstate/evmstate /evmstate
61+
62+
63+
#---------------------------------------------------------------
64+
# debian-builder
65+
#---------------------------------------------------------------
66+
67+
#
68+
# EVMONE
69+
#
70+
#
71+
# evmone requires g++ v13, which is _not_ available in debian bookworm (the golang image)
72+
# but it works with debian:testing (at the time of writing this)
73+
74+
FROM debian:testing as debian-builder
75+
RUN apt-get update -q && apt-get install -qy --no-install-recommends git make \
76+
ca-certificates g++ cmake ninja-build libgmp-dev
77+
78+
RUN git clone https://github.com/ethereum/evmone.git --depth 1 --recurse-submodules
79+
RUN cd evmone && cmake -S . -B build -DEVMONE_TESTING=ON -DEVMONE_PRECOMPILES_SILKPRE=1
80+
RUN cd evmone && cmake --build build --parallel
81+
RUN cp /evmone/build/bin/evmone-statetest /evmone-statetest
82+
RUN ls -la /evmone/build/lib/libevmone.so.*
83+
RUN cp /evmone/build/lib/libevmone.so.* /
84+
#---------------------------------------------------------------
85+
# rust-builder
86+
#---------------------------------------------------------------
87+
88+
#
89+
# RETH
90+
#
91+
92+
FROM lukemathwalker/cargo-chef:latest-rust-1 AS rust-builder
93+
RUN apt-get update -q && apt-get install -qy --no-install-recommends libclang-dev pkg-config
94+
RUN git clone https://github.com/bluealloy/revm.git --depth 1
95+
RUN cd revm && cargo build --release --package revme
96+
97+
98+
#---------------------------------------------------------------
99+
# dotnet-builder
100+
#---------------------------------------------------------------
101+
102+
103+
#
104+
# NETHERMIND
105+
#
106+
107+
FROM mcr.microsoft.com/dotnet/sdk:9.0-noble AS dotnet-builder
108+
RUN git clone https://github.com/NethermindEth/nethermind --depth 1
109+
110+
RUN cd nethermind/src/Nethermind/Nethermind.Test.Runner && dotnet publish --self-contained true -r linux-x64 -c Release
111+
RUN mkdir /out && mv nethermind/src/Nethermind/artifacts/bin/Nethermind.Test.Runner/release_linux-x64 /out/neth
112+
113+
# also txparse
114+
RUN cd nethermind/tools/TxParser && dotnet publish --self-contained true -r linux-x64 -c Release
115+
# winds up at /out/neth/TxParser
116+
RUN cp -rT /nethermind/tools/artifacts/publish/TxParser/release_linux-x64/ /out/neth/
117+
118+
#---------------------------------------------------------------
119+
# java-builder
120+
#---------------------------------------------------------------
121+
122+
#
123+
# BESU
124+
#
125+
126+
FROM ubuntu:24.04 as java-builder
127+
128+
RUN apt-get update -q && apt-get install -qy --no-install-recommends git ca-certificates \
129+
openjdk-21-jdk-headless=21* libjemalloc-dev=5.*
130+
RUN git clone https://github.com/hyperledger/besu.git --depth 1 #--recurse-submodules
131+
RUN cd besu && ./gradlew --parallel ethereum:evmtool:installDist
132+
RUN mkdir /out && mv besu/ethereum/evmtool/build/install/evmtool /out/evmtool
133+
134+
#
135+
# Main non-builder
136+
#
137+
138+
FROM debian:testing
139+
140+
# nethtest requires libssl-dev
141+
# besu requires openjdk-21-jre
142+
# evmone requires GLIBC_2.38 (libstdc++-13-dev) (https://github.com/holiman/goevmlab/issues/144)
143+
# EELS requires (see https://github.com/ethereum/execution-specs/issues/976)
144+
# - pipx, git,
145+
# - curl (for installing rust),
146+
# - gcc for building 'py-arkworks-bls12381',
147+
# - python3-dev for bulding 'lru-dict'
148+
# - pkg-config (see https://github.com/ethereum/execution-specs/issues/1103)
149+
RUN apt-get update -q && \
150+
apt-get install -qy --no-install-recommends \
151+
libssl-dev \
152+
openjdk-21-jre-headless \
153+
libstdc++-13-dev \
154+
pipx git curl gcc python3-dev pkg-config \
155+
jq nano \
156+
&& apt-get clean
157+
158+
# Install execution-specs (EELS)
159+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal
160+
RUN git clone https://github.com/ethereum/execution-specs.git --branch forks/prague --depth 1
161+
RUN . "$HOME/.cargo/env"; PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/ pipx install './execution-specs/[test]'
162+
ENV EELS_BIN=/ethereum-spec-evm
163+
164+
# Go-evmlab targets
165+
COPY --from=golang-builder /go/goevmlab/generic-fuzzer \
166+
/go/goevmlab/generic-generator \
167+
/go/goevmlab/checkslow \
168+
/go/goevmlab/minimizer \
169+
/go/goevmlab/repro \
170+
/go/goevmlab/runtest \
171+
/go/goevmlab/tracediff \
172+
/go/goevmlab/traceview \
173+
/go/goevmlab/evms.test \
174+
/usr/bin/
175+
176+
COPY --from=golang-builder /go/go-ethereum/build/bin/evm /gethvm
177+
ENV GETH_BIN=/gethvm
178+
179+
COPY --from=golang-builder /erigon_vm /erigon_vm
180+
COPY --from=golang-builder /libsilkworm_capi.so /lib/libsilkworm_capi.so
181+
ENV ERIG_BIN=/erigon_vm
182+
183+
COPY --from=golang-builder /evmstate /nimbvm
184+
ENV NIMB_BIN=/nimbvm
185+
186+
COPY --from=debian-builder /evmone-statetest /evmone
187+
COPY --from=debian-builder /libevmone.so.* /lib/
188+
ENV EVMO_BIN=/evmone
189+
190+
COPY --from=rust-builder /revm/target/release/revme /revme
191+
ENV RETH_BIN=/revme
192+
193+
COPY --from=dotnet-builder /out/neth /neth
194+
RUN ln -s /neth/nethtest /nethtest
195+
ENV NETH_BIN=/neth/nethtest
196+
197+
COPY --from=java-builder /out/evmtool /evmtool
198+
RUN ln -s /evmtool/bin/evmtool besu-vm
199+
ENV BESU_BIN=/evmtool/bin/evmtool
200+
201+
COPY readme_docker.md /README.md
202+
203+
ENV FUZZ_CLIENTS="--gethbatch=$GETH_BIN \
204+
--nethbatch=$NETH_BIN \
205+
--nimbusbatch=$NIMB_BIN \
206+
--revme=$RETH_BIN \
207+
--erigonbatch=$ERIG_BIN \
208+
--besubatch=$BESU_BIN \
209+
--evmone=$EVMO_BIN \
210+
--eelsbatch=$EELS_BIN"
211+
212+
ENV FUZZ_CLIENTS_PLAIN="--geth=$GETH_BIN \
213+
--neth=$NETH_BIN \
214+
--nimbus=$NIMB_BIN \
215+
--revme=$RETH_BIN \
216+
--erigon=$ERIG_BIN \
217+
--besu=$BESU_BIN \
218+
--evmone=$EVMO_BIN \
219+
--eels=$EELS_BIN"
220+
221+
ENTRYPOINT ["/bin/bash"]

platforms.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,6 @@ mev-boost:
8787
mev-boost-relay:
8888
- linux/amd64
8989
- linux/arm64
90+
goevmlab:
91+
- linux/amd64
92+
- linux/arm64

0 commit comments

Comments
 (0)