Skip to content

Commit

Permalink
feat: add OpExecutionPayloadV4
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Feb 4, 2025
1 parent 33b4d77 commit 8a4070a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rpc-types-engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod payload_v3;
pub use payload_v3::OpExecutionPayloadEnvelopeV3;

mod payload_v4;
pub use payload_v4::OpExecutionPayloadEnvelopeV4;
pub use payload_v4::{OpExecutionPayloadEnvelopeV4, OpExecutionPayloadV4};

mod sidecar;
pub use sidecar::{IsthmusPayloadFields, MaybeIsthmusPayloadFields, OpExecutionPayloadSidecar};
15 changes: 15 additions & 0 deletions crates/rpc-types-engine/src/payload_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ use alloc::vec::Vec;
use alloy_primitives::{Bytes, B256, U256};
use alloy_rpc_types_engine::{BlobsBundleV1, ExecutionPayloadV3};

/// The Opstack execution payload for `newPayloadV4` of the engine API introduced with isthmus.
/// See also <https://specs.optimism.io/protocol/isthmus/exec-engine.html#engine_newpayloadv4-api>
#[derive(Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
pub struct OpExecutionPayloadV4 {
/// L1 execution payload
#[cfg_attr(feature = "serde", serde(flatten))]
pub payload_inner: ExecutionPayloadV3,
/// OP-Stack Isthmus specific field:
/// instead of computing the root from a withdrawals list, set it directly.
/// The "withdrawals" list attribute must be non-nil but empty.
pub withdrawals_root: B256,
}

/// This structure maps for the return value of `engine_getPayload` of the beacon chain spec, for
/// V4.
///
Expand Down

0 comments on commit 8a4070a

Please sign in to comment.