Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limit of receipts per rav request #159

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ impl SenderAllocationState {
.tap_manager
.create_rav_request(
self.config.tap.rav_request_timestamp_buffer_ms * 1_000_000,
// TODO: limit the number of receipts to aggregate per request.
None,
Some(self.config.tap.rav_request_receipt_limit),
)
.await
.map_err(|e| match e {
Expand Down Expand Up @@ -628,6 +627,7 @@ mod tests {
rav_request_trigger_value: 100,
rav_request_timestamp_buffer_ms: 1,
rav_request_timeout_secs: 5,
rav_request_receipt_limit: 1000,
..Default::default()
},
..Default::default()
Expand Down
11 changes: 10 additions & 1 deletion tap-agent/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub struct Tap {
env = "RAV_REQUEST_TIMESTAMP_BUFFER",
help = "Buffer (in ms) to add between the current time and the timestamp of the \
last unaggregated fee when triggering a RAV request.",
default_value_t = 1_000 // 1 second
default_value_t = 60_000 // 60 seconds
aasseman marked this conversation as resolved.
Show resolved Hide resolved
)]
pub rav_request_timestamp_buffer_ms: u64,
#[clap(
Expand All @@ -259,6 +259,15 @@ pub struct Tap {
help = "YAML file with a map of sender addresses to aggregator endpoints."
)]
pub sender_aggregator_endpoints_file: PathBuf,

#[clap(
long,
value_name = "rav-request-receipt-limit",
env = "RAV_REQUEST_RECEIPT_LIMIT",
help = "Amount that will define the limit of receipts to aggregate per request",
aasseman marked this conversation as resolved.
Show resolved Hide resolved
default_value_t = 10000
)]
pub rav_request_receipt_limit: u64,
}

/// Sets up tracing, allows log level to be set from the environment variables
Expand Down
Loading