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: remove reth-primitives dep from op-primitives #13699

Merged
merged 2 commits into from
Jan 7, 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.

3 changes: 1 addition & 2 deletions crates/e2e-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ reth-rpc-api = { workspace = true, features = ["client"] }
reth-payload-builder = { workspace = true, features = ["test-utils"] }
reth-payload-builder-primitives.workspace = true
reth-payload-primitives.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-network.workspace = true
reth-node-api.workspace = true
Expand All @@ -35,7 +34,7 @@ reth-engine-local.workspace = true
reth-tasks.workspace = true

# currently need to enable this for workspace level
reth-optimism-primitives = { workspace = true, features = ["arbitrary"] }
reth-optimism-primitives = { workspace = true, features = ["arbitrary", "serde"] }

# rpc
jsonrpsee.workspace = true
Expand Down
11 changes: 3 additions & 8 deletions crates/optimism/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
reth-primitives-traits = { workspace = true, features = ["op"] }
reth-codecs = { workspace = true, optional = true, features = ["op"] }
reth-zstd-compressors = { workspace = true, optional = true }
Expand Down Expand Up @@ -48,13 +47,13 @@ proptest-arbitrary-interop.workspace = true
reth-codecs = { workspace = true, features = ["test-utils", "op"] }
rstest.workspace = true
arbitrary.workspace = true
secp256k1 = { workspace = true, features = ["rand"] }
proptest.workspace = true

[features]
default = ["std", "serde"]
default = ["std"]
std = [
"reth-primitives-traits/std",
"reth-primitives/std",
"reth-codecs?/std",
"alloy-consensus/std",
"alloy-eips/std",
Expand All @@ -74,10 +73,8 @@ reth-codec = [
"std",
"dep:proptest",
"dep:arbitrary",
"reth-primitives/reth-codec",
"reth-primitives-traits/reth-codec",
"reth-codecs?/op",
"reth-primitives/reth-codec",
"dep:bytes",
"dep:modular-bitfield",
"dep:reth-zstd-compressors"
Expand All @@ -99,14 +96,13 @@ serde-bincode-compat = [
"alloy-consensus/serde-bincode-compat",
"alloy-eips/serde-bincode-compat",
"op-alloy-consensus/serde-bincode-compat",
"reth-primitives/serde-bincode-compat",
"reth-primitives-traits/serde-bincode-compat"
]
arbitrary = [
"dep:arbitrary",
"dep:secp256k1",
"secp256k1?/rand",
"reth-primitives-traits/arbitrary",
"reth-primitives/arbitrary",
"reth-codecs?/arbitrary",
"op-alloy-consensus/arbitrary",
"alloy-consensus/arbitrary",
Expand All @@ -118,5 +114,4 @@ arbitrary = [
optimism = [
"dep:revm-primitives",
"revm-primitives/optimism",
"reth-primitives/optimism"
]
4 changes: 2 additions & 2 deletions crates/optimism/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod receipt;
pub use receipt::OpReceipt;

/// Optimism-specific block type.
pub type OpBlock = reth_primitives::Block<OpTransactionSigned>;
pub type OpBlock = alloy_consensus::Block<OpTransactionSigned>;

/// Optimism-specific block body type.
pub type OpBlockBody = <OpBlock as Block>::Body;
Expand All @@ -31,7 +31,7 @@ pub type OpBlockBody = <OpBlock as Block>::Body;
pub struct OpPrimitives;

#[cfg(feature = "optimism")]
impl reth_primitives::NodePrimitives for OpPrimitives {
impl reth_primitives_traits::NodePrimitives for OpPrimitives {
type Block = OpBlock;
type BlockHeader = alloy_consensus::Header;
type BlockBody = OpBlockBody;
Expand Down
4 changes: 2 additions & 2 deletions crates/optimism/primitives/src/transaction/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use op_alloy_consensus::{OpPooledTransaction, OpTypedTransaction, TxDeposit};
#[cfg(any(test, feature = "reth-codec"))]
use proptest as _;
use reth_primitives_traits::{
crypto::secp256k1::{recover_signer, recover_signer_unchecked, sign_message},
crypto::secp256k1::{recover_signer, recover_signer_unchecked},
transaction::error::TransactionConversionError,
InMemorySize, SignedTransaction,
};
Expand Down Expand Up @@ -519,7 +519,7 @@ impl<'a> arbitrary::Arbitrary<'a> for OpTransactionSigned {

let secp = secp256k1::Secp256k1::new();
let key_pair = secp256k1::Keypair::new(&secp, &mut rand::thread_rng());
let signature = sign_message(
let signature = reth_primitives_traits::crypto::secp256k1::sign_message(
B256::from_slice(&key_pair.secret_bytes()[..]),
signature_hash(&transaction),
)
Expand Down
Loading