27e83b888c
## Issue Addressed
NA
## Proposed Changes
Adds the functionality to allow blocks to be validated/invalidated after their import as per the [optimistic sync spec](https://github.com/ethereum/consensus-specs/blob/dev/sync/optimistic.md#how-to-optimistically-import-blocks). This means:
- Updating `ProtoArray` to allow flipping the `execution_status` of ancestors/descendants based on payload validity updates.
- Creating separation between `execution_layer` and the `beacon_chain` by creating a `PayloadStatus` struct.
- Refactoring how the `execution_layer` selects a `PayloadStatus` from the multiple statuses returned from multiple EEs.
- Adding testing framework for optimistic imports.
- Add `ExecutionBlockHash(Hash256)` new-type struct to avoid confusion between *beacon block roots* and *execution payload hashes*.
- Add `merge` to [`FORKS`](c3a793fd73/Makefile (L17)
) in the `Makefile` to ensure we test the beacon chain with merge settings.
- Fix some tests here that were failing due to a missing execution layer.
## TODO
- [ ] Balance tests
Co-authored-by: Mark Mackey <mark@sigmaprime.io>
27 lines
994 B
Rust
27 lines
994 B
Rust
use proto_array::fork_choice_test_definition::*;
|
|
use std::fs::File;
|
|
|
|
fn main() {
|
|
write_test_def_to_yaml("votes.yaml", get_votes_test_definition());
|
|
write_test_def_to_yaml("no_votes.yaml", get_no_votes_test_definition());
|
|
write_test_def_to_yaml("ffg_01.yaml", get_ffg_case_01_test_definition());
|
|
write_test_def_to_yaml("ffg_02.yaml", get_ffg_case_02_test_definition());
|
|
write_test_def_to_yaml(
|
|
"execution_status_01.yaml",
|
|
get_execution_status_test_definition_01(),
|
|
);
|
|
write_test_def_to_yaml(
|
|
"execution_status_02.yaml",
|
|
get_execution_status_test_definition_02(),
|
|
);
|
|
write_test_def_to_yaml(
|
|
"execution_status_03.yaml",
|
|
get_execution_status_test_definition_03(),
|
|
);
|
|
}
|
|
|
|
fn write_test_def_to_yaml(filename: &str, def: ForkChoiceTestDefinition) {
|
|
let file = File::create(filename).expect("Should be able to open file");
|
|
serde_yaml::to_writer(file, &def).expect("Should be able to write YAML to file");
|
|
}
|