mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
fix: call validate_execution_requests from validate_version_specific_fields for ethereum engine validator (#14932)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{MessageValidationKind, PayloadAttributes};
|
||||
use alloc::vec::Vec;
|
||||
use alloy_eips::eip4895::Withdrawal;
|
||||
use alloy_eips::{eip4895::Withdrawal, eip7685::Requests};
|
||||
use alloy_primitives::B256;
|
||||
use alloy_rpc_types_engine::ExecutionData;
|
||||
use core::fmt::Debug;
|
||||
@@ -164,3 +164,25 @@ impl ExecutionPayload for op_alloy_rpc_types_engine::OpExecutionData {
|
||||
self.payload.as_v1().gas_used
|
||||
}
|
||||
}
|
||||
|
||||
/// Special implementation for Ethereum types that provides additional helper methods
|
||||
impl<'a, Attributes> PayloadOrAttributes<'a, ExecutionData, Attributes>
|
||||
where
|
||||
Attributes: PayloadAttributes,
|
||||
{
|
||||
/// Return the execution requests from the payload, if available.
|
||||
///
|
||||
/// This will return `Some(requests)` only if:
|
||||
/// - The payload is an `ExecutionData` (not `PayloadAttributes`)
|
||||
/// - The payload has Prague payload fields
|
||||
/// - The Prague fields contain requests (not a hash)
|
||||
///
|
||||
/// Returns `None` in all other cases.
|
||||
pub fn execution_requests(&self) -> Option<&Requests> {
|
||||
if let Self::ExecutionPayload(payload) = self {
|
||||
payload.sidecar.requests()
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user