mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: remove test-utils, arbitrary and proptest from built binary (#9332)
This commit is contained in:
10
.github/workflows/lint.yml
vendored
10
.github/workflows/lint.yml
vendored
@ -160,6 +160,15 @@ jobs:
|
||||
with:
|
||||
cmd: jq empty etc/grafana/dashboards/overview.json
|
||||
|
||||
no-test-deps:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Ensure no arbitrary or proptest dependency on default build
|
||||
run: cargo tree --package reth -e=features,no-dev | grep -Eq "arbitrary|proptest" && exit 1 || exit 0
|
||||
|
||||
lint-success:
|
||||
name: lint success
|
||||
runs-on: ubuntu-latest
|
||||
@ -173,6 +182,7 @@ jobs:
|
||||
- book
|
||||
- codespell
|
||||
- grafana
|
||||
- no-test-deps
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Decide whether the needed jobs succeeded or failed
|
||||
|
||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -3056,6 +3056,7 @@ dependencies = [
|
||||
"reth-db",
|
||||
"reth-db-api",
|
||||
"reth-node-ethereum",
|
||||
"reth-provider",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
|
||||
@ -13,12 +13,12 @@ reth.workspace = true
|
||||
reth-chainspec.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-tracing.workspace = true
|
||||
reth-db.workspace = true
|
||||
reth-db = { workspace = true, features = ["test-utils"] }
|
||||
reth-rpc.workspace = true
|
||||
reth-rpc-layer.workspace = true
|
||||
reth-payload-builder = { workspace = true, features = ["test-utils"] }
|
||||
reth-provider.workspace = true
|
||||
reth-node-builder.workspace = true
|
||||
reth-node-builder = { workspace = true, features = ["test-utils"] }
|
||||
reth-tokio-util.workspace = true
|
||||
reth-stages-types.workspace = true
|
||||
reth-network-peers.workspace = true
|
||||
|
||||
@ -43,3 +43,7 @@ futures.workspace = true
|
||||
tokio.workspace = true
|
||||
futures-util.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
test-utils = ["reth-node-builder/test-utils"]
|
||||
|
||||
@ -24,11 +24,11 @@ reth-exex.workspace = true
|
||||
reth-network.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
reth-node-core.workspace = true
|
||||
reth-node-builder.workspace = true
|
||||
reth-node-builder = { workspace = true, features = ["test-utils"] }
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-payload-builder.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
reth-tasks.workspace = true
|
||||
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ reth-db-common.workspace = true
|
||||
reth-exex.workspace = true
|
||||
reth-evm.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-db = { workspace = true, features = ["mdbx"] }
|
||||
reth-db = { workspace = true, features = ["mdbx"], optional = true }
|
||||
reth-db-api.workspace = true
|
||||
reth-rpc-engine-api.workspace = true
|
||||
reth-rpc.workspace = true
|
||||
@ -78,3 +78,7 @@ tracing.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
test-utils = ["reth-db/test-utils"]
|
||||
|
||||
@ -12,10 +12,6 @@ use crate::{
|
||||
use futures::Future;
|
||||
use reth_chainspec::ChainSpec;
|
||||
use reth_cli_util::get_secret_key;
|
||||
use reth_db::{
|
||||
test_utils::{create_test_rw_db_with_path, tempdir_path, TempDatabase},
|
||||
DatabaseEnv,
|
||||
};
|
||||
use reth_db_api::{
|
||||
database::Database,
|
||||
database_metrics::{DatabaseMetadata, DatabaseMetrics},
|
||||
@ -26,9 +22,8 @@ use reth_network::{
|
||||
};
|
||||
use reth_node_api::{FullNodeTypes, FullNodeTypesAdapter, NodeTypes};
|
||||
use reth_node_core::{
|
||||
args::DatadirArgs,
|
||||
cli::config::{PayloadBuilderConfig, RethTransactionPoolConfig},
|
||||
dirs::{ChainPath, DataDirPath, MaybePlatformPath},
|
||||
dirs::{ChainPath, DataDirPath},
|
||||
node_config::NodeConfig,
|
||||
primitives::Head,
|
||||
};
|
||||
@ -176,19 +171,24 @@ impl<DB> NodeBuilder<DB> {
|
||||
}
|
||||
|
||||
/// Creates an _ephemeral_ preconfigured node for testing purposes.
|
||||
#[cfg(feature = "test-utils")]
|
||||
pub fn testing_node(
|
||||
mut self,
|
||||
task_executor: TaskExecutor,
|
||||
) -> WithLaunchContext<NodeBuilder<Arc<TempDatabase<DatabaseEnv>>>> {
|
||||
let path = MaybePlatformPath::<DataDirPath>::from(tempdir_path());
|
||||
self.config = self
|
||||
.config
|
||||
.with_datadir_args(DatadirArgs { datadir: path.clone(), ..Default::default() });
|
||||
) -> WithLaunchContext<NodeBuilder<Arc<reth_db::test_utils::TempDatabase<reth_db::DatabaseEnv>>>>
|
||||
{
|
||||
let path = reth_node_core::dirs::MaybePlatformPath::<DataDirPath>::from(
|
||||
reth_db::test_utils::tempdir_path(),
|
||||
);
|
||||
self.config = self.config.with_datadir_args(reth_node_core::args::DatadirArgs {
|
||||
datadir: path.clone(),
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
let data_dir =
|
||||
path.unwrap_or_chain_default(self.config.chain.chain, self.config.datadir.clone());
|
||||
|
||||
let db = create_test_rw_db_with_path(data_dir.db());
|
||||
let db = reth_db::test_utils::create_test_rw_db_with_path(data_dir.db());
|
||||
|
||||
WithLaunchContext { builder: self.with_database(db), task_executor }
|
||||
}
|
||||
|
||||
@ -58,8 +58,10 @@ serde_json.workspace = true
|
||||
[dev-dependencies]
|
||||
reth.workspace = true
|
||||
reth-db.workspace = true
|
||||
reth-revm = { workspace = true, features = ["test-utils"] }
|
||||
reth-e2e-test-utils.workspace = true
|
||||
reth-node-builder = { workspace = true, features = ["test-utils"] }
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
reth-revm = { workspace = true, features = ["test-utils"] }
|
||||
tokio.workspace = true
|
||||
alloy-primitives.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
@ -78,3 +80,4 @@ optimism = [
|
||||
"reth-auto-seal-consensus/optimism",
|
||||
"reth-rpc-eth-types/optimism"
|
||||
]
|
||||
test-utils = ["reth-node-builder/test-utils"]
|
||||
|
||||
@ -19,8 +19,8 @@ reth-rpc-api.workspace = true
|
||||
reth-rpc-eth-api.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth-errors.workspace = true
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
|
||||
reth-provider.workspace = true
|
||||
reth-transaction-pool.workspace = true
|
||||
reth-network-api.workspace = true
|
||||
reth-rpc-engine-api.workspace = true
|
||||
reth-revm.workspace = true
|
||||
|
||||
@ -172,8 +172,9 @@ impl<TX: DbTx + 'static> DatabaseProvider<TX> {
|
||||
}
|
||||
|
||||
impl<TX: DbTxMut + DbTx> DatabaseProvider<TX> {
|
||||
#[cfg(any(test, feature = "test-utils"))]
|
||||
/// Inserts an historical block. Used for setting up test environments
|
||||
// TODO: uncomment below, once `reth debug_cmd` has been feature gated with dev.
|
||||
// #[cfg(any(test, feature = "test-utils"))]
|
||||
/// Inserts an historical block. **Used for setting up test environments**
|
||||
pub fn insert_historical_block(
|
||||
&self,
|
||||
block: SealedBlockWithSenders,
|
||||
|
||||
@ -11,7 +11,7 @@ reth.workspace = true
|
||||
reth-chainspec.workspace = true
|
||||
reth-node-core.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-node-ethereum = { workspace = true, features = ["test-utils"] }
|
||||
futures-util.workspace = true
|
||||
|
||||
eyre.workspace = true
|
||||
|
||||
@ -15,7 +15,7 @@ reth-primitives.workspace = true
|
||||
reth-payload-builder.workspace = true
|
||||
reth-basic-payload-builder.workspace = true
|
||||
reth-ethereum-payload-builder.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-node-ethereum = { workspace = true, features = ["test-utils"] }
|
||||
reth-tracing.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ reth-evm-ethereum.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
reth-node-core.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-node-ethereum = { workspace = true, features = ["test-utils"] }
|
||||
reth-tracing.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ reth-eth-wire.workspace = true
|
||||
reth-network.workspace = true
|
||||
reth-network-api.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-provider.workspace = true
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
reth-primitives.workspace = true
|
||||
reth-rpc-types.workspace = true
|
||||
reth.workspace = true
|
||||
|
||||
@ -13,5 +13,6 @@ reth-chainspec.workspace = true
|
||||
reth-db.workspace = true
|
||||
reth-db-api.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-provider = { workspace = true, features = ["test-utils"] }
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
eyre.workspace = true
|
||||
|
||||
@ -31,11 +31,9 @@ use reth::rpc::builder::{
|
||||
};
|
||||
// Configuring the network parts, ideally also wouldn't need to think about this.
|
||||
use myrpc_ext::{MyRpcExt, MyRpcExtApiServer};
|
||||
use reth::{
|
||||
blockchain_tree::noop::NoopBlockchainTree, providers::test_utils::TestCanonStateSubscriptions,
|
||||
tasks::TokioTaskExecutor,
|
||||
};
|
||||
use reth::{blockchain_tree::noop::NoopBlockchainTree, tasks::TokioTaskExecutor};
|
||||
use reth_node_ethereum::EthEvmConfig;
|
||||
use reth_provider::test_utils::TestCanonStateSubscriptions;
|
||||
|
||||
// Custom rpc extension
|
||||
pub mod myrpc_ext;
|
||||
|
||||
@ -11,7 +11,7 @@ reth-chainspec.workspace = true
|
||||
reth-node-api.workspace = true
|
||||
reth-node-core.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-node-ethereum.workspace = true
|
||||
reth-node-ethereum = { workspace = true, features = ["test-utils"] }
|
||||
reth-tracing.workspace = true
|
||||
alloy-genesis.workspace = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user