max_concurrent_outbound_dials does not restrict max concurrent outbound dials #6778
Labels
A-networking
Related to networking in general
C-enhancement
New feature or request
D-good-first-issue
Nice and easy! A great choice to get started
Describe the feature
The
max_concurrent_outbound_dials
reth/crates/net/network/src/peers/manager.rs
Lines 832 to 834 in a7e183d
only restricts how many new outbound dials we create at once but this does not respect how many are already in progress atm.
reth/crates/net/network/src/peers/manager.rs
Line 702 in a7e183d
This should instead restrict how many outbound dials we allow at once and should slow down new connections if exceeded.
TODO
This can be solved by a new connection state and counter that is
PendingOut
reth/crates/net/network/src/peers/manager.rs
Lines 822 to 824 in a7e183d
reth/crates/net/network/src/peers/manager.rs
Lines 1021 to 1022 in a7e183d
when we initiate an outgoing connection the peer's state is set to
PendingOut
and counter increased.once the session is established or failed we need to update the state and counter for all possible cases:
reth/crates/net/network/src/peers/manager.rs
Line 850 in a7e183d
reth/crates/net/network/src/peers/manager.rs
Line 386 in a7e183d
and need a new function
on_active_session_established
that then shifts the peer's state fromPendingOut
toOut
Additional context
No response
The text was updated successfully, but these errors were encountered: