Appearance
Tests
Unit tests
make test builds the debug profile and runs each unit test binary (tests/test_*.c). The debug profile has AddressSanitizer and UndefinedBehaviorSanitizer. Then make test runs the Python tests of the fetcher and of the measurement tools. A failure stops the run.
For a data race, build the ThreadSanitizer profile with make PROFILE=tsan and run the test binary from build/tsan/bin.
EEST runners
The Ethereum execution-spec-tests (EEST) runners read the fixtures from the directory in CINDER_EEST_DIR. Each runner prints a FAIL line for each failed test and a PASS and FAIL count at the end.
| Make target or binary | What it runs |
|---|---|
make statetest | The state tests of the Osaka fork. |
make blocktest | The blockchain tests of Osaka and of the two BPO transitions (OsakaToBPO1AtTime15k, BPO1ToBPO2AtTime15k). |
make blocktest-db | The same blockchain tests through a Cinder database: the runner loads the pre-state and commits each block. CN_BT_DB sets the database directory. |
build/<profile>/bin/enginetest | The Engine API fixtures through the block tree of the node. It needs --db DIR (a database for each test under DIR) or --hash-only. --compare-batch also writes each test in one batch and compares all tables. |
Give each run with a database its own empty directory. Two runs on one directory give failures that are not real.
The runners use the streaming state root as the node does. A debug build compares each streamed root with the old path and stops on a difference. On a release build, set CINDER_SROOT_CHECK=1 for the same comparison. A release build does not stop on a difference: it writes the line the streamed state root differs from the old path's to the log and continues. Search the log for this line. Do this for each change to the state, the tries or the state root.
Add PROFILE=release to run the runners on an optimized build. The commands in Before you open a pull request use the release build.
More checks
These commands run the other checks of the project. $DATA is a directory with enough free space. DIR is a new, empty directory for each test run.
bash
# the EEST fixtures: fixtures_develop.tar.gz from the EEST v5.4.0 release
export CINDER_EEST_DIR=/path/to/fixtures
# real mainnet blocks from your own reth node (debug namespace needed)
python3 tools/fetch/fetch.py --rpc RETH_RPC_URL --follow 100 --out $DATA/mainnet
build/release/bin/poc-exec $DATA/mainnet
build/release/bin/poc-exec --threads 8 --bench 3 $DATA/mainnet
# the blockchain tests through the block tree of the node
build/release/bin/blocktest --db DIR --chain
# the Engine API fixtures through the JSON-RPC layer against a database
build/release/bin/enginetest --db DIR --json
# with the node cache and deferred writes, and reorgs below the written head
build/release/bin/enginetest --db DIR --threads 8 --cache-mb 64 --defer-persist
build/release/bin/enginetest --db DIR --threads 8 --cache-mb 64 --fork-stress PRE_HASH
# all of the above: unit tests, EEST, mainnet blocks with 1 and 8 threads
tools/verify.sh
# the speed of the execution engine against reth's stateless validator
tools/bench-reth/setup.sh
python3 tools/bench/ab.py $DATA/mainnet 3 7
# the gas throughput of one core: synthetic loops, ERC-20 transfers, mainnet blocks
make bench-gas PROFILE=release MAINNET_DIR=$DATA/mainnet
# differential fuzzing against another EVM implementation (goevmlab)
tools/fuzz/run.sh 3600 4
# a live node: the phases of recent blocks executed again, read-only,
# and the JSON-RPC answers compared with reth's
build/release/bin/cinder-bench-node --db NODE_DB --blocks 10
build/release/bin/cinder-rpc-diff --a CINDER_RPC_URL --b RETH_RPC_URL --blocks 100For the modes of cinder-rpc-diff, read Parity with reth. Next to a node that writes, cinder-bench-node can fail a block with -10. Run it again (see cinder-bench-node next to a writing node).
The docs checks
make check-docs checks the data of the docs against the code and the measurement records:
- The marked numbers in the README and in the records against their measurement records (
make check-claims). Numbers without a mark are not checked. - The JSON-RPC method list (
docs/results/data/rpc-methods.json) against the code anddocs/rpc/status.yaml.make docs-rpcwrites the list again. - The recorded JSON-RPC examples against their capture (
tools/docs/rpc_capture.py --check). - The tests of
tools/docsandtools/rpccheck.
The command line reference shows the usage text of each tool. If you change the options of a tool, give the new usage text in the pull request.
Problems with test runs and A/B measurements
These failures come from the way a test or a measurement ran, not from the node.
cinder-bench-node next to a writing node
Symptom. cinder-bench-node on the database of a running node prints error (-10) for some blocks and ends with exit status 1.
Cause. cinder-bench-node executes recent blocks read-only on a live database. When the running node writes a block, the head moves. Before the fix, this gave errors and wrong roots. Now a run that sees a commit fails with -10, which means "retry". The tool skips the other runs of that block and continues with the next block. The tool cannot follow the moving head yet (#24).
What to do. Run the tool again. A -10 does not mean a wrong result. Do not compare its roots with a run that had errors before this fix.
Test runs that share a database directory
Symptom. enginetest or blocktest --db reports many failures, for example hundreds or thousands, on code that passed before.
Cause. Two runs used the same --db directory at the same time. One such pair gave 331 and 7 066 false failures. The same tests in their own directories passed 21 577 of 21 577.
What to do. Give each run its own directory.
A/B results that do not make sense
Symptom. An A/B measurement shows a change as worse, and a second measurement shows it as better.
Cause. Two recorded cases:
- A ThreadSanitizer run on the same machine made a change look like a regression. The A/B run without it showed the opposite.
- Periodic jobs of other services ran every 10 minutes. 50 blocks take 10 minutes, so 25-block slices put the variant on the same half of the cycle each time. Three "worse" results came from this cycle, not from the variants.
What to do. Do not run heavy jobs during an A/B. Use the method on the Performance page.