mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
wip: early envelope reprocessing and is_heze_fork plumbing
This commit is contained in:
@@ -54,6 +54,10 @@ pub struct NewPayloadRequest<'block, E: EthSpec> {
|
||||
pub execution_requests: &'block ExecutionRequests<E>,
|
||||
#[superstruct(only(Heze, Gloas))]
|
||||
pub il_transactions: Transactions<E>,
|
||||
/// When true, this Gloas-shaped request must use engine_newPayloadV6 (Heze fork).
|
||||
/// Gloas and Heze have identical payload wire formats; only the method version differs.
|
||||
#[superstruct(only(Gloas))]
|
||||
pub is_heze_fork: bool,
|
||||
}
|
||||
|
||||
impl<'block, E: EthSpec> NewPayloadRequest<'block, E> {
|
||||
|
||||
@@ -129,11 +129,17 @@ pub async fn handle_rpc<E: EthSpec>(
|
||||
})
|
||||
.map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?,
|
||||
ENGINE_NEW_PAYLOAD_V5 => {
|
||||
// V5 is for Gloas; fall back to Heze for backward compat
|
||||
get_param::<JsonExecutionPayloadGloas<E>>(params, 0)
|
||||
.map(|jep| JsonExecutionPayload::Gloas(jep))
|
||||
.or_else(|_| {
|
||||
get_param::<JsonExecutionPayloadHeze<E>>(params, 0)
|
||||
.map(|jep| JsonExecutionPayload::Heze(jep))
|
||||
})
|
||||
.map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?
|
||||
}
|
||||
ENGINE_NEW_PAYLOAD_V6 => {
|
||||
// V6 is for Heze (Bogota EL fork)
|
||||
get_param::<JsonExecutionPayloadHeze<E>>(params, 0)
|
||||
.map(|jep| JsonExecutionPayload::Heze(jep))
|
||||
.map_err(|s| (s, BAD_PARAMS_ERROR_CODE))?
|
||||
|
||||
Reference in New Issue
Block a user