Skip to content

Commit

Permalink
chore: remove constants reexport (#12549)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Nov 14, 2024
1 parent bd29f82 commit a7bb1d1
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 21 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions bin/reth-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ reth-node-core.workspace = true
reth-node-api.workspace = true
reth-rpc-types-compat.workspace = true
reth-primitives = { workspace = true, features = ["alloy-compat"] }
reth-primitives-traits.workspace = true
reth-tracing.workspace = true

# alloy
Expand Down
2 changes: 1 addition & 1 deletion bin/reth-bench/src/bench/output.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains various benchmark output formats, either for logging or for
//! serialization to / from files.

use reth_primitives::constants::gas_units::GIGAGAS;
use reth_primitives_traits::constants::GIGAGAS;
use serde::{ser::SerializeStruct, Serialize};
use std::time::Duration;

Expand Down
16 changes: 11 additions & 5 deletions crates/consensus/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ workspace = true
[dependencies]
# reth
reth-primitives.workspace = true
reth-primitives-traits.workspace = true

# ethereum
alloy-eips.workspace = true
Expand All @@ -26,9 +27,14 @@ derive_more.workspace = true
[features]
default = ["std"]
std = [
"reth-primitives/std",
"alloy-primitives/std",
"alloy-eips/std",
"alloy-consensus/std",
"reth-primitives/std",
"reth-primitives-traits/std",
"alloy-primitives/std",
"alloy-eips/std",
"alloy-consensus/std",
"reth-primitives-traits/std"
]
test-utils = [
"reth-primitives/test-utils",
"reth-primitives-traits/test-utils"
]
test-utils = ["reth-primitives/test-utils"]
5 changes: 3 additions & 2 deletions crates/consensus/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ use alloy_consensus::Header;
use alloy_eips::eip7685::Requests;
use alloy_primitives::{BlockHash, BlockNumber, Bloom, B256, U256};
use reth_primitives::{
constants::MINIMUM_GAS_LIMIT, BlockBody, BlockWithSenders, GotExpected, GotExpectedBoxed,
InvalidTransactionError, Receipt, SealedBlock, SealedHeader,
BlockBody, BlockWithSenders, GotExpected, GotExpectedBoxed, InvalidTransactionError, Receipt,
SealedBlock, SealedHeader,
};
use reth_primitives_traits::constants::MINIMUM_GAS_LIMIT;

/// A consensus implementation that does nothing.
pub mod noop;
Expand Down
1 change: 1 addition & 0 deletions crates/ethereum/consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ workspace = true
reth-chainspec.workspace = true
reth-consensus-common.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-consensus.workspace = true

# alloy
Expand Down
5 changes: 2 additions & 3 deletions crates/ethereum/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ use reth_consensus_common::validation::{
validate_against_parent_timestamp, validate_block_pre_execution, validate_body_against_header,
validate_header_base_fee, validate_header_extradata, validate_header_gas,
};
use reth_primitives::{
constants::MINIMUM_GAS_LIMIT, BlockBody, BlockWithSenders, SealedBlock, SealedHeader,
};
use reth_primitives::{BlockBody, BlockWithSenders, SealedBlock, SealedHeader};
use reth_primitives_traits::constants::MINIMUM_GAS_LIMIT;
use std::{fmt::Debug, sync::Arc, time::SystemTime};

/// The bound divisor of the gas limit, used in update calculations.
Expand Down
4 changes: 3 additions & 1 deletion crates/net/eth-wire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ workspace = true
# reth
reth-codecs.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-ecies.workspace = true
alloy-rlp = { workspace = true, features = ["derive"] }
reth-eth-wire-types.workspace = true
Expand Down Expand Up @@ -72,7 +73,8 @@ arbitrary = [
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"reth-codecs/arbitrary",
"alloy-chains/arbitrary"
"alloy-chains/arbitrary",
"reth-primitives-traits/arbitrary"
]
serde = [
"dep:serde",
Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire/src/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{Capability, EthVersion, ProtocolVersion};
use alloy_rlp::{RlpDecodable, RlpEncodable};
use reth_codecs::add_arbitrary_tests;
use reth_network_peers::PeerId;
use reth_primitives::constants::RETH_CLIENT_VERSION;
use reth_primitives_traits::constants::RETH_CLIENT_VERSION;

/// The default tcp port for p2p.
///
Expand Down
1 change: 1 addition & 0 deletions crates/payload/basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-transaction-pool.workspace = true
reth-provider.workspace = true
reth-payload-builder.workspace = true
Expand Down
3 changes: 2 additions & 1 deletion crates/payload/basic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ use reth_payload_builder::{KeepPayloadJobAlive, PayloadId, PayloadJob, PayloadJo
use reth_payload_primitives::{
BuiltPayload, PayloadBuilderAttributes, PayloadBuilderError, PayloadKind,
};
use reth_primitives::{constants::RETH_CLIENT_VERSION, proofs, SealedHeader};
use reth_primitives::{proofs, SealedHeader};
use reth_primitives_traits::constants::RETH_CLIENT_VERSION;
use reth_provider::{BlockReaderIdExt, CanonStateNotification, StateProviderFactory};
use reth_revm::cached::CachedReads;
use reth_tasks::TaskSpawner;
Expand Down
3 changes: 0 additions & 3 deletions crates/primitives/src/constants/mod.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ mod alloy_compat;
mod block;
#[cfg(feature = "reth-codec")]
mod compression;
pub mod constants;
pub mod proofs;
mod receipt;
pub use reth_static_file_types as static_file;
Expand All @@ -36,7 +35,6 @@ pub use block::{generate_valid_header, valid_header_strategy};
pub use block::{Block, BlockBody, BlockWithSenders, SealedBlock, SealedBlockWithSenders};
#[cfg(feature = "reth-codec")]
pub use compression::*;
pub use constants::HOLESKY_GENESIS_HASH;
pub use receipt::{
gas_spent_by_transactions, Receipt, ReceiptWithBloom, ReceiptWithBloomRef, Receipts,
};
Expand Down
5 changes: 3 additions & 2 deletions crates/storage/db-common/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,9 @@ struct GenesisAccountWithAddress {
#[cfg(test)]
mod tests {
use super::*;
use alloy_consensus::constants::{MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH};
use alloy_consensus::constants::{
HOLESKY_GENESIS_HASH, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH,
};
use alloy_genesis::Genesis;
use reth_chainspec::{Chain, ChainSpec, HOLESKY, MAINNET, SEPOLIA};
use reth_db::DatabaseEnv;
Expand All @@ -595,7 +597,6 @@ mod tests {
transaction::DbTx,
Database,
};
use reth_primitives::HOLESKY_GENESIS_HASH;
use reth_primitives_traits::IntegerList;
use reth_provider::{
test_utils::{create_test_provider_factory_with_chain_spec, MockNodeTypesWithDB},
Expand Down

0 comments on commit a7bb1d1

Please sign in to comment.