diff --git a/docs/cli/help.rs b/docs/cli/help.rs index cb9b577ba2..05e61eef74 100755 --- a/docs/cli/help.rs +++ b/docs/cli/help.rs @@ -38,7 +38,7 @@ macro_rules! regex { }}; } -/// Generate markdown files from help output of commands +/// Generate markdown files from the help output of commands #[derive(Parser, Debug)] #[command(about, long_about = None)] struct Args { diff --git a/docs/crates/db.md b/docs/crates/db.md index 4790d8daf4..cee68fa189 100644 --- a/docs/crates/db.md +++ b/docs/crates/db.md @@ -30,7 +30,7 @@ pub trait Value: Compress + Decompress + Serialize {} ``` -The `Table` trait has two generic values, `Key` and `Value`, which need to implement the `Key` and `Value` traits, respectively. The `Encode` trait is responsible for transforming data into bytes so it can be stored in the database, while the `Decode` trait transforms the bytes back into its original form. Similarly, the `Compress` and `Decompress` traits transform the data to and from a compressed format when storing or reading data from the database. +The `Table` trait has two generic values, `Key` and `Value`, which need to implement the `Key` and `Value` traits, respectively. The `Encode` trait is responsible for transforming data into bytes so it can be stored in the database, while the `Decode` trait transforms the bytes back into their original form. Similarly, the `Compress` and `Decompress` traits transform the data to and from a compressed format when storing or reading data from the database. There are many tables within the node, all used to store different types of data from `Headers` to `Transactions` and more. Below is a list of all of the tables. You can follow [this link](https://github.com/paradigmxyz/reth/blob/bf9cac7571f018fec581fe3647862dab527aeafb/crates/storage/db/src/tables/mod.rs#L274-L414) if you would like to see the table definitions for any of the tables below. @@ -196,7 +196,7 @@ pub trait DbTxMut: Send + Sync { + Send + Sync; - /// Put value to database + /// Put value in database fn put(&self, key: T::Key, value: T::Value) -> Result<(), DatabaseError>; /// Delete value from database fn delete(&self, key: T::Key, value: Option) @@ -267,7 +267,7 @@ let mut headers_cursor = provider.tx_ref().cursor_read::()?; let headers_walker = headers_cursor.walk_range(block_range.clone())?; ``` -Let's look at an examples of how cursors are used. The code snippet below contains the `unwind` method from the `BodyStage` defined in the `stages` crate. This function is responsible for unwinding any changes to the database if there is an error when executing the body stage within the Reth pipeline. +Let's look at an example of how cursors are used. The code snippet below contains the `unwind` method from the `BodyStage` defined in the `stages` crate. This function is responsible for unwinding any changes to the database if there is an error when executing the body stage within the Reth pipeline. [File: crates/stages/stages/src/stages/bodies.rs](https://github.com/paradigmxyz/reth/blob/bf9cac7571f018fec581fe3647862dab527aeafb/crates/stages/stages/src/stages/bodies.rs#L267-L345) @@ -306,7 +306,7 @@ fn unwind(&mut self, provider: &DatabaseProviderRW, input: UnwindInput) { requests_cursor.delete_current()?; } - // Delete all transaction to block values. + // Delete all transactions to block values. if !block_meta.is_empty() && tx_block_cursor.seek_exact(block_meta.last_tx_num())?.is_some() { diff --git a/etc/README.md b/etc/README.md index 6b6cff73e3..0c431e8f46 100644 --- a/etc/README.md +++ b/etc/README.md @@ -45,7 +45,7 @@ To set up a new metric in Reth and its Grafana dashboard (this assumes running R 1. Save and arrange: - Click `Apply` to save the panel - - Drag the panel to desired position on the dashboard + - Drag the panel to the desired position on the dashboard 1. Export the dashboard: @@ -61,7 +61,7 @@ Your new metric is now integrated into the Reth Grafana dashboard. #### Import Grafana dashboards -If you are running Reth and Grafana outside of docker, and wish to import new Grafana dashboards or update a dashboard: +If you are running Reth and Grafana outside of Docker, and wish to import new Grafana dashboards or update a dashboard: 1. Go to `Home` > `Dashboards` @@ -74,5 +74,5 @@ If you are running Reth and Grafana outside of docker, and wish to import new Gr 1. Delete the old dashboard -If you are running Reth and Grafana using docker, after having pulled the updated dashboards from `main`, restart the +If you are running Reth and Grafana using Docker, after having pulled the updated dashboards from `main`, restart the Grafana service. This will update all dashboards. diff --git a/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/handler.rs b/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/handler.rs index e18a63673a..8a6dead2cb 100644 --- a/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/handler.rs +++ b/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/handler.rs @@ -4,7 +4,7 @@ use reth_ethereum::network::{api::PeerId, protocol::ProtocolHandler}; use std::net::SocketAddr; use tokio::sync::mpsc; -/// Protocol state is an helper struct to store the protocol events. +/// Protocol state is a helper struct to store the protocol events. #[derive(Clone, Debug)] pub(crate) struct ProtocolState { pub(crate) events: mpsc::UnboundedSender, diff --git a/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/proto.rs b/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/proto.rs index 495c435782..19508c1703 100644 --- a/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/proto.rs +++ b/examples/custom-rlpx-subprotocol/src/subprotocol/protocol/proto.rs @@ -1,4 +1,4 @@ -//! Simple RLPx Ping Pong protocol that also support sending messages, +//! Simple RLPx Ping Pong protocol that also supports sending messages, //! following [RLPx specs](https://github.com/ethereum/devp2p/blob/master/rlpx.md) use alloy_primitives::bytes::{Buf, BufMut, BytesMut}; diff --git a/examples/db-access/src/main.rs b/examples/db-access/src/main.rs index b7e92f66a7..4027beb70c 100644 --- a/examples/db-access/src/main.rs +++ b/examples/db-access/src/main.rs @@ -123,7 +123,7 @@ fn block_provider_example>( let block = provider.block(number.into())?.ok_or(eyre::eyre!("block num not found"))?; assert_eq!(block.number, number); - // Can query a block with its senders, this is useful when you'd want to execute a block and do + // Can query a block with its senders, this is useful when you want to execute a block and do // not want to manually recover the senders for each transaction (as each transaction is // stored on disk with its v,r,s but not its `from` field.). let _recovered_block = provider @@ -145,7 +145,7 @@ fn block_provider_example>( .ok_or(eyre::eyre!("block by hash not found"))?; assert_eq!(block, block_by_hash2); - // Or you can also specify the datasource. For this provider this always return `None`, but + // Or you can also specify the datasource. For this provider this always returns `None`, but // the blockchain tree is also able to access pending state not available in the db yet. let block_by_hash3 = provider .find_block_by_hash(sealed_block.hash(), BlockSource::Any)? diff --git a/examples/exex-hello-world/src/main.rs b/examples/exex-hello-world/src/main.rs index 4253d8185e..2c89fb7262 100644 --- a/examples/exex-hello-world/src/main.rs +++ b/examples/exex-hello-world/src/main.rs @@ -58,7 +58,7 @@ async fn my_exex(mut ctx: ExExContext) -> eyre:: /// This function supports both Opstack Eth API and ethereum Eth API. /// /// The received handle gives access to the `EthApi` has full access to all eth api functionality -/// [`FullEthApi`]. And also gives access to additional eth related rpc method handlers, such as eth +/// [`FullEthApi`]. And also gives access to additional eth-related rpc method handlers, such as eth /// filter. async fn ethapi_exex( mut ctx: ExExContext, diff --git a/examples/exex-subscription/src/main.rs b/examples/exex-subscription/src/main.rs index 90f10e4e71..eb7ffaaf75 100644 --- a/examples/exex-subscription/src/main.rs +++ b/examples/exex-subscription/src/main.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -//! An ExEx example that installs a new RPC subscription endpoint that emit storage changes for a +//! An ExEx example that installs a new RPC subscription endpoint that emits storage changes for a //! requested address. #[allow(dead_code)] use alloy_primitives::{Address, U256}; diff --git a/examples/manual-p2p/src/main.rs b/examples/manual-p2p/src/main.rs index edd5ade245..41fb846c94 100644 --- a/examples/manual-p2p/src/main.rs +++ b/examples/manual-p2p/src/main.rs @@ -124,7 +124,7 @@ async fn handshake_eth( } // Snoop by greedily capturing all broadcasts that the peer emits -// note: this node cannot handle request so will be disconnected by peer when challenged +// note: this node cannot handle request so it will be disconnected by peer when challenged async fn snoop(peer: NodeRecord, mut eth_stream: AuthedEthStream) { while let Some(Ok(update)) = eth_stream.next().await { match update { diff --git a/examples/node-event-hooks/src/main.rs b/examples/node-event-hooks/src/main.rs index 60bc8c1325..fc72b936f5 100644 --- a/examples/node-event-hooks/src/main.rs +++ b/examples/node-event-hooks/src/main.rs @@ -1,4 +1,4 @@ -//! Example for how hook into the node via the CLI extension mechanism without registering +//! Example for how to hook into the node via the CLI extension mechanism without registering //! additional arguments //! //! Run with diff --git a/examples/op-db-access/src/main.rs b/examples/op-db-access/src/main.rs index 7a44a62174..6afe8d25b3 100644 --- a/examples/op-db-access/src/main.rs +++ b/examples/op-db-access/src/main.rs @@ -1,8 +1,8 @@ -//! Shows how manually access the database +//! Shows how to manually access the database use reth_op::{chainspec::BASE_MAINNET, node::OpNode, provider::providers::ReadOnlyConfig}; -// Providers are zero cost abstractions on top of an opened MDBX Transaction +// Providers are zero-cost abstractions on top of an opened MDBX Transaction // exposing a familiar API to query the chain's information without requiring knowledge // of the inner tables. // diff --git a/examples/polygon-p2p/src/main.rs b/examples/polygon-p2p/src/main.rs index 8882a9f6c8..d4301ec012 100644 --- a/examples/polygon-p2p/src/main.rs +++ b/examples/polygon-p2p/src/main.rs @@ -1,4 +1,4 @@ -//! Example for how hook into the polygon p2p network +//! Example for how to hook into the polygon p2p network //! //! Run with //! @@ -67,13 +67,13 @@ async fn main() { let net_handle = net_manager.handle(); let mut events = net_handle.event_listener(); - // NetworkManager is a long running task, let's spawn it + // NetworkManager is a long-running task, let's spawn it tokio::spawn(net_manager); info!("Looking for Polygon peers..."); while let Some(evt) = events.next().await { // For the sake of the example we only print the session established event - // with the chain specific details + // with the chain-specific details if let NetworkEvent::ActivePeerSession { info, .. } = evt { let SessionInfo { status, client_version, .. } = info; let chain = status.chain; @@ -81,5 +81,5 @@ async fn main() { } // More events here } - // We will be disconnected from peers since we are not able to answer to network requests + // We will be disconnected from peers since we are not able to respond to network requests } diff --git a/examples/rpc-db/src/main.rs b/examples/rpc-db/src/main.rs index b0e4b59a1a..97bd1debdc 100644 --- a/examples/rpc-db/src/main.rs +++ b/examples/rpc-db/src/main.rs @@ -1,4 +1,4 @@ -//! Example illustrating how to run the ETH JSON RPC API as standalone over a DB file. +//! Example illustrating how to run the ETH JSON RPC API as a standalone over a DB file. //! //! Run with //! @@ -41,7 +41,7 @@ pub mod myrpc_ext; #[tokio::main] async fn main() -> eyre::Result<()> { - // 1. Setup the DB + // 1. Set up the DB let db_path = std::env::var("RETH_DB_PATH")?; let db_path = Path::new(&db_path); let db = Arc::new(open_db_read_only( @@ -55,7 +55,7 @@ async fn main() -> eyre::Result<()> { StaticFileProvider::read_only(db_path.join("static_files"), true)?, ); - // 2. Setup the blockchain provider using only the database provider and a noop for the tree to + // 2. Set up the blockchain provider using only the database provider and a noop for the tree to // satisfy trait bounds. Tree is not used in this example since we are only operating on the // disk and don't handle new blocks/live sync etc, which is done by the blockchain tree. let provider = BlockchainProvider::new(factory)?; diff --git a/examples/txpool-tracing/src/main.rs b/examples/txpool-tracing/src/main.rs index a1b61422cb..15d8a9ae08 100644 --- a/examples/txpool-tracing/src/main.rs +++ b/examples/txpool-tracing/src/main.rs @@ -68,7 +68,7 @@ fn main() { /// Our custom cli args extension that adds one flag to reth default CLI. #[derive(Debug, Clone, Default, clap::Args)] struct RethCliTxpoolExt { - /// recipients addresses that we want to trace + /// recipients' addresses that we want to trace #[arg(long, value_delimiter = ',')] pub recipients: Vec
, } diff --git a/examples/txpool-tracing/src/submit.rs b/examples/txpool-tracing/src/submit.rs index b59cefe2f2..f3e0de16ed 100644 --- a/examples/txpool-tracing/src/submit.rs +++ b/examples/txpool-tracing/src/submit.rs @@ -32,7 +32,7 @@ pub async fn submit_transaction( max_fee_per_gas: u128, ) -> eyre::Result where - // This enforces `EthPrimitives` types for this node, this unlocks the proper conversions when + // This enforces `EthPrimitives` types for this node, which unlocks the proper conversions when FC: FullNodeComponents>, { // Create the transaction request