Skip to content

Commit

Permalink
revert to ExecutionPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
mask-pp committed Dec 25, 2024
1 parent c837a31 commit dbe7ca8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions crates/payload/primitives/src/payload.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{MessageValidationKind, PayloadAttributes};
use alloy_eips::eip4895::Withdrawal;
use alloy_primitives::B256;
use reth_taiko_engine_types::TaikoExecutionPayload;
use alloy_rpc_types_engine::ExecutionPayload;

/// Either an [`ExecutionPayload`] or a types that implements the [`PayloadAttributes`] trait.
///
Expand All @@ -11,7 +11,7 @@ pub enum PayloadOrAttributes<'a, Attributes> {
/// An [`ExecutionPayload`] and optional parent beacon block root.
ExecutionPayload {
/// The inner execution payload
payload: &'a TaikoExecutionPayload,
payload: &'a ExecutionPayload,
/// The parent beacon block root
parent_beacon_block_root: Option<B256>,
},
Expand All @@ -23,7 +23,7 @@ impl<'a, Attributes> PayloadOrAttributes<'a, Attributes> {
/// Construct a [`PayloadOrAttributes`] from an [`ExecutionPayload`] and optional parent beacon
/// block root.
pub const fn from_execution_payload(
payload: &'a TaikoExecutionPayload,
payload: &'a ExecutionPayload,
parent_beacon_block_root: Option<B256>,
) -> Self {
Self::ExecutionPayload { payload, parent_beacon_block_root }
Expand Down
15 changes: 7 additions & 8 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ where
payload: ExecutionPayloadV1,
) -> EngineApiResult<PayloadStatus> {
let payload = ExecutionPayload::from(payload);
let payload = TaikoExecutionPayload::from(payload);
let payload_or_attrs =
PayloadOrAttributes::<'_, EngineT::PayloadAttributes>::from_execution_payload(
&payload, None,
Expand All @@ -155,7 +154,7 @@ where
Ok(self
.inner
.beacon_consensus
.new_payload(payload, ExecutionPayloadSidecar::none())
.new_payload(TaikoExecutionPayload::from(payload), ExecutionPayloadSidecar::none())
.await
.inspect(|_| self.inner.on_new_payload_response())?)
}
Expand All @@ -181,7 +180,6 @@ where
) -> EngineApiResult<PayloadStatus> {
let TaikoExecutionPayloadInputV2 { execution_payload, tx_hash, withdrawals_hash } = payload;
let payload = convert_payload_input_v2_to_payload(execution_payload);
let payload = TaikoExecutionPayload::from((payload, tx_hash, withdrawals_hash));
let payload_or_attrs =
PayloadOrAttributes::<'_, EngineT::PayloadAttributes>::from_execution_payload(
&payload, None,
Expand All @@ -192,7 +190,10 @@ where
Ok(self
.inner
.beacon_consensus
.new_payload(payload, ExecutionPayloadSidecar::none())
.new_payload(
TaikoExecutionPayload::from((payload, tx_hash, withdrawals_hash)),
ExecutionPayloadSidecar::none(),
)
.await
.inspect(|_| self.inner.on_new_payload_response())?)
}
Expand All @@ -219,7 +220,6 @@ where
parent_beacon_block_root: B256,
) -> EngineApiResult<PayloadStatus> {
let payload = ExecutionPayload::from(payload);
let payload = TaikoExecutionPayload::from(payload);
let payload_or_attrs =
PayloadOrAttributes::<'_, EngineT::PayloadAttributes>::from_execution_payload(
&payload,
Expand All @@ -233,7 +233,7 @@ where
.inner
.beacon_consensus
.new_payload(
payload,
TaikoExecutionPayload::from(payload),
ExecutionPayloadSidecar::v3(CancunPayloadFields {
versioned_hashes,
parent_beacon_block_root,
Expand Down Expand Up @@ -269,7 +269,6 @@ where
execution_requests: Requests,
) -> EngineApiResult<PayloadStatus> {
let payload = ExecutionPayload::from(payload);
let payload = TaikoExecutionPayload::from(payload);
let payload_or_attrs =
PayloadOrAttributes::<'_, EngineT::PayloadAttributes>::from_execution_payload(
&payload,
Expand All @@ -283,7 +282,7 @@ where
.inner
.beacon_consensus
.new_payload(
payload,
TaikoExecutionPayload::from(payload),
ExecutionPayloadSidecar::v4(
CancunPayloadFields { versioned_hashes, parent_beacon_block_root },
PraguePayloadFields {
Expand Down

0 comments on commit dbe7ca8

Please sign in to comment.