From 7b4bf59445d27e9c5b7ca923d0c3471b5e192efb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 18 Jul 2024 11:36:45 +0200 Subject: [PATCH] chore: disable reth-codec default feature (#9556) --- Cargo.toml | 2 +- crates/primitives/src/transaction/eip4844.rs | 2 ++ crates/primitives/src/transaction/tx_type.rs | 3 ++- crates/storage/db-api/Cargo.toml | 2 +- crates/storage/db/Cargo.toml | 2 +- crates/storage/provider/Cargo.toml | 2 +- crates/transaction-pool/Cargo.toml | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b81e5f596..afcfd1e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -340,7 +340,7 @@ reth-optimism-rpc = { path = "crates/optimism/rpc" } reth-payload-builder = { path = "crates/payload/builder" } reth-payload-primitives = { path = "crates/payload/primitives" } reth-payload-validator = { path = "crates/payload/validator" } -reth-primitives = { path = "crates/primitives" } +reth-primitives = { path = "crates/primitives", default-features = false, features = ["std"] } reth-primitives-traits = { path = "crates/primitives-traits", default-features = false } reth-provider = { path = "crates/storage/provider" } reth-prune = { path = "crates/prune/prune" } diff --git a/crates/primitives/src/transaction/eip4844.rs b/crates/primitives/src/transaction/eip4844.rs index 234c558a1..b035b396c 100644 --- a/crates/primitives/src/transaction/eip4844.rs +++ b/crates/primitives/src/transaction/eip4844.rs @@ -5,6 +5,8 @@ use crate::{ }; use alloy_rlp::{length_of_length, Decodable, Encodable, Header}; use core::mem; + +#[cfg(any(test, feature = "reth-codec"))] use reth_codecs::Compact; /// To be used with `Option` to place or replace one bit on the bitflag struct. diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index d31cba060..963d38ace 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -1,6 +1,5 @@ use crate::{U64, U8}; use alloy_rlp::{Decodable, Encodable}; -use bytes::Buf; use serde::{Deserialize, Serialize}; #[cfg(test)] @@ -9,6 +8,7 @@ use reth_codecs::Compact; /// For backwards compatibility purposes only 2 bits of the type are encoded in the identifier /// parameter. In the case of a 3, the full transaction type is read from the buffer as a /// single byte. +#[cfg(any(test, feature = "reth-codec"))] const COMPACT_EXTENDED_IDENTIFIER_FLAG: usize = 3; /// Identifier for legacy transaction, however [`TxLegacy`](crate::TxLegacy) this is technically not @@ -166,6 +166,7 @@ impl reth_codecs::Compact for TxType { // parameter. In the case of a 3, the full transaction type is read from the buffer as a // single byte. fn from_compact(mut buf: &[u8], identifier: usize) -> (Self, &[u8]) { + use bytes::Buf; ( match identifier { 0 => Self::Legacy, diff --git a/crates/storage/db-api/Cargo.toml b/crates/storage/db-api/Cargo.toml index 7286e03f2..087d3709d 100644 --- a/crates/storage/db-api/Cargo.toml +++ b/crates/storage/db-api/Cargo.toml @@ -14,7 +14,7 @@ workspace = true [dependencies] # reth reth-codecs.workspace = true -reth-primitives.workspace = true +reth-primitives = { workspace = true, features = ["reth-codec"] } reth-primitives-traits.workspace = true reth-prune-types.workspace = true reth-storage-errors.workspace = true diff --git a/crates/storage/db/Cargo.toml b/crates/storage/db/Cargo.toml index 117ec5ccc..12db949f6 100644 --- a/crates/storage/db/Cargo.toml +++ b/crates/storage/db/Cargo.toml @@ -14,7 +14,7 @@ workspace = true [dependencies] # reth reth-db-api.workspace = true -reth-primitives.workspace = true +reth-primitives = { workspace = true, features = ["reth-codec"] } reth-primitives-traits.workspace = true reth-fs-util.workspace = true reth-storage-errors.workspace = true diff --git a/crates/storage/provider/Cargo.toml b/crates/storage/provider/Cargo.toml index bca77d0c5..c0f8db69f 100644 --- a/crates/storage/provider/Cargo.toml +++ b/crates/storage/provider/Cargo.toml @@ -16,7 +16,7 @@ workspace = true reth-chainspec.workspace = true reth-blockchain-tree-api.workspace = true reth-execution-types.workspace = true -reth-primitives.workspace = true +reth-primitives = { workspace = true, features = ["reth-codec"] } reth-fs-util.workspace = true reth-errors.workspace = true reth-storage-errors.workspace = true diff --git a/crates/transaction-pool/Cargo.toml b/crates/transaction-pool/Cargo.toml index 77edd6f3e..459784b61 100644 --- a/crates/transaction-pool/Cargo.toml +++ b/crates/transaction-pool/Cargo.toml @@ -15,7 +15,7 @@ workspace = true # reth reth-chainspec.workspace = true reth-eth-wire-types.workspace = true -reth-primitives.workspace = true +reth-primitives = { workspace = true, features = ["c-kzg"] } reth-execution-types.workspace = true reth-fs-util.workspace = true reth-provider.workspace = true