eth2.0-specs/tests/formats/epoch_processing/README.md

49 lines
1.6 KiB
Markdown
Raw Normal View History

# Epoch processing tests
The different epoch sub-transitions are tested individually with test handlers.
The format is similar to block-processing state-transition tests.
There is no "change" factor however, the transitions are pure functions with just the pre-state as input.
Hence, the format is shared between each test-handler. (See test condition documentation on how to run the tests.)
## Test case format
### `meta.yaml`
```yaml
description: string -- Optional description of test case, purely for debugging purposes.
Tests should use the directory name of the test case as identifier, not the description.
bls_setting: int -- see general test-format spec.
```
2020-10-08 19:02:18 +00:00
### `pre.ssz_snappy`
2020-10-08 19:02:18 +00:00
A SSZ-snappy encoded `BeaconState`, the state before running the epoch sub-transition.
2020-10-08 19:02:18 +00:00
### `post.ssz_snappy`
2020-10-08 19:02:18 +00:00
A SSZ-snappy encoded `BeaconState`, the state after applying the epoch sub-transition.
## Condition
A handler of the `epoch_processing` test-runner should process these cases,
calling the corresponding processing implementation (same name, prefixed with `process_`).
This excludes the other parts of the epoch-transition.
The provided pre-state is already transitioned to just before the specific sub-transition of focus of the handler.
Sub-transitions:
2021-01-19 13:34:48 +00:00
Sub-transitions:
- `justification_and_finalization`
2021-01-19 13:34:48 +00:00
- `rewards_and_penalties`
- `registry_updates`
- `slashings`
2021-01-27 06:42:50 +00:00
- `eth1_data_reset`
- `effective_balance_updates`
- `slashings_reset`
- `randao_mixes_reset`
- `historical_roots_update`
2021-01-19 13:34:48 +00:00
- `participation_record_updates`
The resulting state should match the expected `post` state.