2019-05-23 21:50:58 +00:00
|
|
|
# Epoch processing tests
|
|
|
|
|
|
|
|
The different epoch sub-transitions are tested individually with test handlers.
|
|
|
|
The format is similar to block-processing state-transition tests.
|
2019-05-24 16:24:42 +00:00
|
|
|
There is no "change" factor however, the transitions are pure functions with just the pre-state as input.
|
2019-05-23 21:50:58 +00:00
|
|
|
Hence, the format is shared between each test-handler. (See test condition documentation on how to run the tests.)
|
|
|
|
|
|
|
|
## Test case format
|
|
|
|
|
2019-07-30 12:09:20 +00:00
|
|
|
### `meta.yaml`
|
|
|
|
|
2019-05-23 21:50:58 +00:00
|
|
|
```yaml
|
2019-07-30 12:09:20 +00:00
|
|
|
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.
|
2019-05-28 13:35:00 +00:00
|
|
|
bls_setting: int -- see general test-format spec.
|
2019-05-23 21:50:58 +00:00
|
|
|
```
|
|
|
|
|
2019-07-30 12:09:20 +00:00
|
|
|
### `pre.yaml`
|
|
|
|
|
|
|
|
A YAML-encoded `BeaconState`, the state before running the epoch sub-transition.
|
|
|
|
|
2019-07-31 00:16:41 +00:00
|
|
|
Also available as `pre.ssz`.
|
2019-07-30 12:09:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
### `post.yaml`
|
|
|
|
|
|
|
|
A YAML-encoded `BeaconState`, the state after applying the epoch sub-transition.
|
|
|
|
|
2019-07-31 00:16:41 +00:00
|
|
|
Also available as `post.ssz`.
|
2019-07-30 12:09:20 +00:00
|
|
|
|
2019-05-23 21:50:58 +00:00
|
|
|
## Condition
|
|
|
|
|
|
|
|
A handler of the `epoch_processing` test-runner should process these cases,
|
2019-06-30 12:32:38 +00:00
|
|
|
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.
|
2019-05-23 21:50:58 +00:00
|
|
|
|
|
|
|
Sub-transitions:
|
|
|
|
|
2019-06-30 12:32:38 +00:00
|
|
|
- `justification_and_finalization`
|
2019-06-30 19:19:19 +00:00
|
|
|
- *`rewards_and_penalties` - planned testing extension*
|
2019-06-30 12:32:38 +00:00
|
|
|
- `registry_updates`
|
|
|
|
- `slashings`
|
|
|
|
- `final_updates`
|
2019-05-23 21:50:58 +00:00
|
|
|
|
|
|
|
The resulting state should match the expected `post` state.
|