Count closed connections toward the per IP limit for a cooldown (#5261) * Count closed connections toward the per IP limit for a cooldown A connection that closed keeps counting toward the per IP and per subnetwork limits of `tcp_listener` for `tcp.reconnect_cooldown`, 60 seconds by default, so a peer gets `max_peers_per_ip` connections per cooldown rather than per purge tick. Cooldowns do not count toward the inbound connection cap. * Comment the `tcp_config` settings * Index listener connections by address and subnetwork `tcp_listener` keeps its connections in a multi_index hashed by the normalized address and the subnetwork, both stored on the entry, so the per IP and per subnetwork counts are index lookups like the cooldowns instead of scans over the list. * Move the listener's limit bookkeeping into `tcp_listener_index` `tcp_listener_index` is the listener's one table: the open connections with their sockets and servers, the outbound connects in flight with their tasks, and the cooldowns of closed connections, all counted against the caps they are subject to. It answers whether one more connection or attempt fits, hands removed entries back so the listener closes them outside its lock, and never touches the handles it carries, so the new suite drives it directly with injected time and null handles. `connection_type` moves to the transport namespace beside `socket_type` and `socket_endpoint`, the enum helpers become free functions, and `common.cpp` takes the `to_string` bodies that sat in `tcp_socket.cpp`. A full inbound or outbound cap now counts under its own stat detail instead of `max_attempts`, and the global attempt cap refuses at the cap like every other one.
__________
Type: commit
Hash: e8d0db009b9c21b7608c86623cbc80178f8e1193
Created: today
__________
gr0v1ty/nano-node:e8d0db009b9c21b7608c86623cbc80178f8e1193
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 102 s | -11.5 s | GitHub job logs | Show |
| 5n4pr_conf_10k_change | PASS | 129 s | -15.5 s | GitHub job logs | Show |
| 5n4pr_conf_change_dependant | PASS | 114 s | -1.0 s | GitHub job logs | - |
| 5n4pr_conf_change_independant | PASS | 108 s | -3.5 s | GitHub job logs | - |
| 5n4pr_conf_send_dependant | PASS | 111 s | -4.5 s | GitHub job logs | - |
| 5n4pr_conf_send_independant | PASS | 116 s | 4.0 s | GitHub job logs | - |
| 5n4pr_rocks_10k_bintree | PASS | 112 s | -0.5 s | GitHub job logs | - |
| 5n4pr_rocks_10k_change | PASS | 195 s | 34.5 s | GitHub job logs | - |