Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add op payload type #742

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading