Retrospective invalidation of exec. payloads for opt. sync (#2837)
## 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`](https://github.com/sigp/lighthouse/blob/c3a793fd73a3b11b130b82032904d39c952869e4/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>
This commit is contained in:
co-authored by
Mark Mackey
parent
5e1f8a8480
commit
27e83b888c
@@ -23,7 +23,7 @@ pub fn run<T: EthSpec>(matches: &ArgMatches) -> Result<(), String> {
|
||||
base_fee_per_gas,
|
||||
timestamp: genesis_time,
|
||||
block_hash: eth1_block_hash,
|
||||
random: eth1_block_hash,
|
||||
random: eth1_block_hash.into_root(),
|
||||
..ExecutionPayloadHeader::default()
|
||||
};
|
||||
let mut file = File::create(file_name).map_err(|_| "Unable to create file".to_string())?;
|
||||
|
||||
@@ -108,7 +108,7 @@ pub fn run<T: EthSpec>(testnet_dir_path: PathBuf, matches: &ArgMatches) -> Resul
|
||||
let genesis_state = interop_genesis_state::<T>(
|
||||
&keypairs,
|
||||
genesis_time,
|
||||
eth1_block_hash,
|
||||
eth1_block_hash.into_root(),
|
||||
execution_payload_header,
|
||||
&spec,
|
||||
)?;
|
||||
|
||||
Reference in New Issue
Block a user