for example i have --rpc-max-connections-per-private-ip=200 on my tor nodes (so every host is 127.0.0.1). when trying to sync old wallets i can barely connect and the node appears offline. more recent wallets are able to connect reliably. after seeing boog900's latest research in this commemt and asking them about how monerod caches commonly scanned blocks it connected the dots for me, that there is some timeout issue.
related constants:
|
#define AGGRESSIVE_TIMEOUT_THRESHOLD 120 // sockets |
|
#define NEW_CONNECTION_TIMEOUT_LOCAL 1200000 // 2 minutes |
|
#define NEW_CONNECTION_TIMEOUT_REMOTE 10000 // 10 seconds |
|
#define DEFAULT_TIMEOUT_MS_LOCAL 1800000 // 30 minutes |
|
#define DEFAULT_TIMEOUT_MS_REMOTE 300000 // 5 minutes |
related code: (further research required)
|
template<typename T> |
|
typename connection<T>::duration_t connection<T>::get_default_timeout() |
|
{ |
|
unsigned count{}; |
|
try { count = host_count(); } catch (...) {} |
|
const unsigned shift = ( |
|
connection_basic::get_state().sock_count > AGGRESSIVE_TIMEOUT_THRESHOLD ? |
|
std::min(std::max(count, 1u) - 1, 8u) : |
|
0 |
|
); |
|
return ( |
|
m_local ? |
|
std::chrono::milliseconds(DEFAULT_TIMEOUT_MS_LOCAL >> shift) : |
|
std::chrono::milliseconds(DEFAULT_TIMEOUT_MS_REMOTE >> shift) |
|
); |
|
} |
)
i don't know exactly how these limits negatively effect but they appear to have no connection to the max connection values
also to consider / todo: can we remove these timeouts entirely for localhost (tor) and rely on tors proof of work defence for new connections? (.. docs)
for example i have
--rpc-max-connections-per-private-ip=200on my tor nodes (so every host is 127.0.0.1). when trying to sync old wallets i can barely connect and the node appears offline. more recent wallets are able to connect reliably. after seeing boog900's latest research in this commemt and asking them about how monerod caches commonly scanned blocks it connected the dots for me, that there is some timeout issue.related constants:
monero/contrib/epee/include/net/abstract_tcp_server2.inl
Lines 62 to 66 in 0156263
related code: (further research required)
monero/contrib/epee/include/net/abstract_tcp_server2.inl
Lines 101 to 116 in 0156263
i don't know exactly how these limits negatively effect but they appear to have no connection to the max connection values
also to consider / todo: can we remove these timeouts entirely for localhost (tor) and rely on tors proof of work defence for new connections? (.. docs)