chore: improve deps for payload prims (#12374)

This commit is contained in:
Matthias Seitz
2024-11-07 17:56:35 +01:00
committed by GitHub
parent e911fe9ff0
commit d0baf926bf
7 changed files with 16 additions and 14 deletions

View File

@ -16,6 +16,7 @@ workflows:
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually. # Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
"--left-side-feature-missing=ignore", "--left-side-feature-missing=ignore",
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on. # Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.
"--left-side-outside-workspace=ignore", "--left-side-outside-workspace=ignore",
# Auxillary flags: # Auxillary flags:
"--offline", "--offline",

2
Cargo.lock generated
View File

@ -8417,7 +8417,7 @@ version = "1.1.1"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips",
"alloy-primitives", "alloy-primitives",
"alloy-rpc-types", "alloy-rpc-types-engine",
"async-trait", "async-trait",
"op-alloy-rpc-types-engine", "op-alloy-rpc-types-engine",
"pin-project", "pin-project",

View File

@ -32,7 +32,7 @@ reth-chainspec = { workspace = true, optional = true }
# ethereum # ethereum
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true alloy-rpc-types-engine = { workspace = true, features = ["std"] }
alloy-eips.workspace = true alloy-eips.workspace = true
# async # async

View File

@ -22,7 +22,7 @@ reth-rpc-types-compat.workspace = true
reth-evm.workspace = true reth-evm.workspace = true
reth-execution-types.workspace = true reth-execution-types.workspace = true
reth-payload-builder.workspace = true reth-payload-builder.workspace = true
reth-payload-primitives.workspace = true reth-payload-primitives = { workspace = true, features = ["op"] }
reth-basic-payload-builder.workspace = true reth-basic-payload-builder.workspace = true
reth-trie.workspace = true reth-trie.workspace = true
reth-chain-state.workspace = true reth-chain-state.workspace = true

View File

@ -22,8 +22,8 @@ reth-chain-state.workspace = true
# alloy # alloy
alloy-eips.workspace = true alloy-eips.workspace = true
alloy-primitives.workspace = true alloy-primitives.workspace = true
alloy-rpc-types = { workspace = true, features = ["engine"] } alloy-rpc-types-engine = { workspace = true, features = ["serde"] }
op-alloy-rpc-types-engine.workspace = true op-alloy-rpc-types-engine = { workspace = true, optional = true }
# async # async
async-trait.workspace = true async-trait.workspace = true
@ -35,3 +35,6 @@ pin-project.workspace = true
serde.workspace = true serde.workspace = true
thiserror.workspace = true thiserror.workspace = true
tracing.workspace = true tracing.workspace = true
[features]
op = ["dep:op-alloy-rpc-types-engine"]

View File

@ -1,6 +1,7 @@
use crate::{MessageValidationKind, PayloadAttributes}; use crate::{MessageValidationKind, PayloadAttributes};
use alloy_eips::eip4895::Withdrawal;
use alloy_primitives::B256; use alloy_primitives::B256;
use alloy_rpc_types::engine::ExecutionPayload; use alloy_rpc_types_engine::ExecutionPayload;
/// Either an [`ExecutionPayload`] or a types that implements the [`PayloadAttributes`] trait. /// Either an [`ExecutionPayload`] or a types that implements the [`PayloadAttributes`] trait.
/// ///
@ -39,7 +40,7 @@ where
Attributes: PayloadAttributes, Attributes: PayloadAttributes,
{ {
/// Return the withdrawals for the payload or attributes. /// Return the withdrawals for the payload or attributes.
pub fn withdrawals(&self) -> Option<&Vec<alloy_rpc_types::Withdrawal>> { pub fn withdrawals(&self) -> Option<&Vec<Withdrawal>> {
match self { match self {
Self::ExecutionPayload { payload, .. } => payload.withdrawals(), Self::ExecutionPayload { payload, .. } => payload.withdrawals(),
Self::PayloadAttributes(attributes) => attributes.withdrawals(), Self::PayloadAttributes(attributes) => attributes.withdrawals(),

View File

@ -1,11 +1,7 @@
use crate::{PayloadEvents, PayloadKind, PayloadTypes}; use crate::{PayloadEvents, PayloadKind, PayloadTypes};
use alloy_eips::eip7685::Requests; use alloy_eips::{eip4895::Withdrawal, eip7685::Requests};
use alloy_primitives::{Address, B256, U256}; use alloy_primitives::{Address, B256, U256};
use alloy_rpc_types::{ use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
engine::{PayloadAttributes as EthPayloadAttributes, PayloadId},
Withdrawal,
};
use op_alloy_rpc_types_engine::OpPayloadAttributes;
use reth_chain_state::ExecutedBlock; use reth_chain_state::ExecutedBlock;
use reth_primitives::{SealedBlock, Withdrawals}; use reth_primitives::{SealedBlock, Withdrawals};
use tokio::sync::oneshot; use tokio::sync::oneshot;
@ -146,7 +142,8 @@ impl PayloadAttributes for EthPayloadAttributes {
} }
} }
impl PayloadAttributes for OpPayloadAttributes { #[cfg(feature = "op")]
impl PayloadAttributes for op_alloy_rpc_types_engine::OpPayloadAttributes {
fn timestamp(&self) -> u64 { fn timestamp(&self) -> u64 {
self.payload_attributes.timestamp self.payload_attributes.timestamp
} }