The per-connection transient address feature in 24.0.1 is, we are pretty sure, putting a large load on the I2P network. Starting on Dec. 19 the number of tunnels in the network started to increase, and as measured at one router, it peaked at about 3x normal levels on Dec. 26. While the load is manageable for now, if the transient feature becomes popular, it has the potential to get much much worse.
I2P isn’t really designed to work that way, and some limit on the number of addresses (aka destinations or tunnels) built by the bitcoin client is necessary. I2P Destinations are designed to be long-lived, it’s not like in Tor where you can create tons of circuits. Waiting for tunnels to be built for each connection also adds a huge amount of delay to connection setup time.
A high number of addresses will also result in excessive CPU and bandwidth usage by your router to build the tunnels for each. Additionally, other routers will reject your excessive tunnel building, which will increase your resource usage even more as your router retries. And, of course, the overhead applies to every connection attempt, not just every successful connection.
Depending on your security goals, and the max number of i2p connections you wish to support, there’s a few options for you to consider:
- Use a single transient address, created at startup
- Hard limit the number of i2p connections if configured for transient
- Group several connections into one of several addresses in a pool
- Rate limit new connections or creation of new addresses
The i2pd router does not currently limit the number of local destinations, I don’t think. The Java router limits to 100 by default and will reject addresses over that limit.
If you do choose to continue using multiple addresses, we recommend a reasonable maximum number of addresses of around 16 or so, together with a rate limit on how frequently you create new ones.
Unfortunately I did not realize this was happening when I reviewed your transient changes, but your 24.0.1 release notes confirm it. We ask that you please fix and include this in your next point release.
In the meantime, please update your i2p doc to discourage the transient option. Also in that doc, in the bandwidth section at the bottom, please encourage people to share as much bandwidth and transittunnels as they can, to increase their anonymity with the cover traffic, and so that bitcoin users contribute more to the i2p network than they consume.
If a popular application uses more network resources than it contributes, it has the potential to take down the entire network.
Reference files:
https://github.com/bitcoin/bitcoin/blob/master/src/net.cpp#L499 https://github.com/bitcoin/bitcoin/blob/master/doc/i2p.md
Thank you very much for considering this change.
Graph of number of tunnels on a typical high-speed i2p router, Dec. 15-26: (edit, replaced link) https://i2pd.xyz/partTunnels-12days.png