Skip to content

Commit 7a59388

Browse files
jsvisamattsse
andauthored
chore(github): use codespell to inspect and correct spelling issues (paradigmxyz#7775)
Signed-off-by: jsvisa <[email protected]> Co-authored-by: Matthias Seitz <[email protected]>
1 parent 665e67e commit 7a59388

File tree

28 files changed

+55
-34
lines changed

28 files changed

+55
-34
lines changed

.codespellrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[codespell]
2+
skip = .git,target,./crates/storage/libmdbx-rs/mdbx-sys/libmdbx,Cargo.toml,Cargo.lock
3+
ignore-words-list = crate,ser,ratatui

.github/workflows/lint.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ jobs:
110110
components: rustfmt
111111
- run: cargo fmt --all --check
112112

113+
codespell:
114+
runs-on: ubuntu-latest
115+
timeout-minutes: 30
116+
steps:
117+
- uses: codespell-project/actions-codespell@v2
118+
113119
grafana:
114120
runs-on: ubuntu-latest
115121
timeout-minutes: 30
@@ -124,7 +130,7 @@ jobs:
124130
name: lint success
125131
runs-on: ubuntu-latest
126132
if: always()
127-
needs: [clippy-binaries, clippy, crate-checks, docs, fmt, grafana]
133+
needs: [clippy-binaries, clippy, crate-checks, docs, fmt, codespell, grafana]
128134
timeout-minutes: 30
129135
steps:
130136
- name: Decide whether the needed jobs succeeded or failed

Makefile

+11-1
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,21 @@ lint-other-targets:
303303
--all-features \
304304
-- -D warnings
305305

306+
lint-codespell: ensure-codespell
307+
codespell
308+
309+
ensure-codespell:
310+
@if ! command -v codespell &> /dev/null; then \
311+
echo "codespell not found. Please install it by running the command `pip install codespell` or refer to the following link for more information: https://github.com/codespell-project/codespell" \
312+
exit 1; \
313+
fi
314+
306315
lint:
307316
make fmt && \
308317
make lint-reth && \
309318
make lint-op-reth && \
310-
make lint-other-targets
319+
make lint-other-targets \
320+
make lint-codespell
311321

312322
fix-lint-reth:
313323
cargo +nightly clippy \

bin/reth/src/commands/stage/dump/hashing_account.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn unwind_and_copy<DB: Database>(
6969
Ok(())
7070
}
7171

72-
/// Try to re-execute the stage straightaway
72+
/// Try to re-execute the stage straight away
7373
async fn dry_run<DB: Database>(
7474
output_provider_factory: ProviderFactory<DB>,
7575
to: u64,

bin/reth/src/commands/stage/dump/hashing_storage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn unwind_and_copy<DB: Database>(
6565
Ok(())
6666
}
6767

68-
/// Try to re-execute the stage straightaway
68+
/// Try to re-execute the stage straight away
6969
async fn dry_run<DB: Database>(
7070
output_provider_factory: ProviderFactory<DB>,
7171
to: u64,

bin/reth/src/commands/stage/dump/merkle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ async fn unwind_and_copy<DB: Database>(
138138
Ok(())
139139
}
140140

141-
/// Try to re-execute the stage straightaway
141+
/// Try to re-execute the stage straight away
142142
async fn dry_run<DB: Database>(
143143
output_provider_factory: ProviderFactory<DB>,
144144
to: u64,

bin/reth/src/commands/test_vectors/tables.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ where
8181
{
8282
let mut rows = vec![];
8383
let mut seen_keys = HashSet::new();
84-
let strat = proptest::collection::vec(
84+
let strategy = proptest::collection::vec(
8585
any_with::<TableRow<T>>((
8686
<T::Key as Arbitrary>::Parameters::default(),
8787
<T::Value as Arbitrary>::Parameters::default(),
@@ -94,7 +94,7 @@ where
9494
while rows.len() < per_table {
9595
// Generate all `per_table` rows: (Key, Value)
9696
rows.extend(
97-
&mut strat
97+
&mut strategy
9898
.new_tree(runner)
9999
.map_err(|e| eyre::eyre!("{e}"))?
100100
.current()

crates/engine-primitives/src/error.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ use thiserror::Error;
88
/// both execution payloads and forkchoice update attributes with respect to a method version.
99
#[derive(Error, Debug)]
1010
pub enum EngineObjectValidationError {
11-
/// Thrown when the underlying validation error occured while validating an `ExecutionPayload`.
11+
/// Thrown when the underlying validation error occurred while validating an
12+
/// `ExecutionPayload`.
1213
#[error("Payload validation error: {0}")]
1314
Payload(VersionSpecificValidationError),
1415

15-
/// Thrown when the underlying validation error occured while validating a `PayloadAttributes`.
16+
/// Thrown when the underlying validation error occurred while validating a
17+
/// `PayloadAttributes`.
1618
#[error("Payload attributes validation error: {0}")]
1719
PayloadAttributes(VersionSpecificValidationError),
1820

crates/ethereum/engine-primitives/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Ethereum specifc
1+
//! Ethereum specific
22
33
#![doc(
44
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",

crates/net/ecies/src/error.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ pub enum ECIESErrorImpl {
8181
/// a message from the (partially filled) buffer.
8282
#[error("stream closed due to not being readable")]
8383
UnreadableStream,
84-
// Error when data is not recieved from peer for a prolonged period.
85-
#[error("never recieved data from remote peer")]
84+
// Error when data is not received from peer for a prolonged period.
85+
#[error("never received data from remote peer")]
8686
StreamTimeout,
8787
}
8888

crates/net/network/src/transactions/validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub const SIGNATURE_DECODED_SIZE_BYTES: usize = mem::size_of::<Signature>();
2121
pub trait ValidateTx68 {
2222
/// Validates a [`NewPooledTransactionHashes68`](reth_eth_wire::NewPooledTransactionHashes68)
2323
/// entry. Returns [`ValidationOutcome`] which signals to the caller whether to fetch the
24-
/// transaction or wether to drop it, and whether the sender of the announcement should be
24+
/// transaction or to drop it, and whether the sender of the announcement should be
2525
/// penalized.
2626
fn should_fetch(
2727
&self,

crates/node-builder/src/components/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl Default for ComponentsBuilder<(), (), (), ()> {
164164

165165
/// A type that configures all the customizable components of the node and knows how to build them.
166166
///
167-
/// Implementors of this trait are responsible for building all the components of the node: See
167+
/// Implementers of this trait are responsible for building all the components of the node: See
168168
/// [NodeComponents].
169169
///
170170
/// The [ComponentsBuilder] is a generic implementation of this trait that can be used to customize

crates/node-core/src/args/rpc_server_args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl RpcServerArgs {
363363

364364
impl RethRpcConfig for RpcServerArgs {
365365
fn is_ipc_enabled(&self) -> bool {
366-
// By default IPC is enabled therefor it is enabled if the `ipcdisable` is false.
366+
// By default IPC is enabled therefore it is enabled if the `ipcdisable` is false.
367367
!self.ipcdisable
368368
}
369369

crates/rpc/rpc-api/src/engine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub trait EngineApi<Engine: EngineTypes> {
131131
/// layer p2p specification, meaning the input should be treated as untrusted or potentially
132132
/// adversarial.
133133
///
134-
/// Implementors should take care when acting on the input to this method, specifically
134+
/// Implementers should take care when acting on the input to this method, specifically
135135
/// ensuring that the range is limited properly, and that the range boundaries are computed
136136
/// correctly and without panics.
137137
#[method(name = "getPayloadBodiesByRangeV1")]

crates/rpc/rpc-api/src/ganache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub trait GanacheApi {
3434
/// is the snapshot id to revert to. This deletes the given snapshot, as well as any snapshots
3535
/// taken after (e.g.: reverting to id 0x1 will delete snapshots with ids 0x1, 0x2, etc.).
3636
///
37-
/// Reutnrs `true` if a snapshot was reverted, otherwise `false`.
37+
/// Returns `true` if a snapshot was reverted, otherwise `false`.
3838
#[method(name = "revert")]
3939
async fn evm_revert(&self, snapshot_id: U256) -> RpcResult<bool>;
4040

crates/rpc/rpc-builder/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ impl RpcModuleSelection {
717717

718718
/// Creates a new [RpcModule] based on the configured reth modules.
719719
///
720-
/// Note: This will always create new instance of the module handlers and is therefor only
720+
/// Note: This will always create new instance of the module handlers and is therefore only
721721
/// recommended for launching standalone transports. If multiple transports need to be
722722
/// configured it's recommended to use the [RpcModuleBuilder].
723723
#[allow(clippy::too_many_arguments)]

crates/rpc/rpc-engine-api/src/engine_api.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ where
292292
/// layer p2p specification, meaning the input should be treated as untrusted or potentially
293293
/// adversarial.
294294
///
295-
/// Implementors should take care when acting on the input to this method, specifically
295+
/// Implementers should take care when acting on the input to this method, specifically
296296
/// ensuring that the range is limited properly, and that the range boundaries are computed
297297
/// correctly and without panics.
298298
pub async fn get_payload_bodies_by_range(
@@ -661,7 +661,7 @@ where
661661
/// layer p2p specification, meaning the input should be treated as untrusted or potentially
662662
/// adversarial.
663663
///
664-
/// Implementors should take care when acting on the input to this method, specifically
664+
/// Implementers should take care when acting on the input to this method, specifically
665665
/// ensuring that the range is limited properly, and that the range boundaries are computed
666666
/// correctly and without panics.
667667
///

crates/rpc/rpc/src/eth/signer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl DevSigner {
5353
/// Generates a random dev signer which satisfies [EthSigner] trait
5454
pub(crate) fn random() -> Box<dyn EthSigner> {
5555
let mut signers = Self::random_signers(1);
56-
signers.pop().expect("expect to generate at leas one signer")
56+
signers.pop().expect("expect to generate at least one signer")
5757
}
5858

5959
/// Generates provided number of random dev signers

crates/rpc/rpc/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//!
1313
//! To avoid this, all blocking or CPU intensive handlers must be spawned to a separate task. See
1414
//! the [EthApi] handler implementations for examples. The rpc-api traits make no use of the
15-
//! available jsonrpsee `blocking` attribute to give implementors more freedom because the
15+
//! available jsonrpsee `blocking` attribute to give implementers more freedom because the
1616
//! `blocking` attribute and async handlers are mutually exclusive. However, as mentioned above, a
1717
//! lot of handlers make use of async functions, caching for example, but are also using blocking
1818
//! disk-io, hence these calls are spawned as futures to a blocking task manually.

crates/static-file/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ In descending order of abstraction hierarchy:
106106

107107
[`StaticFileProducer`](../../crates/static-file/src/static_file_producer.rs#L25): A `reth` [hook](../../crates/consensus/beacon/src/engine/hooks/static_file.rs) service that when triggered, **copies** finalized data from the database to the latest static file. Upon completion, it updates the internal index at `StaticFileProvider` with the new highest block and transaction on each specific segment.
108108

109-
[`StaticFileProvider`](../../crates/storage/provider/src/providers/static_file/manager.rs#L44) A provider similar to `DatabaseProvider`, **managing all existing static_file files** and selecting the optimal one (by range and segment type) to fulfill a request. **A single instance is shared across all components and should be instantiated only once within `ProviderFactory`**. An immutable reference is given everytime `ProviderFactory` creates a new `DatabaseProvider`.
109+
[`StaticFileProvider`](../../crates/storage/provider/src/providers/static_file/manager.rs#L44) A provider similar to `DatabaseProvider`, **managing all existing static_file files** and selecting the optimal one (by range and segment type) to fulfill a request. **A single instance is shared across all components and should be instantiated only once within `ProviderFactory`**. An immutable reference is given every time `ProviderFactory` creates a new `DatabaseProvider`.
110110

111111
[`StaticFileJarProvider`](../../crates/storage/provider/src/providers/static_file/jar.rs#L42) A provider similar to `DatabaseProvider` that provides access to a **single static file segment data** one a specific block range.
112112

crates/storage/db/benches/hash_keys.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ where
136136
T::Key: std::hash::Hash + Arbitrary,
137137
T::Value: Arbitrary,
138138
{
139-
let strat = proptest::collection::vec(
139+
let strategy = proptest::collection::vec(
140140
any_with::<TableRow<T>>((
141141
<T::Key as Arbitrary>::Parameters::default(),
142142
<T::Value as Arbitrary>::Parameters::default(),
@@ -147,8 +147,8 @@ where
147147
.boxed();
148148

149149
let mut runner = TestRunner::new(ProptestConfig::default());
150-
let mut preload = strat.new_tree(&mut runner).unwrap().current();
151-
let mut input = strat.new_tree(&mut runner).unwrap().current();
150+
let mut preload = strategy.new_tree(&mut runner).unwrap().current();
151+
let mut input = strategy.new_tree(&mut runner).unwrap().current();
152152

153153
let mut unique_keys = HashSet::new();
154154
preload.retain(|(k, _)| unique_keys.insert(k.clone()));

crates/storage/db/src/abstraction/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod sealed {
2323
use crate::{database::Database, mock::DatabaseMock, DatabaseEnv};
2424
use std::sync::Arc;
2525

26-
/// Sealed trait to limit the implementors of the Database trait.
26+
/// Sealed trait to limit the implementers of the Database trait.
2727
pub trait Sealed: Sized {}
2828

2929
impl<DB: Database> Sealed for &DB {}

crates/storage/libmdbx-rs/src/environment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ impl<R> Default for Geometry<R> {
501501
///
502502
/// # Arguments
503503
///
504-
/// * `process_id` – A proceess id of the reader process.
504+
/// * `process_id` – A process id of the reader process.
505505
/// * `thread_id` – A thread id of the reader thread.
506506
/// * `read_txn_id` – An oldest read transaction number on which stalled.
507507
/// * `gap` – A lag from the last committed txn.

crates/storage/nippy-jar/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ mod tests {
10711071
let num_rows = 2;
10721072

10731073
// (missing_offsets, expected number of rows)
1074-
// If a row wasnt fully pruned, then it should clear it up as well
1074+
// If a row wasn't fully pruned, then it should clear it up as well
10751075
let missing_offsets_scenarios = [(1, 1), (2, 1), (3, 0)];
10761076

10771077
for (missing_offsets, expected_rows) in missing_offsets_scenarios {

crates/storage/provider/src/providers/state/historical.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'b, TX: DbTx> HistoricalStateProviderRef<'b, TX> {
127127
tracing::warn!(
128128
target: "provider::historical_sp",
129129
target = self.block_number,
130-
"Attempt to calculate state root for an old block might result in OOM, tread carefully"
130+
"Attempt to calculate state root for an old block might result in OOM, treat carefully"
131131
);
132132
}
133133

crates/storage/provider/src/traits/transactions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait TransactionsProvider: BlockNumReader + Send + Sync {
1515
/// Returns None if the transaction is not found.
1616
fn transaction_id(&self, tx_hash: TxHash) -> ProviderResult<Option<TxNumber>>;
1717

18-
/// Get transaction by id, computes hash everytime so more expensive.
18+
/// Get transaction by id, computes hash every time so more expensive.
1919
fn transaction_by_id(&self, id: TxNumber) -> ProviderResult<Option<TransactionSigned>>;
2020

2121
/// Get transaction by id without computing the hash.

crates/transaction-pool/src/pool/pending.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ impl<T: TransactionOrdering> PendingPool<T> {
399399
unique_senders = self.highest_nonces.len();
400400
non_local_senders -= unique_removed;
401401

402-
// we can re-use the temp array
402+
// we can reuse the temp array
403403
removed.clear();
404404

405405
// loop through the highest nonces set, removing transactions until we reach the limit

crates/transaction-pool/src/pool/txpool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1766,8 +1766,8 @@ pub(crate) struct PoolInternalTransaction<T: PoolTransaction> {
17661766
pub(crate) transaction: Arc<ValidPoolTransaction<T>>,
17671767
/// The `SubPool` that currently contains this transaction.
17681768
pub(crate) subpool: SubPool,
1769-
/// Keeps track of the current state of the transaction and therefor in which subpool it should
1770-
/// reside
1769+
/// Keeps track of the current state of the transaction and therefore in which subpool it
1770+
/// should reside
17711771
pub(crate) state: TxState,
17721772
/// The total cost all transactions before this transaction.
17731773
///

0 commit comments

Comments
 (0)