Skip to content

Commit

Permalink
feat: add op payload type (alloy-rs#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored and ben186 committed Jul 27, 2024
1 parent 1763f77 commit 233b6ea
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion crates/rpc-types-engine/src/optimism.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{BlobsBundleV1, ExecutionPayloadV3, PayloadAttributes};
use crate::{BlobsBundleV1, ExecutionPayloadV3, ExecutionPayloadV4, PayloadAttributes};
use alloy_primitives::{Bytes, B256, U256};
use serde::{Deserialize, Serialize};

Expand Down Expand Up @@ -42,6 +42,27 @@ pub struct OptimismExecutionPayloadEnvelopeV3 {
pub parent_beacon_block_root: B256,
}

/// This structure maps for the return value of `engine_getPayload` of the beacon chain spec, for
/// V4.
///
/// See also:
/// [Optimism execution payload envelope v4] <https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/exec-engine.md#engine_getpayloadv4>
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct OptimismExecutionPayloadEnvelopeV4 {
/// Execution payload V4
pub execution_payload: ExecutionPayloadV4,
/// The expected value to be received by the feeRecipient in wei
pub block_value: U256,
/// The blobs, commitments, and proofs associated with the executed payload.
pub blobs_bundle: BlobsBundleV1,
/// Introduced in V3, this represents a suggestion from the execution layer if the payload
/// should be used instead of an externally provided one.
pub should_override_builder: bool,
/// Ecotone parent beacon block root
pub parent_beacon_block_root: B256,
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 233b6ea

Please sign in to comment.