diff --git a/crates/rpc-engine-types/src/optimism.rs b/crates/rpc-engine-types/src/optimism.rs index 94e085f4d75..4775e49bac4 100644 --- a/crates/rpc-engine-types/src/optimism.rs +++ b/crates/rpc-engine-types/src/optimism.rs @@ -1,5 +1,5 @@ -use crate::PayloadAttributes; -use alloy_primitives::Bytes; +use crate::{ExecutionPayloadV2, PayloadAttributes}; +use alloy_primitives::{Bytes, B256}; use serde::{Deserialize, Serialize}; /// Optimism Payload Attributes @@ -24,6 +24,29 @@ pub struct OptimismPayloadAttributes { pub gas_limit: Option, } +/// This structure maps on the ExecutionPayloadV3 structure of the beacon chain spec. +/// +/// See also: +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct OptimismExecutionPayloadV3 { + /// Inner V2 payload + #[serde(flatten)] + pub payload_inner: ExecutionPayloadV2, + + /// Array of hex [`u64`] representing blob gas used, enabled with V3 + /// See + #[serde(with = "alloy_rpc_types::serde_helpers::u64_hex")] + pub blob_gas_used: u64, + /// Array of hex[`u64`] representing excess blob gas, enabled with V3 + /// See + #[serde(with = "alloy_rpc_types::serde_helpers::u64_hex")] + pub excess_blob_gas: u64, + + /// Ecotone parent beacon block root + pub parent_beacon_block_root: B256, +} + #[cfg(test)] mod tests { use crate::ExecutionPayloadInputV2;