Skip to content

Commit

Permalink
Rename nimbus binary to nimbus_execution_client (#2728)
Browse files Browse the repository at this point in the history
* rename nimbus binary to nimbus_execution_client

* additional replacements

* makefile and dockerfile

* fix ci building errors

* github workflows

* improved Makefile target

---------

Co-authored-by: Pedro Miranda <pedro.miranda@nimbus.team>
  • Loading branch information
pedromiguelmiranda and Pedro Miranda authored Oct 15, 2024
1 parent 9c9a41a commit bc0f1ba
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 53 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
gcc --version
DEFAULT_MAKE_FLAGS="-j${ncpu} ENABLE_EVMC=${ENABLE_EVMC} ENABLE_VMLOWMEM=${ENABLE_VMLOWMEM}"
mingw32-make ${DEFAULT_MAKE_FLAGS} all test_import
build/nimbus.exe --help
build/nimbus_execution_client.exe --help
# give us more space
# find . -type d -name ".git" -exec rm -rf {} +
find . -type d -name "nimcache" -exec rm -rf {} +
Expand All @@ -227,10 +227,10 @@ jobs:
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"
DEFAULT_MAKE_FLAGS="-j${ncpu} ENABLE_EVMC=${ENABLE_EVMC}"
env CC=gcc make ${DEFAULT_MAKE_FLAGS} all test_import
build/nimbus --help
build/nimbus_execution_client --help
# CC, GOARCH, and CGO_ENABLED are needed to select correct compiler 32/64 bit
# pushd vendor/nimbus-eth2
# env NIMBUSEL_BINARY=../../build/nimbus NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# env NIMBUSEL_BINARY=../../build/nimbus_execution_client NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# ./scripts/launch_local_testnet.sh --nodes=3 --stop-at-epoch=7 \
# --disable-htop --reuse-binaries --run-nimbus-el --dl-eth2 --verbose --kill-old-processes
# popd
Expand All @@ -242,10 +242,10 @@ jobs:
export ZERO_AR_DATE=1 # avoid timestamps in binaries
DEFAULT_MAKE_FLAGS="-j${ncpu} ENABLE_EVMC=${ENABLE_EVMC}"
make ${DEFAULT_MAKE_FLAGS} all test_import
build/nimbus --help
build/nimbus_execution_client --help
# "-static" option will not work for osx unless static system libraries are provided
# pushd vendor/nimbus-eth2
# env NIMBUSEL_BINARY=../../build/nimbus NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# env NIMBUSEL_BINARY=../../build/nimbus_execution_client NIMBUSEL_GENESIS=scripts/nimbusel_genesis.json \
# ./scripts/launch_local_testnet.sh --nodes=3 --stop-at-epoch=7 \
# --disable-htop --reuse-binaries --run-nimbus-el --dl-eth2 --verbose --kill-old-processes
# popd
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/nightly_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Linux_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2

build-arm64:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Linux_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2

build-win64:
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Windows_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2

build-macos-amd64:
Expand Down Expand Up @@ -176,7 +176,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: macOS_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2

build-macos-arm64:
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: macOS_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2

prepare-prerelease:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
ARCHIVE=$(echo nimbus-eth1_Linux_amd64_*.tar.gz)
echo "archive=${ARCHIVE}" >> $GITHUB_OUTPUT
echo "archive_dir=${ARCHIVE%.tar.gz}" >> $GITHUB_OUTPUT
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus.sha512sum
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_execution_client.sha512sum
- name: Upload archive artefact
uses: actions/upload-artifact@v4
with:
Expand All @@ -41,7 +41,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Linux_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2
- name: Login to Docker Hub
uses: docker/login-action@v1
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:
ARCHIVE=$(echo nimbus-eth1_Linux_arm64v8_*.tar.gz)
echo "archive=${ARCHIVE}" >> $GITHUB_OUTPUT
echo "archive_dir=${ARCHIVE%.tar.gz}" >> $GITHUB_OUTPUT
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus.sha512sum
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_execution_client.sha512sum
- name: Upload archive artefact
uses: actions/upload-artifact@v4
with:
Expand All @@ -91,7 +91,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Linux_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2
- name: Login to Docker Hub
uses: docker/login-action@v1
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
ARCHIVE=$(echo nimbus-eth1_Windows_amd64_*.tar.gz)
echo "archive=${ARCHIVE}" >> $GITHUB_OUTPUT
echo "archive_dir=${ARCHIVE%.tar.gz}" >> $GITHUB_OUTPUT
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus.sha512sum
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_execution_client.sha512sum
- name: Upload archive artefact
uses: actions/upload-artifact@v4
with:
Expand All @@ -135,7 +135,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Windows_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2
build-macos-amd64:
name: macOS AMD64 release asset
Expand All @@ -151,7 +151,7 @@ jobs:
ARCHIVE=$(echo nimbus-eth1_macOS_amd64_*.tar.gz)
echo "archive=${ARCHIVE}" >> $GITHUB_OUTPUT
echo "archive_dir=${ARCHIVE%.tar.gz}" >> $GITHUB_OUTPUT
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus.sha512sum
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_execution_client.sha512sum
- name: Upload archive artefact
uses: actions/upload-artifact@v4
with:
Expand All @@ -162,7 +162,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: macOS_amd64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2
build-macos-arm64:
name: macOS ARM64 release asset
Expand All @@ -178,7 +178,7 @@ jobs:
ARCHIVE=$(echo nimbus-eth1_macOS_arm64_*.tar.gz)
echo "archive=${ARCHIVE}" >> $GITHUB_OUTPUT
echo "archive_dir=${ARCHIVE%.tar.gz}" >> $GITHUB_OUTPUT
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus.sha512sum
tar -xzf ${ARCHIVE} ${ARCHIVE%.tar.gz}/build/nimbus_execution_client.sha512sum
- name: Upload archive artefact
uses: actions/upload-artifact@v4
with:
Expand All @@ -189,7 +189,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: macOS_arm64_checksum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus.sha512sum
path: ./dist/${{ steps.make_dist.outputs.archive_dir }}/build/nimbus_execution_client.sha512sum
retention-days: 2
prepare-release:
name: Prepare release draft
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ RUN apt update && apt -y upgrade

RUN ldd --version ldd

RUN rm -f /home/user/nimbus-eth1/build/nimbus
RUN rm -f /home/user/nimbus-eth1/build/nimbus_execution_client

COPY --from=build /root/nimbus-eth1/build/nimbus /home/user/nimbus-eth1/build/nimbus
COPY --from=build /root/nimbus-eth1/build/nimbus_execution_client /home/user/nimbus-eth1/build/nimbus_execution_client

ENV PATH="/home/user/nimbus-eth1/build:${PATH}"
ENTRYPOINT ["nimbus"]
ENTRYPOINT ["nimbus_execution_client"]
WORKDIR /home/user/nimbus-eth1/build

STOPSIGNAL SIGINT
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,10 @@ $(TOOLS): | build deps rocksdb
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:chronicles_log_level=TRACE -o:build/$@ "$${TOOL_DIR}/$@.nim"

# a phony target, because teaching `make` how to do conditional recompilation of Nim projects is too complicated
execution_client_name = nimbus_execution_client
nimbus: | build deps rocksdb
echo -e $(BUILD_MSG) "build/$@" && \
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:chronicles_log_level=TRACE -o:build/$@ "nimbus/$@.nim"
echo -e $(BUILD_MSG) "build/$(execution_client_name)" && \
$(ENV_SCRIPT) nim c $(NIM_PARAMS) -d:chronicles_log_level=TRACE -o:build/$(execution_client_name) "nimbus/$(execution_client_name).nim"

# symlink
nimbus.nims:
Expand Down Expand Up @@ -256,11 +257,11 @@ test-evm: | build deps rocksdb
# deterministic order for debugging info sections - even with
# "-frandom-seed=...". Striping the binaries should make them identical, though.
test-reproducibility:
+ [ -e build/nimbus ] || $(MAKE) V=0 nimbus; \
MD5SUM1=$$($(MD5SUM) build/nimbus | cut -d ' ' -f 1) && \
rm -rf nimcache/*/nimbus && \
+ [ -e build/nimbus_execution_client ] || $(MAKE) V=0 nimbus; \
MD5SUM1=$$($(MD5SUM) build/nimbus_execution_client | cut -d ' ' -f 1) && \
rm -rf nimcache/*/nimbus_execution_client && \
$(MAKE) V=0 nimbus && \
MD5SUM2=$$($(MD5SUM) build/nimbus | cut -d ' ' -f 1) && \
MD5SUM2=$$($(MD5SUM) build/nimbus_execution_client | cut -d ' ' -f 1) && \
[ "$$MD5SUM1" = "$$MD5SUM2" ] && echo -e "\e[92mSuccess: identical binaries.\e[39m" || \
{ echo -e "\e[91mFailure: the binary changed between builds.\e[39m"; exit 1; }

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ln -s mingw32-make.exe make.exe
You can now follow those instructions in the previous section. For example:

```bash
make nimbus # build the Nimbus binary
make nimbus # build the Nimbus execution client binary
make test # run the test suite
# etc.
```
Expand Down Expand Up @@ -326,7 +326,7 @@ cd vendor/nim-rocksdb
Install Prometheus and Grafana. On Gentoo, it's `emerge prometheus grafana-bin`.

```bash
# build Nimbus
# build Nimbus execution client
make nimbus
# the Prometheus daemon will create its data dir in the current dir, so give it its own directory
mkdir ../my_metrics
Expand All @@ -336,7 +336,7 @@ cp -a examples/prometheus.yml ../my_metrics/
cd ../my_metrics
prometheus --config.file=prometheus.yml # loads ./prometheus.yml, writes metric data to ./data
# start a fresh Nimbus sync and export metrics
rm -rf ~/.cache/nimbus/db; ./build/nimbus --prune:archive --metricsServer
rm -rf ~/.cache/nimbus/db; ./build/nimbus_execution_client --prune:archive --metricsServer
```

Start the Grafana server. On Gentoo it's `/etc/init.d/grafana start`. Go to
Expand Down
17 changes: 14 additions & 3 deletions hive_integration/nimbus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# Nimbus
# Copyright (c) 2024 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at
# https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at
# https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed
# except according to those terms.


# Docker container spec for building the master branch of nimbus.

FROM debian:buster-slim AS build
Expand All @@ -16,7 +27,7 @@ RUN git clone --depth 1 --branch non_blocking_startup https://github.com/status-

RUN cd nimbus-eth1 && \
make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" nimbus && \
mv build/nimbus /usr/bin/
mv build/nimbus_execution_client /usr/bin/

# --------------------------------- #
# Starting new image to reduce size #
Expand All @@ -28,8 +39,8 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=build /usr/bin/nimbus /usr/bin/nimbus
RUN usr/bin/nimbus --version > /version.txt
COPY --from=build /usr/bin/nimbus_execution_client /usr/bin/nimbus_execution_client
RUN usr/bin/nimbus_execution_client --version > /version.txt

# Add genesis mapper script.
ADD genesis.json /genesis.json
Expand Down
14 changes: 7 additions & 7 deletions hive_integration/nimbus/nimbus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Startup script to initialize and boot a nimbus instance.
#
# This script assumes the following files:
# - `nimbus` binary is located in the filesystem root
# - `nimbus_execution_client` binary is located in the filesystem root
# - `genesis.json` file is located in the filesystem root (mandatory)
# - `chain.rlp` file is located in the filesystem root (optional)
# - `blocks` folder is located in the filesystem root (optional)
Expand Down Expand Up @@ -48,7 +48,7 @@
# Immediately abort the script on any error encountered
set -e

nimbus=/usr/bin/nimbus
nimbus_execution_client=/usr/bin/nimbus_execution_client
FLAGS="--prune-mode:archive --nat:extip:0.0.0.0"

if [ "$HIVE_LOGLEVEL" != "" ]; then
Expand Down Expand Up @@ -86,16 +86,16 @@ set +e
echo "Loading initial blockchain..."
if [ -f /chain.rlp ]; then
CMD="import /chain.rlp"
echo "Running nimbus: $nimbus $CMD $FLAGS"
$nimbus $CMD $FLAGS
echo "Running nimbus execution client: $nimbus_execution_client $CMD $FLAGS"
$nimbus_execution_client $CMD $FLAGS
else
echo "Warning: chain.rlp not found."
fi

# Load the remainder of the test chain
echo "Loading remaining individual blocks..."
if [ -d /blocks ]; then
(cd /blocks && cat `ls | sort -n` > blocks.rlp && $nimbus import blocks.rlp $FLAGS)
(cd /blocks && cat `ls | sort -n` > blocks.rlp && $nimbus_execution_client import blocks.rlp $FLAGS)
else
echo "Warning: blocks folder not found."
fi
Expand All @@ -111,5 +111,5 @@ else
FLAGS="$FLAGS --engine-api:true --engine-api-address:0.0.0.0 --engine-api-port:8551"
fi

echo "Running nimbus with flags $FLAGS"
$nimbus $FLAGS
echo "Running nimbus execution client with flags $FLAGS"
$nimbus_execution_client $FLAGS
18 changes: 9 additions & 9 deletions nimbus.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ binDir = "build"

when declared(namedBin):
namedBin = {
"nimbus/nimbus": "nimbus",
"nimbus/nimbus_execution_client": "nimbus_execution_client",
"fluffy/fluffy": "fluffy",
"nimbus_verified_proxy/nimbus_verified_proxy": "nimbus_verified_proxy",
}.toTable()
Expand Down Expand Up @@ -81,20 +81,20 @@ task test_import, "Run block import test":
echo "Remove directory before running test: " & tmp
quit(QuitFailure)

const nimbus = when defined(windows):
"build/nimbus.exe"
const nimbus_exec_client = when defined(windows):
"build/nimbus_execution_client.exe"
else:
"build/nimbus"
"build/nimbus_execution_client"

if not fileExists(nimbus):
echo "Build nimbus before running this test"
if not fileExists(nimbus_exec_client):
echo "Build nimbus execution client before running this test"
quit(QuitFailure)

# Test that we can resume import
exec "build/nimbus import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:1"
exec "build/nimbus import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:1023"
exec "build/nimbus_execution_client import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:1"
exec "build/nimbus_execution_client import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:1023"
# There should only be 8k blocks
exec "build/nimbus import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:10000"
exec "build/nimbus_execution_client import --data-dir:" & tmp & " --era1-dir:tests/replay --max-blocks:10000"

task test_evm, "Run EVM tests":
test "tests", "evm_tests", "-d:chronicles_log_level=ERROR -d:unittest2DisableParamFiltering"
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions nimbus/sync/beacon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ As the syncing process is quite slow, it makes sense to pre-load the database
from an *Era1* archive (if available) before starting the real sync process.
The command for importing an *Era1* reproitory would be something like

./build/nimbus import \
./build/nimbus_execution_client import \
--era1-dir:/path/to/main-era1/repo \
...

Expand All @@ -202,7 +202,7 @@ On a system with memory considerably larger than *8GiB* the *nimbus* binary is
started on the same machine where the beacon node runs with the command


./build/nimbus \
./build/nimbus_execution_client \
--network=mainnet \
--engine-api=true \
--engine-api-port=8551 \
Expand Down

0 comments on commit bc0f1ba

Please sign in to comment.