Skip to content

Commit

Permalink
chore: rename v1 type (paradigmxyz#12205)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 30, 2024
1 parent 755fac0 commit b3e8327
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
18 changes: 12 additions & 6 deletions crates/engine/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,39 @@ 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>,
> + DeserializeOwned
+ 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
+ Unpin
+ Send
+ Sync
+ 'static;
/// Execution Payload V3 type.
/// Execution Payload V3 envelope type.
type ExecutionPayloadEnvelopeV3: DeserializeOwned
+ Serialize
+ Clone
+ Unpin
+ Send
+ Sync
+ 'static;
/// Execution Payload V4 type.
/// Execution Payload V4 envelope type.
type ExecutionPayloadEnvelopeV4: DeserializeOwned
+ Serialize
+ Clone
Expand Down
2 changes: 1 addition & 1 deletion crates/ethereum/engine-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ where
+ TryInto<ExecutionPayloadEnvelopeV3>
+ TryInto<ExecutionPayloadEnvelopeV4>,
{
type ExecutionPayloadV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = ExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = ExecutionPayloadEnvelopeV4;
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/node/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ where
+ TryInto<OpExecutionPayloadEnvelopeV3>
+ TryInto<OpExecutionPayloadEnvelopeV4>,
{
type ExecutionPayloadV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = OpExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = OpExecutionPayloadEnvelopeV4;
Expand Down
5 changes: 4 additions & 1 deletion crates/rpc/rpc-api/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>
///
Expand Down
4 changes: 2 additions & 2 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-engine-types/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl PayloadTypes for CustomEngineTypes {
}

impl EngineTypes for CustomEngineTypes {
type ExecutionPayloadV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV1 = ExecutionPayloadV1;
type ExecutionPayloadEnvelopeV2 = ExecutionPayloadEnvelopeV2;
type ExecutionPayloadEnvelopeV3 = ExecutionPayloadEnvelopeV3;
type ExecutionPayloadEnvelopeV4 = ExecutionPayloadEnvelopeV4;
Expand Down

0 comments on commit b3e8327

Please sign in to comment.