2019-05-23 23:03:21 +00:00
|
|
|
# Sanity blocks testing
|
|
|
|
|
|
|
|
Sanity tests to cover a series of one or more blocks being processed, aiming to cover common changes.
|
|
|
|
|
|
|
|
## Test case format
|
|
|
|
|
2019-07-30 13:06:15 +00:00
|
|
|
### `meta.yaml`
|
|
|
|
|
2019-05-23 23:03:21 +00:00
|
|
|
```yaml
|
2020-08-12 13:50:36 +00:00
|
|
|
description: string -- Optional. Description of test case, purely for debugging purposes.
|
|
|
|
bls_setting: int -- see general test-format spec.
|
|
|
|
reveal_deadlines_setting: int -- see general test-format spec.
|
|
|
|
blocks_count: int -- the number of blocks processed in this test.
|
2019-05-23 23:03:21 +00:00
|
|
|
```
|
|
|
|
|
2019-07-30 13:06:15 +00:00
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
### `pre.ssz_snappy`
|
2019-07-30 13:06:15 +00:00
|
|
|
|
2021-03-13 04:42:51 +00:00
|
|
|
An SSZ-snappy encoded `BeaconState`, the state before running the block transitions.
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
### `blocks_<index>.ssz_snappy`
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
A series of files, with `<index>` in range `[0, blocks_count)`. Blocks need to be processed in order,
|
|
|
|
following the main transition function (i.e. process slot and epoch transitions in between blocks as normal)
|
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
Each file is a SSZ-snappy encoded `SignedBeaconBlock`.
|
2019-07-30 13:06:15 +00:00
|
|
|
|
2020-10-08 19:02:18 +00:00
|
|
|
### `post.ssz_snappy`
|
2019-07-30 13:06:15 +00:00
|
|
|
|
2021-03-13 04:42:51 +00:00
|
|
|
An SSZ-snappy encoded `BeaconState`, the state after applying the block transitions.
|
2019-07-30 13:06:15 +00:00
|
|
|
|
|
|
|
|
2019-05-23 23:03:21 +00:00
|
|
|
## Condition
|
|
|
|
|
|
|
|
The resulting state should match the expected `post` state, or if the `post` state is left blank,
|
|
|
|
the handler should reject the series of blocks as invalid.
|