Skip to content

Commit

Permalink
Expose max concurrent GetPooledTransactions reqs per peer in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Aug 15, 2024
1 parent bff65e5 commit 96e0a8b
Show file tree
Hide file tree
Showing 82 changed files with 481 additions and 436 deletions.
3 changes: 3 additions & 0 deletions book/cli/reth/debug/execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/debug/in-memory-merkle.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/debug/merkle.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/debug/replay-engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/p2p.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/stage/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30

--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.

--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
3 changes: 3 additions & 0 deletions book/cli/reth/stage/unwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ Networking:
--max-inbound-peers <MAX_INBOUND_PEERS>
Maximum number of inbound requests. default: 30
--max-tx-reqs-peer <MAX_TX_REQS_PEER>
Max concurrent `GetPooledTransactions` requests per peer.
--pooled-tx-response-soft-limit <BYTES>
Experimental, for usage in research. Sets the max accumulated byte size of transactions
to pack in one response.
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl EnvironmentArgs {
{
if factory.db_ref().is_read_only() {
warn!(target: "reth::cli", ?unwind_target, "Inconsistent storage. Restart node to heal.");
return Ok(factory)
return Ok(factory);
}

// Highly unlikely to happen, and given its destructive nature, it's better to panic
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/db/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<DB: Database> TableViewer<(u64, Duration)> for ChecksumViewer<'_, DB> {

total = index + 1;
if total >= limit {
break
break;
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/cli/commands/src/db/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ where
) {
// do not bother comparing if the key is already in the discrepancies map
if self.discrepancies.contains_key(&key) {
return
return;
}

// do not bother comparing if the key is already in the extra elements map
if self.extra_elements.contains_key(&key) {
return
return;
}

match (first, second) {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/db/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl Command {
.as_ref()
.map(|search| {
if let Some(search) = search.strip_prefix("0x") {
return hex::decode(search).unwrap()
return hex::decode(search).unwrap();
}
search.as_bytes().to_vec()
})
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl Command {

if !input.trim().eq_ignore_ascii_case("y") {
println!("Database drop aborted!");
return Ok(())
return Ok(());
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/db/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ where
}
}

return Ok(false)
return Ok(false);
}

match event {
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/stage/dump/hashing_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn dry_run<DB: Database>(
checkpoint: Some(StageCheckpoint::new(from)),
};
if stage.execute(&provider, input)?.done {
break
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/stage/dump/hashing_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ fn dry_run<DB: Database>(
checkpoint: Some(StageCheckpoint::new(from)),
};
if stage.execute(&provider, input)?.done {
break
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/stage/dump/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn dry_run<DB: Database>(
checkpoint: Some(StageCheckpoint::new(from)),
};
if stage.execute(&provider, input)?.done {
break
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/stage/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl Command {
}

if done {
break
break;
}
}
info!(target: "reth::cli", stage = %self.stage, time = ?start.elapsed(), "Finished stage");
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/commands/src/test_vectors/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ where
let key: T::Key = strat_keys.new_tree(runner).map_err(|e| eyre::eyre!("{e}"))?.current();

if !seen_keys.insert(key.clone()) {
continue
continue;
}

let mut values: Vec<T::Value> =
Expand Down
6 changes: 3 additions & 3 deletions crates/cli/util/src/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ pub enum SocketAddressParsingError {
/// An error is returned if the value is empty.
pub fn parse_socket_address(value: &str) -> eyre::Result<SocketAddr, SocketAddressParsingError> {
if value.is_empty() {
return Err(SocketAddressParsingError::Empty)
return Err(SocketAddressParsingError::Empty);
}

if let Some(port) = value.strip_prefix(':').or_else(|| value.strip_prefix("localhost:")) {
let port: u16 = port.parse()?;
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port));
}
if let Ok(port) = value.parse::<u16>() {
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port))
return Ok(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), port));
}
value
.to_socket_addrs()?
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/util/src/sigsegv_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extern "C" fn print_stack_trace(_: libc::c_int) {
// Collect return addresses
let depth = libc::backtrace(STACK_TRACE.as_mut_ptr(), MAX_FRAMES as i32);
if depth == 0 {
return
return;
}
&STACK_TRACE.as_slice()[0..(depth as _)]
};
Expand All @@ -69,7 +69,7 @@ extern "C" fn print_stack_trace(_: libc::c_int) {
let period = period.saturating_add(1); // avoid "what if wrapped?" branches
let Some(offset) = stack.iter().skip(period).zip(stack).position(cycled) else {
// impossible.
return
return;
};

// Count matching trace slices, else we could miscount "biphasic cycles"
Expand Down
6 changes: 3 additions & 3 deletions crates/net/banlist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{collections::HashMap, net::IpAddr, time::Instant};
/// Should be replaced with [`IpAddr::is_global`](std::net::IpAddr::is_global) once it is stable.
pub const fn is_global(ip: &IpAddr) -> bool {
if ip.is_unspecified() || ip.is_loopback() {
return false
return false;
}

match ip {
Expand Down Expand Up @@ -62,7 +62,7 @@ impl BanList {
if let Some(until) = until {
if now > *until {
evicted.push(*peer);
return false
return false;
}
}
true
Expand All @@ -77,7 +77,7 @@ impl BanList {
if let Some(until) = until {
if now > *until {
evicted.push(*peer);
return false
return false;
}
}
true
Expand Down
Loading

0 comments on commit 96e0a8b

Please sign in to comment.