chore: rename v1 type (#12205)

This commit is contained in:
Matthias Seitz
2024-10-30 18:56:36 +01:00
committed by GitHub
parent 755fac08dd
commit b3e8327065
6 changed files with 21 additions and 12 deletions

View File

@ -23,7 +23,7 @@ use serde::{de::DeserializeOwned, ser::Serialize};
/// payload job. Hence this trait is also [`PayloadTypes`].
pub trait EngineTypes:
PayloadTypes<
BuiltPayload: TryInto<Self::ExecutionPayloadV1>
BuiltPayload: TryInto<Self::ExecutionPayloadEnvelopeV1>
+ TryInto<Self::ExecutionPayloadEnvelopeV2>
+ TryInto<Self::ExecutionPayloadEnvelopeV3>
+ TryInto<Self::ExecutionPayloadEnvelopeV4>,
@ -31,9 +31,15 @@ pub trait EngineTypes:
+ Serialize
+ 'static
{
/// Execution Payload V1 type.
type ExecutionPayloadV1: DeserializeOwned + Serialize + Clone + Unpin + Send + Sync + 'static;
/// Execution Payload V2 type.
/// Execution Payload V1 envelope type.
type ExecutionPayloadEnvelopeV1: DeserializeOwned
+ Serialize
+ Clone
+ Unpin
+ Send
+ Sync
+ 'static;
/// Execution Payload V2 envelope type.
type ExecutionPayloadEnvelopeV2: DeserializeOwned
+ Serialize
+ Clone
@ -41,7 +47,7 @@ pub trait EngineTypes:
+ Send
+ Sync
+ 'static;
/// Execution Payload V3 type.
/// Execution Payload V3 envelope type.
type ExecutionPayloadEnvelopeV3: DeserializeOwned
+ Serialize
+ Clone
@ -49,7 +55,7 @@ pub trait EngineTypes:
+ Send
+ Sync
+ 'static;
/// Execution Payload V4 type.
/// Execution Payload V4 envelope type.
type ExecutionPayloadEnvelopeV4: DeserializeOwned
+ Serialize
+ Clone

View File

@ -43,7 +43,7 @@ where
+ TryInto<ExecutionPayloadEnvelopeV3>
+ TryInto<ExecutionPayloadEnvelopeV4>,
{
type ExecutionPayloadV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = ExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = ExecutionPayloadEnvelopeV4;

View File

@ -39,7 +39,7 @@ where
+ TryInto<OpExecutionPayloadEnvelopeV3>
+ TryInto<OpExecutionPayloadEnvelopeV4>,
{
type ExecutionPayloadV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = OpExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = OpExecutionPayloadEnvelopeV4;

View File

@ -110,7 +110,10 @@ pub trait EngineApi<Engine: EngineTypes> {
/// Note:
/// > Provider software MAY stop the corresponding build process after serving this call.
#[method(name = "getPayloadV1")]
async fn get_payload_v1(&self, payload_id: PayloadId) -> RpcResult<Engine::ExecutionPayloadV1>;
async fn get_payload_v1(
&self,
payload_id: PayloadId,
) -> RpcResult<Engine::ExecutionPayloadEnvelopeV1>;
/// See also <https://github.com/ethereum/execution-apis/blob/6709c2a795b707202e93c4f2867fa0bf2640a84f/src/engine/shanghai.md#engine_getpayloadv2>
///

View File

@ -281,7 +281,7 @@ where
pub async fn get_payload_v1(
&self,
payload_id: PayloadId,
) -> EngineApiResult<EngineT::ExecutionPayloadV1> {
) -> EngineApiResult<EngineT::ExecutionPayloadEnvelopeV1> {
self.inner
.payload_store
.resolve(payload_id)
@ -775,7 +775,7 @@ where
async fn get_payload_v1(
&self,
payload_id: PayloadId,
) -> RpcResult<EngineT::ExecutionPayloadV1> {
) -> RpcResult<EngineT::ExecutionPayloadEnvelopeV1> {
trace!(target: "rpc::engine", "Serving engine_getPayloadV1");
let start = Instant::now();
let res = Self::get_payload_v1(self, payload_id).await;