mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: fix some typos (#2025)
This commit is contained in:
@ -68,7 +68,7 @@ pub fn should_skip(path: &Path) -> bool {
|
||||
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
|
||||
// It is expected to not execute these tests.
|
||||
if path.file_name() == Some(OsStr::new("accessListExample.json")) ||
|
||||
|
||||
@ -346,7 +346,7 @@ pub fn validate_header_regarding_parent(
|
||||
/// Checks:
|
||||
/// If we already know the block.
|
||||
/// If parent is known
|
||||
/// If withdarwals are valid
|
||||
/// If withdrawals are valid
|
||||
///
|
||||
/// Returns parent block header
|
||||
pub fn validate_block_regarding_chain<PROV: HeaderProvider + WithdrawalsProvider>(
|
||||
|
||||
@ -260,7 +260,7 @@ pub fn random_storage_entry(key_range: std::ops::Range<u64>) -> StorageEntry {
|
||||
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) {
|
||||
let nonce: u64 = rand::random();
|
||||
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 })
|
||||
}
|
||||
|
||||
/// 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)> {
|
||||
let mut accounts = Vec::with_capacity(acc_range.end.saturating_sub(acc_range.start) as usize);
|
||||
for _ in acc_range {
|
||||
|
||||
@ -652,7 +652,7 @@ mod tests {
|
||||
let (secret_key, _) = SECP256K1.generate_keypair(&mut rng);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ use std::{
|
||||
|
||||
/// 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
|
||||
/// will issue another request until all bodies are collected.
|
||||
///
|
||||
@ -40,7 +40,7 @@ pub(crate) struct BodiesRequestFuture<B: BodiesClient> {
|
||||
consensus: Arc<dyn Consensus>,
|
||||
metrics: DownloaderMetrics,
|
||||
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>,
|
||||
buffer: Vec<BlockResponse>,
|
||||
fut: Option<B::Output>,
|
||||
@ -264,7 +264,7 @@ mod tests {
|
||||
|
||||
/// Check that the request future
|
||||
#[tokio::test]
|
||||
async fn request_submits_until_fullfilled() {
|
||||
async fn request_submits_until_fulfilled() {
|
||||
// Generate some random blocks
|
||||
let (headers, mut bodies) = generate_bodies(0..20);
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ mod tests {
|
||||
let (incoming, _) = listener.accept().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();
|
||||
assert_eq!(message, Bytes::from("hello"));
|
||||
});
|
||||
|
||||
@ -145,7 +145,7 @@ impl From<EthBroadcastMessage> for ProtocolBroadcastMessage {
|
||||
|
||||
/// 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:
|
||||
/// * A request message sent by a peer (such as [`GetPooledTransactions`]), and an associated
|
||||
/// response message (such as [`PooledTransactions`]).
|
||||
|
||||
@ -69,7 +69,7 @@ pub enum ParseNatResolverError {
|
||||
AddrParseError(#[from] AddrParseError),
|
||||
/// Failed to parse due to unknown variant
|
||||
#[error("Unknown Nat Resolver variant: {0}")]
|
||||
UnknonwVariant(String),
|
||||
UnknownVariant(String),
|
||||
}
|
||||
|
||||
impl FromStr for NatResolver {
|
||||
@ -82,7 +82,7 @@ impl FromStr for NatResolver {
|
||||
"none" => NatResolver::None,
|
||||
"publicip" | "public-ip" => NatResolver::PublicIp,
|
||||
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}"
|
||||
))) };
|
||||
NatResolver::ExternalIp(ip.parse::<IpAddr>()?)
|
||||
|
||||
@ -73,7 +73,7 @@ impl<C> EthRequestHandler<C>
|
||||
where
|
||||
C: BlockProvider + HeaderProvider,
|
||||
{
|
||||
/// Returns the list of requested heders
|
||||
/// Returns the list of requested headers
|
||||
fn get_headers_response(&self, request: GetBlockHeaders) -> Vec<Header> {
|
||||
let GetBlockHeaders { start_block, limit, skip, direction } = request;
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ use std::{
|
||||
};
|
||||
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)]
|
||||
#[pin_project]
|
||||
pub struct FlattenedResponse<T> {
|
||||
|
||||
@ -50,7 +50,7 @@ pub struct TransactionsManagerMetrics {
|
||||
#[derive(Metrics)]
|
||||
#[metrics(scope = "network")]
|
||||
pub struct DisconnectMetrics {
|
||||
/// Number of peer disconnects due to DisconnectRequestd (0x00)
|
||||
/// Number of peer disconnects due to DisconnectRequested (0x00)
|
||||
pub(crate) disconnect_requested: Counter,
|
||||
|
||||
/// Number of peer disconnects due to TcpSubsystemError (0x01)
|
||||
|
||||
@ -307,7 +307,7 @@ pub(crate) enum NetworkHandleMessage {
|
||||
FetchClient(oneshot::Sender<FetchClient>),
|
||||
/// Apply a status update.
|
||||
StatusUpdate { head: Head },
|
||||
/// Get the currenet status
|
||||
/// Get the current status
|
||||
GetStatus(oneshot::Sender<NetworkStatus>),
|
||||
/// Get PeerInfo from all the peers
|
||||
GetPeerInfo(oneshot::Sender<Vec<PeerInfo>>),
|
||||
|
||||
@ -345,7 +345,7 @@ impl PeersManager {
|
||||
self.queued_actions.push_back(PeerAction::PeerRemoved(peer_id));
|
||||
} else {
|
||||
// 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
|
||||
entry.get_mut().backoff_counter = 0;
|
||||
entry.get_mut().state = PeerConnectionState::Idle;
|
||||
|
||||
@ -21,7 +21,7 @@ pub struct 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.
|
||||
pub fn bloom_slow(&self) -> Bloom {
|
||||
logs_bloom(self.logs.iter())
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
pub mod access_list;
|
||||
|
||||
/// 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.
|
||||
pub mod stack;
|
||||
|
||||
|
||||
@ -78,7 +78,7 @@ pub enum SubscriptionKind {
|
||||
///
|
||||
/// 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
|
||||
/// 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.
|
||||
NewPendingTransactions,
|
||||
/// Node syncing status subscription.
|
||||
|
||||
@ -72,7 +72,7 @@ pub struct Transaction {
|
||||
|
||||
impl Transaction {
|
||||
/// 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
|
||||
/// transaction was mined.
|
||||
|
||||
@ -82,7 +82,7 @@ where
|
||||
cfg.disable_block_gas_limit = true;
|
||||
|
||||
// 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;
|
||||
|
||||
let request_gas = request.gas;
|
||||
|
||||
@ -22,7 +22,7 @@ pub enum JwtError {
|
||||
InvalidSignature,
|
||||
#[error("The iat (issued-at) claim is not within +-60 seconds from the current time")]
|
||||
InvalidIssuanceTimestamp,
|
||||
#[error("Autorization header is missing or invalid")]
|
||||
#[error("Authorization header is missing or invalid")]
|
||||
MissingOrInvalidAuthorizationHeader,
|
||||
#[error("JWT decoding error {0}")]
|
||||
JwtDecodingError(String),
|
||||
|
||||
@ -14,7 +14,7 @@ pub struct JwtAuthValidator {
|
||||
|
||||
impl JwtAuthValidator {
|
||||
/// Creates a new instance of [`JwtAuthValidator`].
|
||||
/// Validation logics are implemnted by the `secret`
|
||||
/// Validation logics are implemented by the `secret`
|
||||
/// argument (see [`JwtSecret`]).
|
||||
pub fn new(secret: JwtSecret) -> Self {
|
||||
Self { secret }
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# 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
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ use std::{
|
||||
/// 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 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 {
|
||||
/// Configures the stages in the set.
|
||||
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
|
||||
/// 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> {
|
||||
stages: HashMap<StageId, StageEntry<DB>>,
|
||||
order: Vec<StageId>,
|
||||
|
||||
@ -213,7 +213,7 @@ pub struct OfflineStages<EF: ExecutorFactory> {
|
||||
}
|
||||
|
||||
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 {
|
||||
Self { executor_factory }
|
||||
}
|
||||
|
||||
@ -160,7 +160,7 @@ impl<DB: Database> Stage<DB> for MerkleStage {
|
||||
|
||||
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
|
||||
if tx.get::<tables::AccountsTrie>(target_root)?.is_some() {
|
||||
info!(target: "sync::stages::merkle::unwind", "Stage skipped");
|
||||
|
||||
@ -102,7 +102,7 @@ impl<'a> DbTxMut<'a> for TxMock {
|
||||
|
||||
impl<'a> TableImporter<'a> for TxMock {}
|
||||
|
||||
/// CUrsor that iterates over table
|
||||
/// Cursor that iterates over table
|
||||
pub struct CursorMock {
|
||||
_cursor: u32,
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ mod inputs;
|
||||
/// 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.
|
||||
///
|
||||
/// 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.
|
||||
macro_rules! impl_fuzzer_with_input {
|
||||
($(($name:tt, $input_type:tt, $encode:tt, $encode_method:tt, $decode:tt, $decode_method:tt)),+) => {
|
||||
|
||||
@ -89,7 +89,7 @@ impl<'a, 'b, TX: DbTx<'a>> StateProvider for LatestStateProviderRef<'a, 'b, TX>
|
||||
.state_root;
|
||||
|
||||
let (account_proof, storage_root) = loader
|
||||
.generate_acount_proof(root, hashed_address)
|
||||
.generate_account_proof(root, hashed_address)
|
||||
.map_err(|_| ProviderError::StateTrie)?;
|
||||
let account_proof = account_proof.into_iter().map(Bytes::from).collect();
|
||||
|
||||
|
||||
@ -1485,7 +1485,7 @@ fn unwind_account_history_shards<DB: Database>(
|
||||
/// 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
|
||||
/// 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>(
|
||||
cursor: &mut <<DB as DatabaseGAT<'_>>::TXMut as DbTxMutGAT<'_>>::CursorMut<
|
||||
tables::StorageHistory,
|
||||
|
||||
@ -815,7 +815,7 @@ where
|
||||
TX: DbTx<'db> + Send + Sync,
|
||||
{
|
||||
/// Returns a Merkle proof of the given account, plus its storage root hash.
|
||||
pub fn generate_acount_proof(
|
||||
pub fn generate_account_proof(
|
||||
&self,
|
||||
root: H256,
|
||||
address: H256,
|
||||
@ -1165,8 +1165,9 @@ mod tests {
|
||||
let address = Address::from(hex!("000d836201318ec6899a67540690382780743280"));
|
||||
|
||||
let trie = create_test_loader(&tx);
|
||||
let (proof, storage_root) =
|
||||
trie.generate_acount_proof(root, keccak256(address)).expect("failed to generate proof");
|
||||
let (proof, storage_root) = trie
|
||||
.generate_account_proof(root, keccak256(address))
|
||||
.expect("failed to generate proof");
|
||||
|
||||
// values extracted from geth via rpc:
|
||||
// {
|
||||
@ -1228,7 +1229,7 @@ mod tests {
|
||||
|
||||
let trie = create_test_loader(&tx);
|
||||
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:
|
||||
let expected_account = hex!("f86fa1205126413e7857595763591580306b3f228f999498c4c5dfa74f633364936e7651b84bf849819b8418b0d164a029ff6f4d518044318d75b118cf439d8d3d7249c8afcba06ba9ecdf8959410571a02ce1a85814ad94a94ed2a1abaf7c57e9b64326622c1b8c21b4ba4d0e7df61392").as_slice();
|
||||
|
||||
@ -33,7 +33,7 @@ pub fn init(layers: Vec<BoxedLayer<Registry>>) {
|
||||
|
||||
/// 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
|
||||
/// `RUST_LOG_TARGET=1`.
|
||||
|
||||
@ -9,7 +9,7 @@ type EventBroadcast = UnboundedSender<TransactionEvent>;
|
||||
|
||||
/// 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.
|
||||
#[derive(Debug, Default)]
|
||||
pub(crate) struct PoolEventBroadcast {
|
||||
|
||||
Reference in New Issue
Block a user