diff --git a/Cargo.lock b/Cargo.lock index 546fadf36..1fea112c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5726,8 +5726,8 @@ dependencies = [ "cfg-if", "futures", "metrics 0.21.1", + "reth-beacon-consensus-core", "reth-blockchain-tree", - "reth-consensus-common", "reth-db", "reth-downloaders", "reth-interfaces", @@ -5752,6 +5752,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "reth-beacon-consensus-core" +version = "0.1.0-alpha.13" +dependencies = [ + "reth-consensus-common", + "reth-interfaces", + "reth-primitives", +] + [[package]] name = "reth-blockchain-tree" version = "0.1.0-alpha.13" diff --git a/Cargo.toml b/Cargo.toml index 05598c1b9..84fd76b96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "crates/config/", "crates/consensus/auto-seal/", "crates/consensus/beacon/", + "crates/consensus/beacon-core/", "crates/consensus/common/", "crates/ethereum-forks/", "crates/interfaces/", @@ -96,6 +97,7 @@ reth = { path = "bin/reth" } reth-auto-seal-consensus = { path = "crates/consensus/auto-seal" } reth-basic-payload-builder = { path = "crates/payload/basic" } reth-beacon-consensus = { path = "crates/consensus/beacon" } +reth-beacon-consensus-core = { path = "crates/consensus/beacon-core" } reth-blockchain-tree = { path = "crates/blockchain-tree" } reth-codecs = { path = "crates/storage/codecs" } reth-config = { path = "crates/config" } diff --git a/crates/consensus/beacon-core/Cargo.toml b/crates/consensus/beacon-core/Cargo.toml new file mode 100644 index 000000000..f411c2d78 --- /dev/null +++ b/crates/consensus/beacon-core/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "reth-beacon-consensus-core" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true + +[dependencies] +# reth +reth-consensus-common.workspace = true +reth-primitives.workspace = true +reth-interfaces.workspace = true \ No newline at end of file diff --git a/crates/consensus/beacon/src/beacon_consensus.rs b/crates/consensus/beacon-core/src/lib.rs similarity index 89% rename from crates/consensus/beacon/src/beacon_consensus.rs rename to crates/consensus/beacon-core/src/lib.rs index d0e8dcf00..d12bb4cff 100644 --- a/crates/consensus/beacon/src/beacon_consensus.rs +++ b/crates/consensus/beacon-core/src/lib.rs @@ -1,3 +1,20 @@ +//! Beacon consensus implementation. + +#![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/" +)] +#![warn( + missing_debug_implementations, + missing_docs, + unused_crate_dependencies, + unreachable_pub, + rustdoc::all +)] +#![deny(unused_must_use, rust_2018_idioms)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] + //! Consensus for ethereum network use reth_consensus_common::validation; diff --git a/crates/consensus/beacon/Cargo.toml b/crates/consensus/beacon/Cargo.toml index 6986fd63a..d892b6c26 100644 --- a/crates/consensus/beacon/Cargo.toml +++ b/crates/consensus/beacon/Cargo.toml @@ -9,7 +9,7 @@ repository.workspace = true [dependencies] # reth -reth-consensus-common.workspace = true +reth-beacon-consensus-core.workspace = true reth-primitives.workspace = true reth-interfaces.workspace = true reth-stages.workspace = true @@ -21,7 +21,6 @@ reth-payload-builder.workspace = true reth-payload-validator.workspace = true reth-prune.workspace = true reth-snapshot.workspace = true -reth-rpc-types-compat.workspace = true reth-tokio-util.workspace = true # async @@ -47,6 +46,7 @@ reth-stages = { workspace = true, features = ["test-utils"] } reth-blockchain-tree = { workspace = true, features = ["test-utils"] } reth-db = { workspace = true, features = ["test-utils"] } reth-provider = { workspace = true, features = ["test-utils"] } +reth-rpc-types-compat.workspace = true reth-tracing.workspace = true reth-revm.workspace = true reth-downloaders.workspace = true @@ -55,12 +55,10 @@ assert_matches.workspace = true [features] optimism = [ - "reth-consensus-common/optimism", "reth-primitives/optimism", "reth-interfaces/optimism", "reth-provider/optimism", "reth-rpc-types/optimism", - "reth-rpc-types-compat/optimism", "reth-payload-builder/optimism", "reth-blockchain-tree/optimism", ] diff --git a/crates/consensus/beacon/src/lib.rs b/crates/consensus/beacon/src/lib.rs index d3904044f..00ee920dc 100644 --- a/crates/consensus/beacon/src/lib.rs +++ b/crates/consensus/beacon/src/lib.rs @@ -5,12 +5,17 @@ html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256", issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/" )] -#![warn(missing_debug_implementations, missing_docs, unreachable_pub, rustdoc::all)] +#![warn( + missing_debug_implementations, + missing_docs, + unused_crate_dependencies, + unreachable_pub, + rustdoc::all +)] #![deny(unused_must_use, rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] -mod beacon_consensus; -pub use beacon_consensus::BeaconConsensus; +pub use reth_beacon_consensus_core::BeaconConsensus; mod engine; pub use engine::*;