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

chore: convert_to_payload_body_v1 #14168

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/rpc/rpc-engine-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ reth-payload-builder.workspace = true
reth-payload-builder-primitives.workspace = true
reth-payload-primitives.workspace = true
reth-tasks.workspace = true
reth-rpc-types-compat.workspace = true
reth-engine-primitives.workspace = true
reth-transaction-pool.workspace = true
reth-primitives-traits.workspace = true

# ethereum
alloy-eips.workspace = true
Expand Down
21 changes: 15 additions & 6 deletions crates/rpc/rpc-engine-api/src/engine_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ use crate::{
use alloy_eips::{
eip1898::BlockHashOrNumber,
eip4844::BlobAndProofV1,
eip4895::Withdrawals,
eip7685::{Requests, RequestsOrHash},
};
use alloy_primitives::{BlockHash, BlockNumber, B256, U64};
use alloy_rpc_types_engine::{
CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1,
ExecutionPayloadInputV2, ExecutionPayloadSidecar, ExecutionPayloadV1, ExecutionPayloadV3,
ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, PraguePayloadFields,
TransitionConfiguration,
ExecutionPayloadBodyV1, ExecutionPayloadInputV2, ExecutionPayloadSidecar, ExecutionPayloadV1,
ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus,
PraguePayloadFields, TransitionConfiguration,
};
use async_trait::async_trait;
use jsonrpsee_core::RpcResult;
Expand All @@ -23,8 +24,8 @@ use reth_payload_primitives::{
validate_payload_timestamp, EngineApiMessageVersion, PayloadBuilderAttributes,
PayloadOrAttributes,
};
use reth_primitives_traits::{Block, BlockBody};
use reth_rpc_api::EngineApiServer;
use reth_rpc_types_compat::engine::payload::convert_to_payload_body_v1;
use reth_storage_api::{BlockReader, HeaderProvider, StateProviderFactory};
use reth_tasks::TaskSpawner;
use reth_transaction_pool::TransactionPool;
Expand Down Expand Up @@ -551,7 +552,11 @@ where
start: BlockNumber,
count: u64,
) -> EngineApiResult<ExecutionPayloadBodiesV1> {
self.get_payload_bodies_by_range_with(start, count, convert_to_payload_body_v1).await
self.get_payload_bodies_by_range_with(start, count, |block| ExecutionPayloadBodyV1 {
transactions: block.body().encoded_2718_transactions(),
withdrawals: block.body().withdrawals().cloned().map(Withdrawals::into_inner),
})
.await
}

/// Called to retrieve execution payload bodies by hashes.
Expand Down Expand Up @@ -597,7 +602,11 @@ where
&self,
hashes: Vec<BlockHash>,
) -> EngineApiResult<ExecutionPayloadBodiesV1> {
self.get_payload_bodies_by_hash_with(hashes, convert_to_payload_body_v1).await
self.get_payload_bodies_by_hash_with(hashes, |block| ExecutionPayloadBodyV1 {
transactions: block.body().encoded_2718_transactions(),
withdrawals: block.body().withdrawals().cloned().map(Withdrawals::into_inner),
})
.await
}

/// Called to verify network configuration parameters and ensure that Consensus and Execution
Expand Down
2 changes: 0 additions & 2 deletions crates/rpc/rpc-types-compat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ reth-primitives.workspace = true
reth-primitives-traits.workspace = true

# ethereum
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types-eth = { workspace = true, default-features = false, features = ["serde"] }
alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true

# io
Expand Down
2 changes: 0 additions & 2 deletions crates/rpc/rpc-types-compat/src/engine/mod.rs

This file was deleted.

253 changes: 0 additions & 253 deletions crates/rpc/rpc-types-compat/src/engine/payload.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/rpc/rpc-types-compat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

pub mod block;
pub mod engine;
pub mod transaction;
pub use transaction::TransactionCompat;
Loading