Store execution block hash in fork choice (#2643)

* - Update the fork choice `ProtoNode` to include `is_merge_complete`
- Add database migration for the persisted fork choice

* update tests

* Small cleanup

* lints

* store execution block hash in fork choice rather than bool
This commit is contained in:
realbigsean
2021-09-28 05:56:49 -04:00
committed by Paul Hauner
parent fd828199f5
commit aa534f8989
9 changed files with 148 additions and 4 deletions

View File

@@ -57,6 +57,7 @@ impl ForkChoiceTestDefinition {
pub fn run(self) {
let junk_shuffling_id =
AttestationShufflingId::from_components(Epoch::new(0), Hash256::zero());
let execution_block_hash = Hash256::zero();
let mut fork_choice = ProtoArrayForkChoice::new(
self.finalized_block_slot,
Hash256::zero(),
@@ -65,6 +66,7 @@ impl ForkChoiceTestDefinition {
self.finalized_root,
junk_shuffling_id.clone(),
junk_shuffling_id,
execution_block_hash,
)
.expect("should create fork choice struct");
@@ -139,6 +141,7 @@ impl ForkChoiceTestDefinition {
),
justified_epoch,
finalized_epoch,
execution_block_hash,
};
fork_choice.process_block(block).unwrap_or_else(|e| {
panic!(