mirror of
https://github.com/sigp/lighthouse.git
synced 2026-07-03 12:54:27 +00:00
update electra readiness with new endpoints
This commit is contained in:
@@ -2,9 +2,7 @@
|
|||||||
//! transition.
|
//! transition.
|
||||||
|
|
||||||
use crate::{BeaconChain, BeaconChainTypes};
|
use crate::{BeaconChain, BeaconChainTypes};
|
||||||
use execution_layer::http::{
|
use execution_layer::http::{ENGINE_GET_PAYLOAD_V4, ENGINE_NEW_PAYLOAD_V4};
|
||||||
ENGINE_FORKCHOICE_UPDATED_V3, ENGINE_GET_PAYLOAD_V3, ENGINE_NEW_PAYLOAD_V3,
|
|
||||||
};
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@@ -22,7 +20,7 @@ pub enum ElectraReadiness {
|
|||||||
/// The execution engine is electra-enabled (as far as we can tell)
|
/// The execution engine is electra-enabled (as far as we can tell)
|
||||||
Ready,
|
Ready,
|
||||||
/// We are connected to an execution engine which doesn't support the V3 engine api methods
|
/// 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
|
/// The transition configuration with the EL failed, there might be a problem with
|
||||||
/// connectivity, authentication or a difference in configuration.
|
/// connectivity, authentication or a difference in configuration.
|
||||||
ExchangeCapabilitiesFailed { error: String },
|
ExchangeCapabilitiesFailed { error: String },
|
||||||
@@ -47,7 +45,7 @@ impl fmt::Display for ElectraReadiness {
|
|||||||
"The --execution-endpoint flag is not specified, this is a \
|
"The --execution-endpoint flag is not specified, this is a \
|
||||||
requirement post-merge"
|
requirement post-merge"
|
||||||
),
|
),
|
||||||
ElectraReadiness::V3MethodsNotSupported { error } => write!(
|
ElectraReadiness::V4MethodsNotSupported { error } => write!(
|
||||||
f,
|
f,
|
||||||
"Execution endpoint does not support Electra methods: {}",
|
"Execution endpoint does not support Electra methods: {}",
|
||||||
error
|
error
|
||||||
@@ -88,29 +86,23 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(capabilities) => {
|
Ok(capabilities) => {
|
||||||
// TODO(electra): Update in the event we get V4s.
|
|
||||||
let mut missing_methods = String::from("Required Methods Unsupported:");
|
let mut missing_methods = String::from("Required Methods Unsupported:");
|
||||||
let mut all_good = true;
|
let mut all_good = true;
|
||||||
if !capabilities.get_payload_v3 {
|
if !capabilities.get_payload_v4 {
|
||||||
missing_methods.push(' ');
|
missing_methods.push(' ');
|
||||||
missing_methods.push_str(ENGINE_GET_PAYLOAD_V3);
|
missing_methods.push_str(ENGINE_GET_PAYLOAD_V4);
|
||||||
all_good = false;
|
all_good = false;
|
||||||
}
|
}
|
||||||
if !capabilities.forkchoice_updated_v3 {
|
if !capabilities.new_payload_v4 {
|
||||||
missing_methods.push(' ');
|
missing_methods.push(' ');
|
||||||
missing_methods.push_str(ENGINE_FORKCHOICE_UPDATED_V3);
|
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V4);
|
||||||
all_good = false;
|
|
||||||
}
|
|
||||||
if !capabilities.new_payload_v3 {
|
|
||||||
missing_methods.push(' ');
|
|
||||||
missing_methods.push_str(ENGINE_NEW_PAYLOAD_V3);
|
|
||||||
all_good = false;
|
all_good = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if all_good {
|
if all_good {
|
||||||
ElectraReadiness::Ready
|
ElectraReadiness::Ready
|
||||||
} else {
|
} else {
|
||||||
ElectraReadiness::V3MethodsNotSupported {
|
ElectraReadiness::V4MethodsNotSupported {
|
||||||
error: missing_methods,
|
error: missing_methods,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ impl<E: EthSpec> ExecutionPayloadBodyV1<E> {
|
|||||||
"block {} is post-electra but payload body doesn't have withdrawals/deposit_receipts/withdrawal_requests \
|
"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",
|
Check that ELs are returning receipts and withdrawal_requests in getPayloadBody requests",
|
||||||
header.block_hash
|
header.block_hash
|
||||||
))
|
));
|
||||||
};
|
};
|
||||||
Ok(ExecutionPayload::Electra(ExecutionPayloadElectra {
|
Ok(ExecutionPayload::Electra(ExecutionPayloadElectra {
|
||||||
parent_hash: header.parent_hash,
|
parent_hash: header.parent_hash,
|
||||||
|
|||||||
Reference in New Issue
Block a user