Files
consensus-specs/tests/generators/compliance_runners/fork_choice/README.md
2025-06-30 16:27:01 -05:00

1.8 KiB

Fork choice compliance test generator

Fork Choice test generator intended to produce tests to validate conformance to the specs of various Fork Choice implementations.

Implementation of the approach described in the Fork Choice compliance testing framework.

Preliminary research has been also performed in this repo.

To simplify adoption of the tests, we follow the test format described in the fork choice test formats documentation, with a minor exception (new check added).

This work was supported by a grant from the Ethereum Foundation.

Pre-requisites

Install pyspec using the top-level Makefile, this will install necessary pre-requiesites.

> make pyspec

Generating tests

From the root directory:

> python -m tests.generators.compliance_runners.fork_choice.test_gen -o ${test_dir} --fc-gen-config ${config}

where config can be either: tiny, small or `standard.

Or specify path to the configuration file directly:

> python -m tests.generators.compliance_runners.fork_choice.test_gen -o ${test_dir} --fc-gen-config-path ${config_path}

There are three configurations in the repo: tiny, small and standard.

Running tests

From the root directory:

> python -m tests.generators.compliance_runners.fork_choice.test_run -i ${test_dir}

Generating configurations

Files in tiny, small and standard are generated with generate_test_instances.py, e.g.

> python -m tests.generators.compliance_runners.fork_choice.generate_test_instances

But one normally doesn't need to generate them.