chore: remove constants reexport (#12549)

This commit is contained in:
Matthias Seitz
2024-11-14 18:36:31 +01:00
committed by GitHub
parent bd29f82567
commit a7bb1d1fa3
14 changed files with 34 additions and 21 deletions

5
Cargo.lock generated
View File

@ -6438,6 +6438,7 @@ dependencies = [
"reth-payload-builder",
"reth-payload-primitives",
"reth-primitives",
"reth-primitives-traits",
"reth-provider",
"reth-revm",
"reth-tasks",
@ -6526,6 +6527,7 @@ dependencies = [
"reth-node-api",
"reth-node-core",
"reth-primitives",
"reth-primitives-traits",
"reth-rpc-types-compat",
"reth-tracing",
"serde",
@ -6802,6 +6804,7 @@ dependencies = [
"auto_impl",
"derive_more 1.0.0",
"reth-primitives",
"reth-primitives-traits",
]
[[package]]
@ -7330,6 +7333,7 @@ dependencies = [
"reth-metrics",
"reth-network-peers",
"reth-primitives",
"reth-primitives-traits",
"reth-tracing",
"secp256k1",
"serde",
@ -7388,6 +7392,7 @@ dependencies = [
"reth-consensus",
"reth-consensus-common",
"reth-primitives",
"reth-primitives-traits",
"tracing",
]

View File

@ -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

View File

@ -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;

View File

@ -13,6 +13,7 @@ workspace = true
[dependencies]
# reth
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
# ethereum
alloy-eips.workspace = true
@ -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"]

View File

@ -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;

View File

@ -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

View File

@ -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.

View File

@ -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
@ -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",

View File

@ -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.
///

View File

@ -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

View File

@ -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;

View File

@ -1,3 +0,0 @@
//! Ethereum protocol-related constants
pub use reth_primitives_traits::constants::*;

View File

@ -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;
@ -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,
};

View File

@ -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;
@ -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},