Skip to content

Commit

Permalink
chore: improve deps for payload prims (paradigmxyz#12374)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 7, 2024
1 parent e911fe9 commit d0baf92
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
1 change: 1 addition & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"--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.

"--left-side-outside-workspace=ignore",
# Auxillary flags:
"--offline",
Expand Down
2 changes: 1 addition & 1 deletion 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/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reth-chainspec = { workspace = true, optional = true }

# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["std"] }
alloy-eips.workspace = true

# async
Expand Down
2 changes: 1 addition & 1 deletion crates/optimism/payload/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ reth-rpc-types-compat.workspace = true
reth-evm.workspace = true
reth-execution-types.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-trie.workspace = true
reth-chain-state.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions crates/payload/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ reth-chain-state.workspace = true
# alloy
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types = { workspace = true, features = ["engine"] }
op-alloy-rpc-types-engine.workspace = true
alloy-rpc-types-engine = { workspace = true, features = ["serde"] }
op-alloy-rpc-types-engine = { workspace = true, optional = true }

# async
async-trait.workspace = true
Expand All @@ -35,3 +35,6 @@ pin-project.workspace = true
serde.workspace = true
thiserror.workspace = true
tracing.workspace = true

[features]
op = ["dep:op-alloy-rpc-types-engine"]
5 changes: 3 additions & 2 deletions crates/payload/primitives/src/payload.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{MessageValidationKind, PayloadAttributes};
use alloy_eips::eip4895::Withdrawal;
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.
///
Expand Down Expand Up @@ -39,7 +40,7 @@ where
Attributes: PayloadAttributes,
{
/// 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 {
Self::ExecutionPayload { payload, .. } => payload.withdrawals(),
Self::PayloadAttributes(attributes) => attributes.withdrawals(),
Expand Down
11 changes: 4 additions & 7 deletions crates/payload/primitives/src/traits.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
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_rpc_types::{
engine::{PayloadAttributes as EthPayloadAttributes, PayloadId},
Withdrawal,
};
use op_alloy_rpc_types_engine::OpPayloadAttributes;
use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
use reth_chain_state::ExecutedBlock;
use reth_primitives::{SealedBlock, Withdrawals};
use tokio::sync::oneshot;
Expand Down Expand Up @@ -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 {
self.payload_attributes.timestamp
}
Expand Down

0 comments on commit d0baf92

Please sign in to comment.