Open TylerTheFox opened 5 years ago
Yes, it's a primitive mitigation against DoS. IIRC if the addresses are local, the timeouts are a lot more generous.
This was tested on local host, perhaps a launch paramater setting is needed for this?
The timeounts are N divided by 2 for every extra connection from the same host. N is 30 minutes for local hosts, 5 minutes otherwise. 5 connections should yield 112 second timeouts, which should be more than enough. What RPC are you calling ?
Monero wallet rpc with launch flags --wallet-dir Wallets/ --rpc-bind-port 12198 --daemon-address 127.0.0.1:19472 --disable-rpc-login --trusted-daemon.
After about running 5 of those they all start timing out with different port binds ofc.
This should print out the timeout settings it's using.
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index d8779f372..50ae34187 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -586,6 +586,7 @@ PRAGMA_WARNING_DISABLE_VS(4355) try { count = host_count(m_host); } catch (...) { count = 0; } const unsigned shift = std::min(std::max(count, 1u) - 1, 8u); boost::posix_time::milliseconds timeout(0); +MGINFO("timeout: local " << m_local << ", shift " << sfift); if (m_local) timeout = boost::posix_time::milliseconds(DEFAULT_TIMEOUT_MS_LOCAL >> shift); else
I was testing it on the standard monero win32/linux build on the release page https://github.com/monero-project/monero/releases v0.13.0.4
This is the code that launches the RPC, but the issue occurs when launched manually as well (this was written before accounts were a thing with the RPC api). https://github.com/Brandantl/Monero-TipBot/blob/develop/src/Core/RPCManager.cpp#L517
Works fine on the older Monero code bases such as https://github.com/LetheanMovement/lethean but not the newer Monero code base with the timeout issue.
monerod is being launched with default parameters.
If 5 (or more) Monero Wallet RPCs connect to the same Monero Daemon with open wallets the RPCs will start throwing connection errors.
With around 10 RPCs connected to the daemon all the RPCs start complaining after about 30 seconds.
Was a connection limit for RPCs introduced recently? This did not occur in the past.