Skip to content

Commit c71fc1d

Browse files
committed
docs: fix typos and grammar
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 0178aed commit c71fc1d

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

crates/tap-agent/src/adaptative_concurrency.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
//! # Adaptative concurrency
5-
//! This module provide [AdaptiveLimiter] as a tool to allow concurrency.
6-
//! It's implemented with a Additive increase, Multiplicative decrease
5+
//! This module provides [AdaptiveLimiter] as a tool to allow concurrency.
6+
//! It's implemented with an Additive increase, Multiplicative decrease
77
//! ([AIMD](https://en.wikipedia.org/wiki/Additive_increase/multiplicative_decrease))
88
//! strategy.
99
//!
1010
//!
1111
//!
1212
//! This allows us to have a big number of rav requests running
13-
//! concurrently, but in case of any of them fails, we limit
13+
//! concurrently, but if any of them fails we limit
1414
//! the following requests until the aggregator recovers.
1515
//!
1616
//! ## Behaviour
17-
//! On every request, the caller acquires a slot by calling [AdaptiveLimiter::acquire()],
18-
//! this will increment the number of in_flight connections.
17+
//! On every request, the caller acquires a slot by calling [AdaptiveLimiter::acquire()].
18+
//! This will increment the number of in_flight connections.
1919
//!
2020
//! If we receive a successful response, we increment our limit to be able to process
2121
//! one more request concurrently.
2222
//!
23-
//! If we receive a failed response, we decrement our limit by half so quickly
23+
//! If we receive a failed response, we decrement our limit by half to quickly
2424
//! relieve the pressure in the system.
2525
2626
use std::ops::Range;

crates/tap-agent/src/agent.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
//! # agent
5+
//!
56
//! The agent is a set of 3 actors:
67
//! - [sender_accounts_manager::SenderAccountsManager]
78
//! - [sender_account::SenderAccount]
@@ -22,7 +23,7 @@
2223
//! [sender_allocation::SenderAllocation] receives notifications from the spawned task and then
2324
//! it updates its state an notifies its parent actor.
2425
//!
25-
//! Once [sender_account::SenderAccount] gets enought receipts, it uses its tracker to decide
26+
//! Once [sender_account::SenderAccount] gets enough receipts, it uses its tracker to decide
2627
//! what is the allocation with the most amount of fees and send a message to trigger a RavRequest.
2728
//!
2829
//! When the allocation is closed by the indexer, [sender_allocation::SenderAllocation] is

crates/tap-agent/src/agent/sender_accounts_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Display for AllocationId {
8787
#[derive(Debug)]
8888
pub enum SenderAccountsManagerMessage {
8989
/// Spawn and Stop [SenderAccount]s that were added or removed
90-
/// in comparision with it current state and updates the state
90+
/// in comparison with it current state and updates the state
9191
UpdateSenderAccounts(HashSet<Address>),
9292
}
9393

crates/tap-agent/src/backoff.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
//! # backoff
5+
//!
56
//! This module is used to provide a helper that keep tracks of exponential backoff information in a
6-
//! non-blocking way. This is important since Actors process one message at a time, and an sleep in
7+
//! non-blocking way. This is important since Actors process one message at a time, and a sleep in
78
//! the middle would affect performance.
89
//!
910
//! This way we just mark something as "in backoff" and just check that information before sending
@@ -21,14 +22,14 @@ pub struct BackoffInfo {
2122
}
2223

2324
impl BackoffInfo {
24-
/// Callback represinging that a request succeed
25+
/// Callback representing a successful request
2526
///
2627
/// This resets the failed_count
2728
pub fn ok(&mut self) {
2829
self.failed_count = 0;
2930
}
3031

31-
/// Callback represinging that a request failed
32+
/// Callback representing a failed request
3233
///
3334
/// This sets the backoff time to max(100ms * 2 ^ retries, 60s)
3435
pub fn fail(&mut self) {
@@ -39,7 +40,7 @@ impl BackoffInfo {
3940
self.failed_count += 1;
4041
}
4142

42-
/// Returns if is in backoff
43+
/// Returns if backoff is in process
4344
pub fn in_backoff(&self) -> bool {
4445
let now = Instant::now();
4546
now < self.failed_backoff_time

crates/tap-agent/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
#![warn(missing_docs)] // Warns if any public item lacks documentation
55

66
//! # Tap-Agent
7+
//!
78
//! This software is used to monitor receipts inserted in the database
89
//! and to keep track of all the values across different allocations.
910
//!
10-
//! It's main goal is that the value never goes below the balance available
11+
//! Its main goal is that the value never goes below the balance available
1112
//! in the escrow account for a given sender.
1213
1314
use indexer_config::Config;

crates/tap-agent/src/tracker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ pub trait AllocationStats<U> {
5757
///
5858
/// Pending fees are usually fees that not eligible to trigger a RAV,
5959
/// for example, you don't want to trigger a Rav Request if your only allocation is currently
60-
/// requesting, so this should return a value that don't contains that allocation
60+
/// requesting, so this should return a value that doesn't contain that allocation
6161
fn get_valid_fee(&mut self) -> u128;
6262
}

crates/tap-agent/src/tracker/sender_fee_stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ pub struct SenderFeeStats {
1616
pub(super) total_fee: u128,
1717
/// counter of receipts
1818
pub(super) count: u64,
19-
/// there are some allocations that we don't want it to be
20-
/// heaviest allocation, because they are already marked for finalization,
19+
/// there are some allocations that we don't want to be the
20+
/// heaviest allocation. This is because they are already marked for finalization,
2121
/// and thus requesting RAVs on their own in their `post_stop` routine.
2222
pub(super) blocked: bool,
2323
/// amount of fees that are currently being requested

0 commit comments

Comments
 (0)