update electra readiness with new endpoints

This commit is contained in:
realbigsean
2024-05-15 04:35:09 -04:00
parent 227aa4bc4f
commit 8e537d139e
2 changed files with 9 additions and 17 deletions

View File

@@ -2,9 +2,7 @@
//! transition.
use crate::{BeaconChain, BeaconChainTypes};
use execution_layer::http::{
ENGINE_FORKCHOICE_UPDATED_V3, ENGINE_GET_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V3,
};
use execution_layer::http::{ENGINE_GET_PAYLOAD_V4, ENGINE_NEW_PAYLOAD_V4};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::time::Duration;
@@ -22,7 +20,7 @@ pub enum ElectraReadiness {
/// The execution engine is electra-enabled (as far as we can tell)
Ready,
/// We are connected to an execution engine which doesn't support the V3 engine api methods
V3MethodsNotSupported { error: String },
V4MethodsNotSupported { error: String },
/// The transition configuration with the EL failed, there might be a problem with
/// connectivity, authentication or a difference in configuration.
ExchangeCapabilitiesFailed { error: String },
@@ -47,7 +45,7 @@ impl fmt::Display for ElectraReadiness {
"The --execution-endpoint flag is not specified, this is a \
requirement post-merge"
),
ElectraReadiness::V3MethodsNotSupported { error } => write!(
ElectraReadiness::V4MethodsNotSupported { error } => write!(
f,
"Execution endpoint does not support Electra methods: {}",
error
@@ -88,29 +86,23 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
}
}
Ok(capabilities) => {
// TODO(electra): Update in the event we get V4s.
let mut missing_methods = String::from("Required Methods Unsupported:");
let mut all_good = true;
if !capabilities.get_payload_v3 {
if !capabilities.get_payload_v4 {
missing_methods.push(' ');
missing_methods.push_str(ENGINE_GET_PAYLOAD_V3);
missing_methods.push_str(ENGINE_GET_PAYLOAD_V4);
all_good = false;
}
if !capabilities.forkchoice_updated_v3 {
if !capabilities.new_payload_v4 {
missing_methods.push(' ');
missing_methods.push_str(ENGINE_FORKCHOICE_UPDATED_V3);
all_good = false;
}
if !capabilities.new_payload_v3 {
missing_methods.push(' ');
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V3);
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V4);
all_good = false;
}
if all_good {
ElectraReadiness::Ready
} else {
ElectraReadiness::V3MethodsNotSupported {
ElectraReadiness::V4MethodsNotSupported {
error: missing_methods,
}
}

View File

@@ -644,7 +644,7 @@ impl<E: EthSpec> ExecutionPayloadBodyV1<E> {
"block {} is post-electra but payload body doesn't have withdrawals/deposit_receipts/withdrawal_requests \
Check that ELs are returning receipts and withdrawal_requests in getPayloadBody requests",
header.block_hash
))
));
};
Ok(ExecutionPayload::Electra(ExecutionPayloadElectra {
parent_hash: header.parent_hash,