Skip to content

Build from source ​

For the first build, read Install.

PGO and ThinLTO build ​

A build with profile-guided optimization (PGO) and ThinLTO executes mainnet blocks about 5% faster: 1.049× on the engine benchmark over 196 mainnet blocks. The project kept the build options on 2026-10-01. The project's node runs this build. Train the profile again after large code changes: a profile trained again on the code of 2026-10-12, with 300 mainnet fixtures, gave a further 0.4 ms per block by median.

To make this build, do these steps:

  1. Get mainnet blocks with their execution witnesses from your reth node. The fetcher writes one .ecfx file per block:

    bash
    python3 tools/fetch/fetch.py --rpc http://127.0.0.1:8545 --follow 100 --out $DATA/mainnet

    --follow 100 waits for the next 100 blocks, about 20 minutes. In the commands on this page, $DATA is a directory on a disk with enough free space.

  2. Train a profile on these blocks. This step builds an instrumented poc-exec and runs it over the files:

    bash
    make pgo-train MAINNET_DIR=$DATA/mainnet LLVM_DIR=/path/to/llvm
  3. Build with the profile and ThinLTO:

    bash
    make PROFILE=release PGO_USE=build/pgo-data/cinder.profdata LTO=1 LLVM_DIR=/path/to/llvm

The binaries go to build/release-pgo-lto/bin. Each combination of options builds in a directory of its own, so the plain release build stays in build/release. A new profile builds all objects of the PGO build again.

LTO=1 links with ld.lld and makes archives with llvm-ar from LLVM_DIR. In the commands of the other pages, replace build/release/bin with build/release-pgo-lto/bin if you use this build.

Measured with poc-exec --bench 3 over 196 mainnet blocks that the profile was not trained on, each block with the two builds one after the other on one pinned core:

BuildTotalGeomeanMedian
ThinLTO only1.020×1.008×1.010×
PGO only1.029×1.021×1.019×
PGO and ThinLTO1.049×1.049×1.040×

The EEST suites and the mainnet blocks that poc-exec checks (39 of 39) give identical results with this build. poc-exec spends much of its time on witness checks, which the node does not do. So the gain on the node can be larger than these numbers.

Build requirements ​

  • Linux on x86-64. The CPU must have the x86-64-v3 instructions and ADX, SHA and AES. Read Hardware requirements.
  • clang. GCC 15.2.0 miscompiles the vendored cryptography code.
  • make PROFILE=release builds with -O3 -march=x86-64-v3 -madx -msha. ARCH sets the target: the default is x86-64-v3. ARCH=native builds for the CPU of the build machine only, in build/release-native. Other values go to -march without a change, for example ARCH=znver3. The debug build and all vendored libraries use the same ARCH.
  • A release binary must not have instructions above the target. To examine the binaries, run python3 tools/check_isa.py build/release/bin/cinder build/release/bin/statetest.
  • Each program examines the CPU when it starts (src/util/cn_cpu.c). On a CPU without a necessary instruction, it stops with exit status 1 and a message, not with Illegal instruction.