lighthouse/testing/state_transition_vectors
Jimmy Chen 8d9c748025 Fix attestation withdrawals root mismatch (#4249)
## Issue Addressed

Addresses #4234 

## Proposed Changes

- Skip withdrawals processing in an inconsistent state replay. 
- Repurpose `StateRootStrategy`: rename to `StateProcessingStrategy` and always skip withdrawals if using `StateProcessingStrategy::Inconsistent`
- Add a test to reproduce the scenario


Co-authored-by: Jimmy Chen <jimmy@sigmaprime.io>
2023-05-09 10:48:15 +00:00
..
src Fix attestation withdrawals root mismatch (#4249) 2023-05-09 10:48:15 +00:00
.gitignore Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
Cargo.toml Split common crates out into their own repos (#3890) 2023-04-28 01:15:40 +00:00
Makefile Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00
README.md Directory Restructure (#1163) 2020-05-18 21:24:23 +10:00

state_transition_vectors

This crate contains test vectors for Lighthouse state transition functions.

This crate serves two purposes:

  • Outputting the test vectors to disk via make.
  • Running the vectors against our code via make test.

Outputting vectors to disk

Whilst we don't actually need to write the vectors to disk to test them, we provide this functionality so we can generate corpra for the fuzzer and also so they can be of use to other clients.

To create the files in ./vectors (directory relative to this crate), run:

make

This will produce a directory structure that looks roughly like this:

vectors
└── exit
    ├── invalid_bad_signature
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_duplicate
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_exit_already_initiated
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_future_exit_epoch
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_not_active_after_exit_epoch
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_not_active_before_activation_epoch
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_too_young_by_a_lot
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_too_young_by_one_epoch
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── invalid_validator_unknown
    │   ├── block.ssz
    │   ├── error.txt
    │   └── pre.ssz
    ├── valid_genesis_epoch
    │   ├── block.ssz
    │   ├── post.ssz
    │   └── pre.ssz
    └── valid_previous_epoch
        ├── block.ssz
        ├── post.ssz
        └── pre.ssz