chore: fix some typos (#2025)

This commit is contained in:
Matthias Seitz
2023-03-29 14:49:50 +02:00
committed by GitHub
parent 7e481b77ae
commit 47b9738ede
31 changed files with 40 additions and 39 deletions

View File

@ -68,7 +68,7 @@ pub fn should_skip(path: &Path) -> bool {
return true return true
} }
// Skip test where basefee/accesslist/diffuculty is present but it shouldn't be supported in // Skip test where basefee/accesslist/difficulty is present but it shouldn't be supported in
// London/Berlin/TheMerge. https://github.com/ethereum/tests/blob/5b7e1ab3ffaf026d99d20b17bb30f533a2c80c8b/GeneralStateTests/stExample/eip1559.json#L130 // London/Berlin/TheMerge. https://github.com/ethereum/tests/blob/5b7e1ab3ffaf026d99d20b17bb30f533a2c80c8b/GeneralStateTests/stExample/eip1559.json#L130
// It is expected to not execute these tests. // It is expected to not execute these tests.
if path.file_name() == Some(OsStr::new("accessListExample.json")) || if path.file_name() == Some(OsStr::new("accessListExample.json")) ||

View File

@ -346,7 +346,7 @@ pub fn validate_header_regarding_parent(
/// Checks: /// Checks:
/// If we already know the block. /// If we already know the block.
/// If parent is known /// If parent is known
/// If withdarwals are valid /// If withdrawals are valid
/// ///
/// Returns parent block header /// Returns parent block header
pub fn validate_block_regarding_chain<PROV: HeaderProvider + WithdrawalsProvider>( pub fn validate_block_regarding_chain<PROV: HeaderProvider + WithdrawalsProvider>(

View File

@ -260,7 +260,7 @@ pub fn random_storage_entry(key_range: std::ops::Range<u64>) -> StorageEntry {
StorageEntry { key, value } StorageEntry { key, value }
} }
/// Generate random Externaly Owned Account (EOA account without contract). /// Generate random Externally Owned Account (EOA account without contract).
pub fn random_eoa_account() -> (Address, Account) { pub fn random_eoa_account() -> (Address, Account) {
let nonce: u64 = rand::random(); let nonce: u64 = rand::random();
let balance = U256::from(rand::random::<u32>()); let balance = U256::from(rand::random::<u32>());
@ -269,7 +269,7 @@ pub fn random_eoa_account() -> (Address, Account) {
(addr, Account { nonce, balance, bytecode_hash: None }) (addr, Account { nonce, balance, bytecode_hash: None })
} }
/// Generate random Externaly Owned Accounts /// Generate random Externally Owned Accounts
pub fn random_eoa_account_range(acc_range: std::ops::Range<u64>) -> Vec<(Address, Account)> { pub fn random_eoa_account_range(acc_range: std::ops::Range<u64>) -> Vec<(Address, Account)> {
let mut accounts = Vec::with_capacity(acc_range.end.saturating_sub(acc_range.start) as usize); let mut accounts = Vec::with_capacity(acc_range.end.saturating_sub(acc_range.start) as usize);
for _ in acc_range { for _ in acc_range {

View File

@ -652,7 +652,7 @@ mod tests {
let (secret_key, _) = SECP256K1.generate_keypair(&mut rng); let (secret_key, _) = SECP256K1.generate_keypair(&mut rng);
let (encoded, _) = msg.encode(&secret_key); let (encoded, _) = msg.encode(&secret_key);
// Assret that 16 nodes never fit into one packet // Assert that 16 nodes never fit into one packet
assert!(encoded.len() > MAX_PACKET_SIZE, "{} {msg:?}", encoded.len()); assert!(encoded.len() > MAX_PACKET_SIZE, "{} {msg:?}", encoded.len());
} }

View File

@ -18,7 +18,7 @@ use std::{
/// Body request implemented as a [Future]. /// Body request implemented as a [Future].
/// ///
/// The future will poll the underlying request until fullfilled. /// The future will poll the underlying request until fulfilled.
/// If the response arrived with insufficient number of bodies, the future /// If the response arrived with insufficient number of bodies, the future
/// will issue another request until all bodies are collected. /// will issue another request until all bodies are collected.
/// ///
@ -40,7 +40,7 @@ pub(crate) struct BodiesRequestFuture<B: BodiesClient> {
consensus: Arc<dyn Consensus>, consensus: Arc<dyn Consensus>,
metrics: DownloaderMetrics, metrics: DownloaderMetrics,
priority: Priority, priority: Priority,
// Headers to download. The collection is shrinked as responses are buffered. // Headers to download. The collection is shrunk as responses are buffered.
headers: VecDeque<SealedHeader>, headers: VecDeque<SealedHeader>,
buffer: Vec<BlockResponse>, buffer: Vec<BlockResponse>,
fut: Option<B::Output>, fut: Option<B::Output>,
@ -264,7 +264,7 @@ mod tests {
/// Check that the request future /// Check that the request future
#[tokio::test] #[tokio::test]
async fn request_submits_until_fullfilled() { async fn request_submits_until_fulfilled() {
// Generate some random blocks // Generate some random blocks
let (headers, mut bodies) = generate_bodies(0..20); let (headers, mut bodies) = generate_bodies(0..20);

View File

@ -161,7 +161,7 @@ mod tests {
let (incoming, _) = listener.accept().await.unwrap(); let (incoming, _) = listener.accept().await.unwrap();
let mut stream = ECIESStream::incoming(incoming, server_key).await.unwrap(); let mut stream = ECIESStream::incoming(incoming, server_key).await.unwrap();
// use the stream to get the next messagse // use the stream to get the next message
let message = stream.next().await.unwrap().unwrap(); let message = stream.next().await.unwrap().unwrap();
assert_eq!(message, Bytes::from("hello")); assert_eq!(message, Bytes::from("hello"));
}); });

View File

@ -145,7 +145,7 @@ impl From<EthBroadcastMessage> for ProtocolBroadcastMessage {
/// Represents a message in the eth wire protocol, versions 66, 67 and 68. /// Represents a message in the eth wire protocol, versions 66, 67 and 68.
/// ///
/// The ethereum wire protocol is a set of messages that are broadcasted to the network in two /// The ethereum wire protocol is a set of messages that are broadcast to the network in two
/// styles: /// styles:
/// * A request message sent by a peer (such as [`GetPooledTransactions`]), and an associated /// * A request message sent by a peer (such as [`GetPooledTransactions`]), and an associated
/// response message (such as [`PooledTransactions`]). /// response message (such as [`PooledTransactions`]).

View File

@ -69,7 +69,7 @@ pub enum ParseNatResolverError {
AddrParseError(#[from] AddrParseError), AddrParseError(#[from] AddrParseError),
/// Failed to parse due to unknown variant /// Failed to parse due to unknown variant
#[error("Unknown Nat Resolver variant: {0}")] #[error("Unknown Nat Resolver variant: {0}")]
UnknonwVariant(String), UnknownVariant(String),
} }
impl FromStr for NatResolver { impl FromStr for NatResolver {
@ -82,7 +82,7 @@ impl FromStr for NatResolver {
"none" => NatResolver::None, "none" => NatResolver::None,
"publicip" | "public-ip" => NatResolver::PublicIp, "publicip" | "public-ip" => NatResolver::PublicIp,
s => { s => {
let Some(ip) = s.strip_prefix("extip:") else { return Err(ParseNatResolverError::UnknonwVariant(format!( let Some(ip) = s.strip_prefix("extip:") else { return Err(ParseNatResolverError::UnknownVariant(format!(
"Unknown Nat Resolver: {s}" "Unknown Nat Resolver: {s}"
))) }; ))) };
NatResolver::ExternalIp(ip.parse::<IpAddr>()?) NatResolver::ExternalIp(ip.parse::<IpAddr>()?)

View File

@ -73,7 +73,7 @@ impl<C> EthRequestHandler<C>
where where
C: BlockProvider + HeaderProvider, C: BlockProvider + HeaderProvider,
{ {
/// Returns the list of requested heders /// Returns the list of requested headers
fn get_headers_response(&self, request: GetBlockHeaders) -> Vec<Header> { fn get_headers_response(&self, request: GetBlockHeaders) -> Vec<Header> {
let GetBlockHeaders { start_block, limit, skip, direction } = request; let GetBlockHeaders { start_block, limit, skip, direction } = request;

View File

@ -6,7 +6,7 @@ use std::{
}; };
use tokio::sync::oneshot::{error::RecvError, Receiver}; use tokio::sync::oneshot::{error::RecvError, Receiver};
/// Flattern a [Receiver] message in order to get rid of the [RecvError] result /// Flatten a [Receiver] message in order to get rid of the [RecvError] result
#[derive(Debug)] #[derive(Debug)]
#[pin_project] #[pin_project]
pub struct FlattenedResponse<T> { pub struct FlattenedResponse<T> {

View File

@ -50,7 +50,7 @@ pub struct TransactionsManagerMetrics {
#[derive(Metrics)] #[derive(Metrics)]
#[metrics(scope = "network")] #[metrics(scope = "network")]
pub struct DisconnectMetrics { pub struct DisconnectMetrics {
/// Number of peer disconnects due to DisconnectRequestd (0x00) /// Number of peer disconnects due to DisconnectRequested (0x00)
pub(crate) disconnect_requested: Counter, pub(crate) disconnect_requested: Counter,
/// Number of peer disconnects due to TcpSubsystemError (0x01) /// Number of peer disconnects due to TcpSubsystemError (0x01)

View File

@ -307,7 +307,7 @@ pub(crate) enum NetworkHandleMessage {
FetchClient(oneshot::Sender<FetchClient>), FetchClient(oneshot::Sender<FetchClient>),
/// Apply a status update. /// Apply a status update.
StatusUpdate { head: Head }, StatusUpdate { head: Head },
/// Get the currenet status /// Get the current status
GetStatus(oneshot::Sender<NetworkStatus>), GetStatus(oneshot::Sender<NetworkStatus>),
/// Get PeerInfo from all the peers /// Get PeerInfo from all the peers
GetPeerInfo(oneshot::Sender<Vec<PeerInfo>>), GetPeerInfo(oneshot::Sender<Vec<PeerInfo>>),

View File

@ -345,7 +345,7 @@ impl PeersManager {
self.queued_actions.push_back(PeerAction::PeerRemoved(peer_id)); self.queued_actions.push_back(PeerAction::PeerRemoved(peer_id));
} else { } else {
// reset the peer's state // reset the peer's state
// we reset the backoff counter since we're able to establish a succesful // we reset the backoff counter since we're able to establish a successful
// session to that peer // session to that peer
entry.get_mut().backoff_counter = 0; entry.get_mut().backoff_counter = 0;
entry.get_mut().state = PeerConnectionState::Idle; entry.get_mut().state = PeerConnectionState::Idle;

View File

@ -21,7 +21,7 @@ pub struct Receipt {
} }
impl Receipt { impl Receipt {
/// Cacluates [`Log`]'s bloom filter. this is slow operatio and [ReceiptWithBloom] can /// Calculates [`Log`]'s bloom filter. this is slow operation and [ReceiptWithBloom] can
/// be used to cache this value. /// be used to cache this value.
pub fn bloom_slow(&self) -> Bloom { pub fn bloom_slow(&self) -> Bloom {
logs_bloom(self.logs.iter()) logs_bloom(self.logs.iter())

View File

@ -11,7 +11,7 @@
pub mod access_list; pub mod access_list;
/// An inspector stack abstracting the implementation details of /// An inspector stack abstracting the implementation details of
/// each inspector and allowing to hook on block/transaciton execution, /// each inspector and allowing to hook on block/transaction execution,
/// used in the main RETH executor. /// used in the main RETH executor.
pub mod stack; pub mod stack;

View File

@ -78,7 +78,7 @@ pub enum SubscriptionKind {
/// ///
/// Returns the hash for all transactions that are added to the pending state and are signed /// Returns the hash for all transactions that are added to the pending state and are signed
/// with a key that is available in the node. When a transaction that was previously part of /// with a key that is available in the node. When a transaction that was previously part of
/// the canonical chain isn't part of the new canonical chain after a reogranization its again /// the canonical chain isn't part of the new canonical chain after a reorganization its again
/// emitted. /// emitted.
NewPendingTransactions, NewPendingTransactions,
/// Node syncing status subscription. /// Node syncing status subscription.

View File

@ -72,7 +72,7 @@ pub struct Transaction {
impl Transaction { impl Transaction {
/// Create a new rpc transaction result for a mined transaction, using the given block hash, /// Create a new rpc transaction result for a mined transaction, using the given block hash,
/// number, and tx index fields to populate the corresponing fields in the rpc result. /// number, and tx index fields to populate the corresponding fields in the rpc result.
/// ///
/// The block hash, number, and tx index fields should be from the original block where the /// The block hash, number, and tx index fields should be from the original block where the
/// transaction was mined. /// transaction was mined.

View File

@ -82,7 +82,7 @@ where
cfg.disable_block_gas_limit = true; cfg.disable_block_gas_limit = true;
// Disabled because eth_call is sometimes used with eoa senders // Disabled because eth_call is sometimes used with eoa senders
// See <htps://github.com/paradigmxyz/reth/issues/1959> // See <https://github.com/paradigmxyz/reth/issues/1959>
cfg.disable_eip3607 = true; cfg.disable_eip3607 = true;
let request_gas = request.gas; let request_gas = request.gas;

View File

@ -22,7 +22,7 @@ pub enum JwtError {
InvalidSignature, InvalidSignature,
#[error("The iat (issued-at) claim is not within +-60 seconds from the current time")] #[error("The iat (issued-at) claim is not within +-60 seconds from the current time")]
InvalidIssuanceTimestamp, InvalidIssuanceTimestamp,
#[error("Autorization header is missing or invalid")] #[error("Authorization header is missing or invalid")]
MissingOrInvalidAuthorizationHeader, MissingOrInvalidAuthorizationHeader,
#[error("JWT decoding error {0}")] #[error("JWT decoding error {0}")]
JwtDecodingError(String), JwtDecodingError(String),

View File

@ -14,7 +14,7 @@ pub struct JwtAuthValidator {
impl JwtAuthValidator { impl JwtAuthValidator {
/// Creates a new instance of [`JwtAuthValidator`]. /// Creates a new instance of [`JwtAuthValidator`].
/// Validation logics are implemnted by the `secret` /// Validation logics are implemented by the `secret`
/// argument (see [`JwtSecret`]). /// argument (see [`JwtSecret`]).
pub fn new(secret: JwtSecret) -> Self { pub fn new(secret: JwtSecret) -> Self {
Self { secret } Self { secret }

View File

@ -1,6 +1,6 @@
# Stage Benchmarks # Stage Benchmarks
Test vectors are automatically generated if they cannot be found. Futhermore, for certain stages you can link an external database to run the benchmarks. Test vectors are automatically generated if they cannot be found. Furthermore, for certain stages you can link an external database to run the benchmarks.
## Usage ## Usage

View File

@ -10,7 +10,7 @@ use std::{
/// A [`StageSet`] is a logical chunk of stages that depend on each other. It is up to the /// A [`StageSet`] is a logical chunk of stages that depend on each other. It is up to the
/// individual stage sets to determine what kind of configuration they expose. /// individual stage sets to determine what kind of configuration they expose.
/// ///
/// Individual stages in the set can be added, removed and overriden using [`StageSetBuilder`]. /// Individual stages in the set can be added, removed and overridden using [`StageSetBuilder`].
pub trait StageSet<DB: Database>: Sized { pub trait StageSet<DB: Database>: Sized {
/// Configures the stages in the set. /// Configures the stages in the set.
fn builder(self) -> StageSetBuilder<DB>; fn builder(self) -> StageSetBuilder<DB>;
@ -44,7 +44,7 @@ impl<DB: Database> Debug for StageEntry<DB> {
/// The builder provides ordering helpers to ensure that stages that depend on each other are added /// The builder provides ordering helpers to ensure that stages that depend on each other are added
/// to the final sync pipeline before/after their dependencies. /// to the final sync pipeline before/after their dependencies.
/// ///
/// Stages inside the set can be disabled, enabled, overriden and reordered. /// Stages inside the set can be disabled, enabled, overridden and reordered.
pub struct StageSetBuilder<DB> { pub struct StageSetBuilder<DB> {
stages: HashMap<StageId, StageEntry<DB>>, stages: HashMap<StageId, StageEntry<DB>>,
order: Vec<StageId>, order: Vec<StageId>,

View File

@ -213,7 +213,7 @@ pub struct OfflineStages<EF: ExecutorFactory> {
} }
impl<EF: ExecutorFactory> OfflineStages<EF> { impl<EF: ExecutorFactory> OfflineStages<EF> {
/// Create a new set of ofline stages with default values. /// Create a new set of offline stages with default values.
pub fn new(executor_factory: EF) -> Self { pub fn new(executor_factory: EF) -> Self {
Self { executor_factory } Self { executor_factory }
} }

View File

@ -160,7 +160,7 @@ impl<DB: Database> Stage<DB> for MerkleStage {
let target_root = tx.get_header(input.unwind_to)?.state_root; let target_root = tx.get_header(input.unwind_to)?.state_root;
// If the merkle stage fails to execute, the trie changes weren't commited // If the merkle stage fails to execute, the trie changes weren't committed
// and the root stayed the same // and the root stayed the same
if tx.get::<tables::AccountsTrie>(target_root)?.is_some() { if tx.get::<tables::AccountsTrie>(target_root)?.is_some() {
info!(target: "sync::stages::merkle::unwind", "Stage skipped"); info!(target: "sync::stages::merkle::unwind", "Stage skipped");

View File

@ -102,7 +102,7 @@ impl<'a> DbTxMut<'a> for TxMock {
impl<'a> TableImporter<'a> for TxMock {} impl<'a> TableImporter<'a> for TxMock {}
/// CUrsor that iterates over table /// Cursor that iterates over table
pub struct CursorMock { pub struct CursorMock {
_cursor: u32, _cursor: u32,
} }

View File

@ -5,7 +5,7 @@ mod inputs;
/// Fuzzer generates a random instance of the object and proceeds to encode and decode it. It then /// Fuzzer generates a random instance of the object and proceeds to encode and decode it. It then
/// makes sure that it matches the original object. /// makes sure that it matches the original object.
/// ///
/// Some types like [`IntegerList`] might have some restrictons on how they're fuzzed. For example, /// Some types like [`IntegerList`] might have some restrictions on how they're fuzzed. For example,
/// the list is assumed to be sorted before creating the object. /// the list is assumed to be sorted before creating the object.
macro_rules! impl_fuzzer_with_input { macro_rules! impl_fuzzer_with_input {
($(($name:tt, $input_type:tt, $encode:tt, $encode_method:tt, $decode:tt, $decode_method:tt)),+) => { ($(($name:tt, $input_type:tt, $encode:tt, $encode_method:tt, $decode:tt, $decode_method:tt)),+) => {

View File

@ -89,7 +89,7 @@ impl<'a, 'b, TX: DbTx<'a>> StateProvider for LatestStateProviderRef<'a, 'b, TX>
.state_root; .state_root;
let (account_proof, storage_root) = loader let (account_proof, storage_root) = loader
.generate_acount_proof(root, hashed_address) .generate_account_proof(root, hashed_address)
.map_err(|_| ProviderError::StateTrie)?; .map_err(|_| ProviderError::StateTrie)?;
let account_proof = account_proof.into_iter().map(Bytes::from).collect(); let account_proof = account_proof.into_iter().map(Bytes::from).collect();

View File

@ -1485,7 +1485,7 @@ fn unwind_account_history_shards<DB: Database>(
/// Unwind all history shards. For boundary shard, remove it from database and /// Unwind all history shards. For boundary shard, remove it from database and
/// return last part of shard with still valid items. If all full shard were removed, return list /// return last part of shard with still valid items. If all full shard were removed, return list
/// would be empty but this does not mean that there is none shard left but that there is no /// would be empty but this does not mean that there is none shard left but that there is no
/// splitted shards. /// split shards.
fn unwind_storage_history_shards<DB: Database>( fn unwind_storage_history_shards<DB: Database>(
cursor: &mut <<DB as DatabaseGAT<'_>>::TXMut as DbTxMutGAT<'_>>::CursorMut< cursor: &mut <<DB as DatabaseGAT<'_>>::TXMut as DbTxMutGAT<'_>>::CursorMut<
tables::StorageHistory, tables::StorageHistory,

View File

@ -815,7 +815,7 @@ where
TX: DbTx<'db> + Send + Sync, TX: DbTx<'db> + Send + Sync,
{ {
/// Returns a Merkle proof of the given account, plus its storage root hash. /// Returns a Merkle proof of the given account, plus its storage root hash.
pub fn generate_acount_proof( pub fn generate_account_proof(
&self, &self,
root: H256, root: H256,
address: H256, address: H256,
@ -1165,8 +1165,9 @@ mod tests {
let address = Address::from(hex!("000d836201318ec6899a67540690382780743280")); let address = Address::from(hex!("000d836201318ec6899a67540690382780743280"));
let trie = create_test_loader(&tx); let trie = create_test_loader(&tx);
let (proof, storage_root) = let (proof, storage_root) = trie
trie.generate_acount_proof(root, keccak256(address)).expect("failed to generate proof"); .generate_account_proof(root, keccak256(address))
.expect("failed to generate proof");
// values extracted from geth via rpc: // values extracted from geth via rpc:
// { // {
@ -1228,7 +1229,7 @@ mod tests {
let trie = create_test_loader(&tx); let trie = create_test_loader(&tx);
let (account_proof, storage_root) = let (account_proof, storage_root) =
trie.generate_acount_proof(root, hashed_address).expect("failed to generate proof"); trie.generate_account_proof(root, hashed_address).expect("failed to generate proof");
// values extracted from geth via rpc: // values extracted from geth via rpc:
let expected_account = hex!("f86fa1205126413e7857595763591580306b3f228f999498c4c5dfa74f633364936e7651b84bf849819b8418b0d164a029ff6f4d518044318d75b118cf439d8d3d7249c8afcba06ba9ecdf8959410571a02ce1a85814ad94a94ed2a1abaf7c57e9b64326622c1b8c21b4ba4d0e7df61392").as_slice(); let expected_account = hex!("f86fa1205126413e7857595763591580306b3f228f999498c4c5dfa74f633364936e7651b84bf849819b8418b0d164a029ff6f4d518044318d75b118cf439d8d3d7249c8afcba06ba9ecdf8959410571a02ce1a85814ad94a94ed2a1abaf7c57e9b64326622c1b8c21b4ba4d0e7df61392").as_slice();

View File

@ -33,7 +33,7 @@ pub fn init(layers: Vec<BoxedLayer<Registry>>) {
/// Builds a new tracing layer that writes to stdout. /// Builds a new tracing layer that writes to stdout.
/// ///
/// The events are filtered by `default_directive`, unless overriden by `RUST_LOG`. /// The events are filtered by `default_directive`, unless overridden by `RUST_LOG`.
/// ///
/// Colors can be disabled with `RUST_LOG_STYLE=never`, and event targets can be displayed with /// Colors can be disabled with `RUST_LOG_STYLE=never`, and event targets can be displayed with
/// `RUST_LOG_TARGET=1`. /// `RUST_LOG_TARGET=1`.

View File

@ -9,7 +9,7 @@ type EventBroadcast = UnboundedSender<TransactionEvent>;
/// A type that broadcasts [`TransactionEvent`] to installed listeners. /// A type that broadcasts [`TransactionEvent`] to installed listeners.
/// ///
/// This is essentially a multi-producer, multi-consumer channel where each event is broadcasted to /// This is essentially a multi-producer, multi-consumer channel where each event is broadcast to
/// all active receivers. /// all active receivers.
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub(crate) struct PoolEventBroadcast { pub(crate) struct PoolEventBroadcast {