docs: document crate features (#3269)

This commit is contained in:
Bjerg
2023-06-21 21:35:38 +02:00
committed by GitHub
parent 7042230102
commit 77167134d0
25 changed files with 110 additions and 14 deletions

View File

@ -6,6 +6,14 @@
))]
//! Rust Ethereum (reth) binary executable.
//!
//! ## Feature Flags
//!
//! - `jemalloc`: Uses [jemallocator](https://github.com/tikv/jemallocator) as the global allocator.
//! This is **not recommended on Windows**. See [here](https://rust-lang.github.io/rfcs/1974-global-allocators.html#jemalloc)
//! for more info.
//! - `only-info-logs`: Disables all logs below `info` level. This can speed up the node, since
//! fewer calls to the logging component is made.
pub mod args;
pub mod chain;

View File

@ -4,7 +4,17 @@
no_crate_inject,
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Implementation of the [BlockchainTree]
//! Implementation of a tree-like structure for blockchains.
//!
//! The [BlockchainTree] can validate, execute, and revert blocks in multiple competing sidechains.
//! This structure is used for Reth's sync mode at the tip instead of the pipeline, and is the
//! primary executor and validator of payloads sent from the consensus layer.
//!
//! Blocks and their resulting state transitions are kept in-memory until they are persisted.
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
/// Execution result types.
pub use reth_provider::post_state;

View File

@ -52,5 +52,4 @@ secp256k1 = { workspace = true, features = [
] }
[features]
bench = []
test-utils = ["tokio-stream/sync", "secp256k1"]

View File

@ -5,7 +5,11 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Reth interface bindings
//! A collection of shared traits and error types used in Reth.
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
/// Consensus traits.
pub mod consensus;

View File

@ -6,6 +6,11 @@
))]
//! Collection of metrics utilities.
//!
//! ## Feature Flags
//!
//! - `common`: Common metrics utilities, such as wrappers around tokio senders and receivers. Pulls
//! in `tokio`.
/// Metrics derive macro.
pub use reth_metrics_derive::Metrics;

View File

@ -17,6 +17,11 @@
//! state and drives the UDP socket. The (optional) [`Discv4`] serves as the frontend to interact
//! with the service via a channel. Whenever the underlying table changes service produces a
//! [`DiscoveryUpdate`] that listeners will receive.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
//! - `test-utils`: Export utilities for testing
use crate::{
error::{DecodePacketError, Discv4Error},
proto::{FindNode, Message, Neighbours, Packet, Ping, Pong},

View File

@ -6,7 +6,11 @@
))]
//! Implementation of [EIP-1459](https://eips.ethereum.org/EIPS/eip-1459) Node Discovery via DNS.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
//! - `test-utils`: Export utilities for testing
pub use crate::resolver::{DnsResolver, MapResolver, Resolver};
use crate::{
query::{QueryOutcome, QueryPool, ResolveEntryResult, ResolveRootResult},

View File

@ -7,6 +7,10 @@
#![allow(clippy::result_large_err)]
//! Implements the downloader algorithms.
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
/// The collection of algorithms for downloading block bodies.
pub mod bodies;

View File

@ -5,6 +5,11 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Implementation of the `eth` wire protocol.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
//! - `arbitrary`: Adds `proptest` and `arbitrary` support for wire types.
pub mod builder;
pub mod capability;

View File

@ -6,6 +6,10 @@
))]
//! Helpers for resolving the external IP.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
use igd::aio::search_gateway;
use pin_project_lite::pin_project;

View File

@ -8,7 +8,10 @@
//! Reth network interface definitions.
//!
//! Provides abstractions for the reth-network crate.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
use async_trait::async_trait;
use reth_eth_wire::DisconnectReason;
use reth_primitives::{NodeRecord, PeerId};

View File

@ -107,9 +107,9 @@
//! }
//! ```
//!
//! # Features
//! # Feature Flags
//!
//! - `serde`: Enable serde support for configuration types (enabled by default).
//! - `serde` (default): Enable serde support for configuration types.
//! - `test-utils`: Various utilities helpful for writing tests
//! - `geth-tests`: Runs tests that require Geth to be installed locally.

View File

