Skip to content
Closed
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
32 changes: 29 additions & 3 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ reth-config = { path = "crates/config" }
reth-consensus = { path = "crates/consensus/consensus" }
reth-consensus-common = { path = "crates/consensus/common" }
reth-db = { path = "crates/storage/db" }
reth-db-common = { path = "crates/reth-db-common" }
reth-discv4 = { path = "crates/net/discv4" }
reth-discv5 = { path = "crates/net/discv5" }
reth-dns-discovery = { path = "crates/net/dns" }
Expand Down
1 change: 1 addition & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ reth-transaction-pool.workspace = true
reth-beacon-consensus.workspace = true
reth-cli-runner.workspace = true
reth-consensus-common.workspace = true
reth-db-common.workspace = true
reth-blockchain-tree.workspace = true
reth-rpc-builder.workspace = true
reth-rpc.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/debug_cmd/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use reth_cli_runner::CliContext;
use reth_config::{config::EtlConfig, Config};
use reth_consensus::Consensus;
use reth_db::{database::Database, init_db, DatabaseEnv};
use reth_db_common::init::init_genesis;
use reth_downloaders::{
bodies::bodies::BodiesDownloaderBuilder,
headers::reverse_headers::ReverseHeadersDownloaderBuilder,
Expand All @@ -25,7 +26,6 @@ use reth_exex::ExExManagerHandle;
use reth_interfaces::p2p::{bodies::client::BodiesClient, headers::client::HeadersClient};
use reth_network::{NetworkEvents, NetworkHandle};
use reth_network_api::NetworkInfo;
use reth_node_core::init::init_genesis;
use reth_primitives::{
fs, stage::StageId, BlockHashOrNumber, BlockNumber, ChainSpec, PruneModes, B256,
};
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use reth_beacon_consensus::EthBeaconConsensus;
use reth_config::{config::EtlConfig, Config};
use reth_consensus::Consensus;
use reth_db::{database::Database, init_db, tables, transaction::DbTx};
use reth_db_common::init::init_genesis;
use reth_downloaders::{
bodies::bodies::BodiesDownloaderBuilder,
file_client::{ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
Expand All @@ -26,7 +27,6 @@ use reth_interfaces::p2p::{
bodies::downloader::BodyDownloader,
headers::downloader::{HeaderDownloader, SyncTarget},
};
use reth_node_core::init::init_genesis;
use reth_node_events::node::NodeEvent;
use reth_primitives::{stage::StageId, ChainSpec, PruneModes, B256};
use reth_provider::{
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/import_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use reth_downloaders::file_client::{
ChunkedFileReader, FileClient, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE,
};

use reth_node_core::init::init_genesis;
use reth_db_common::init::init_genesis;

use reth_primitives::{hex, stage::StageId, PruneModes, TxHash};
use reth_provider::{ProviderFactory, StageCheckpointReader, StaticFileProviderFactory};
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/init_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
};
use clap::Parser;
use reth_db::init_db;
use reth_node_core::init::init_genesis;
use reth_db_common::init::init_genesis;
use reth_primitives::ChainSpec;
use reth_provider::ProviderFactory;
use std::sync::Arc;
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/init_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
use clap::Parser;
use reth_config::config::EtlConfig;
use reth_db::{database::Database, init_db};
use reth_node_core::init::init_from_state_dump;
use reth_db_common::init::init_from_state_dump;
use reth_primitives::{ChainSpec, B256};
use reth_provider::ProviderFactory;

Expand Down
3 changes: 2 additions & 1 deletion bin/reth/src/commands/recover/storage_tries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use reth_db::{
init_db, tables,
transaction::DbTx,
};
use reth_node_core::{args::DatabaseArgs, init::init_genesis};
use reth_db_common::init::init_genesis;
use reth_node_core::args::DatabaseArgs;
use reth_primitives::ChainSpec;
use reth_provider::{BlockNumReader, HeaderProvider, ProviderError, ProviderFactory};
use reth_trie::StateRoot;
Expand Down
2 changes: 1 addition & 1 deletion bin/reth/src/commands/stage/drop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
use clap::Parser;
use itertools::Itertools;
use reth_db::{open_db, static_file::iter_static_files, tables, transaction::DbTxMut, DatabaseEnv};
use reth_node_core::init::{insert_genesis_header, insert_genesis_history, insert_genesis_state};
use reth_db_common::init::{insert_genesis_header, insert_genesis_history, insert_genesis_state};
use reth_primitives::{
fs, stage::StageId, static_file::find_fixed_range, ChainSpec, StaticFileSegment,
};
Expand Down
3 changes: 0 additions & 3 deletions crates/node-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ reth-network-api.workspace = true
reth-evm.workspace = true
reth-engine-primitives.workspace = true
reth-tasks.workspace = true
reth-trie.workspace = true
reth-consensus-common.workspace = true
reth-beacon-consensus.workspace = true
reth-etl.workspace = true
reth-codecs.workspace = true

# ethereum
discv5.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/node-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub mod cli;
pub mod dirs;
pub mod engine;
pub mod exit;
pub mod init;
pub mod metrics;
pub mod node_config;
pub mod utils;
Expand Down
1 change: 1 addition & 0 deletions crates/node/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ reth-exex.workspace = true
reth-evm.workspace = true
reth-provider.workspace = true
reth-db.workspace = true
reth-db-common.workspace = true
reth-rpc-engine-api.workspace = true
reth-rpc.workspace = true
reth-node-api.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/node/builder/src/launch/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ use tokio::sync::mpsc::Receiver;
use reth_auto_seal_consensus::MiningMode;
use reth_config::{config::EtlConfig, PruneConfig};
use reth_db::{database::Database, database_metrics::DatabaseMetrics};
use reth_db_common::init::{init_genesis, InitDatabaseError};
use reth_interfaces::p2p::headers::client::HeadersClient;
use reth_node_core::{
cli::config::RethRpcConfig,
dirs::{ChainPath, DataDirPath},
init::{init_genesis, InitDatabaseError},
node_config::NodeConfig,
};
use reth_primitives::{BlockNumber, Chain, ChainSpec, Head, PruneModes, B256};
Expand Down
69 changes: 69 additions & 0 deletions crates/reth-db-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[package]
name = "reth-db-common"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "common db modules"

[lints]
workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
reth-db = { workspace = true, features = ["mdbx"] }
reth-interfaces = { workspace = true, features = ["clap"] }
reth-provider.workspace = true
reth-config.workspace = true
reth-codecs.workspace = true
reth-etl.workspace = true
reth-trie.workspace = true

# metrics
# metrics-exporter-prometheus = "0.12.1"
# metrics-util = "0.15.0"
# metrics-process = "=1.0.14"
# metrics.workspace = true
#reth-metrics.workspace = true

# misc
eyre.workspace = true

thiserror.workspace = true
const-str = "0.5.6"

# io
serde.workspace = true
serde_json.workspace = true



# tracing
tracing.workspace = true

[target.'cfg(unix)'.dependencies]
tikv-jemalloc-ctl = { version = "0.5.0", optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.16.0"

[dev-dependencies]
# test vectors generation
proptest.workspace = true
tempfile.workspace = true
jsonrpsee.workspace = true
assert_matches.workspace = true

[features]
optimism = [
"reth-primitives/optimism",
"reth-provider/optimism",
]

jemalloc = ["dep:tikv-jemalloc-ctl"]

[build-dependencies]
vergen = { version = "8.0.0", features = ["build", "cargo", "git", "gitcl"] }
File renamed without changes.
10 changes: 10 additions & 0 deletions crates/reth-db-common/src/lib.rs
Comment thread
willco-1 marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//!
//! Common modules for reth-db crate
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
pub mod init;
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl BundleStateWithReceipts {

/// Returns the receipt root for all recorded receipts.
/// Note: this function calculated Bloom filters for every receipt and created merkle trees
/// of receipt. This is a expensive operation.
/// of receipt. This is an expensive operation.
#[cfg(feature = "optimism")]
pub fn optimism_receipts_root_slow(
&self,
Expand Down