Update to superstruct v0.4.1 (#2886)

## Proposed Changes

Update `superstruct` to bring in @realbigsean's fixes necessary for MEV-compatible private beacon block types (a la #2795).

The refactoring is due to another change in superstruct that allows partial getters to be auto-generated.
This commit is contained in:
Michael Sproul
2022-01-06 03:14:58 +00:00
parent 0b54ff17f2
commit fac117667b
12 changed files with 19 additions and 41 deletions

View File

@@ -146,7 +146,7 @@ pub fn validate_execution_payload_for_gossip<T: BeaconChainTypes>(
chain: &BeaconChain<T>,
) -> Result<(), BlockError<T::EthSpec>> {
// Only apply this validation if this is a merge beacon block.
if let Some(execution_payload) = block.body().execution_payload() {
if let Ok(execution_payload) = block.body().execution_payload() {
// This logic should match `is_execution_enabled`. We use only the execution block hash of
// the parent here in order to avoid loading the parent state during gossip verification.
@@ -289,6 +289,7 @@ pub async fn prepare_execution_payload<T: BeaconChainTypes>(
.message()
.body()
.execution_payload()
.ok()
.map(|ep| ep.block_hash)
};