@ -16,6 +16,10 @@
//! - [PayloadJobGenerator]: a type that knows how to create new jobs for creating payloads based
//! on [PayloadAttributes](reth_rpc_types::engine::PayloadAttributes).
//! - [PayloadJob]: a type that can yields (better) payloads over time.
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
pub mod database;
pub mod error;

View File

@ -8,7 +8,11 @@
//! Commonly used types in reth.
//!
//! This crate contains Ethereum primitive types and helper functions.
//!
//! ## Feature Flags
//!
//! - `arbitrary`: Adds `proptest` and `arbitrary` support for primitive types.
//! - `test-utils`: Export utilities for testing
pub mod abi;
mod account;
pub mod basefee;

View File

@ -5,7 +5,12 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! revm [Inspector](revm::Inspector) implementations
//! revm [Inspector](revm::Inspector) implementations, such as call tracers
//!
//! ## Feature Flags
//!
//! - `js-tracer` (default): Enables a JavaScript tracer implementation. This pulls in extra
//! dependencies (such as `boa`, `tokio` and `serde_json`).
/// An inspector implementation for an EIP2930 Accesslist
pub mod access_list;

View File

@ -6,6 +6,15 @@
))]
#![cfg_attr(not(feature = "std"), no_std)]
//! A fast RLP implementation.
//!
//! ## Feature Flags
//!
//! This crate works on `#[no_std]` targets if `std` is not enabled.
//!
//! - `derive`: Enables derive macros.
//! - `std`: Uses the Rust standard library.
#[cfg(feature = "alloc")]
extern crate alloc;

View File

@ -5,7 +5,11 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
//! Reth IPC implementation
//! Reth IPC transport implementation
//!
//! ## Feature Flags
//!
//! - `client`: Enables JSON-RPC client support.
#[cfg(unix)]
pub mod client;

View File

@ -8,6 +8,10 @@
//! Reth RPC interface definitions
//!
//! Provides all RPC interfaces.
//!
//! ## Feature Flags
//!
//! - `client`: Enables JSON-RPC client support.
mod admin;
mod debug;

View File

@ -7,7 +7,7 @@
//! Puts together all the Reth stages in a unified abstraction.
//!
//! # Features
//! ## Feature Flags
//!
//! - `test-utils`: Various utilities helpful for writing tests
//! - `geth-tests`: Runs tests that require Geth to be installed locally.

View File

@ -53,6 +53,10 @@
//! )
//! .build(db, MAINNET.clone());
//! ```
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
mod error;
mod pipeline;
mod stage;

View File

@ -47,7 +47,7 @@ proptest-derive = { version = "0.3", optional = true }
# reth libs with arbitrary
reth-primitives = { workspace = true, features = ["arbitrary"] }
reth-codecs = { path = "../codecs", features = ["arbitrary"] }
reth-interfaces = { workspace = true, features = ["bench"] }
reth-interfaces = { workspace = true }
tempfile = "3.3.0"
test-fuzz = "4"

View File

@ -42,5 +42,4 @@ reth-trie = { path = "../../trie", features = ["test-utils"] }
parking_lot = "0.12"
[features]
bench = []
test-utils = ["reth-rlp"]

View File

@ -7,6 +7,10 @@
//! This crate contains a collection of traits and trait implementations for common database
//! operations.
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
/// Various provider traits.
mod traits;

View File

@ -79,7 +79,11 @@
//! The transaction pool will be used by separate consumers (RPC, P2P), to make sharing easier, the
//! [`Pool`](crate::Pool) type is just an `Arc` wrapper around `PoolInner`. This is the usable type
//! that provides the `TransactionPool` interface.
//!
//! ## Feature Flags
//!
//! - `serde` (default): Enable serde support
//! - `test-utils`: Export utilities for testing
use crate::pool::PoolInner;
use aquamarine as _;
use reth_primitives::{Address, TxHash, U256};

View File

@ -8,6 +8,10 @@
//! The implementation of Merkle Patricia Trie, a cryptographically
//! authenticated radix trie that is used to store key-value bindings.
//! <https://ethereum.org/en/developers/docs/data-structures-and-encoding/patricia-merkle-trie/>
//!
//! ## Feature Flags
//!
//! - `test-utils`: Export utilities for testing
/// The Ethereum account as represented in the trie.
pub mod account;