Keep the handshake cookie in `tcp_server` instead of a shared table (#5278) A handshake cookie belongs to one connection, so the server of that connection now holds it: `handshake_cookie` is set when the connection sends its query and taken when a response arrives. A connection sends one query, the side that opened it in its request and the side that accepted it next to its response. `nano::syn_cookies`, which kept the cookies per endpoint next to the connections and counted them per IP, is removed together with its purge in the cleanup loop, `syn_cookie_cutoff`, its container info and the unused `syn_cookies` stat and log types. `prepare_handshake_query ()` no longer takes an endpoint and always returns a query, and `verify_handshake_response ()` takes the cookie of the connection the response arrived on. A cookie now lasts as long as its connection's handshake, so the handshake timeout bounds it. A new connection to an endpoint asks with a cookie of its own whatever became of an earlier connection there, and the listener's per IP limit is the one bound on handshakes per IP, which also makes `disable_max_peers_per_ip` apply to them. The `tcp_server` tests cover a response on a connection that sent no query, two connections from one IP getting separate cookies, and a second connection to an endpoint whose first one ended mid handshake.
__________
Type: commit
Hash: 5bdac0ca50ed25b60594bdd664c5d3e9d6a4bfbe
Created: today
__________
gr0v1ty/nano-node:5bdac0ca50ed25b60594bdd664c5d3e9d6a4bfbe
| Test Case | Status | Duration | Median Deviation | Log | Graph |
|---|---|---|---|---|---|
| 5n4pr_conf_10k_bintree | PASS | 117 s | 4.0 s | GitHub job logs | Show |
| 5n4pr_conf_10k_change | PASS | 111 s | -23.5 s | GitHub job logs | Show |
| 5n4pr_conf_change_dependant | PASS | 112 s | -3.0 s | GitHub job logs | - |
| 5n4pr_conf_change_independant | PASS | 119 s | 7.0 s | GitHub job logs | - |
| 5n4pr_conf_send_dependant | PASS | 106 s | -8.0 s | GitHub job logs | - |
| 5n4pr_conf_send_independant | PASS | 97 s | -16.5 s | GitHub job logs | - |
| 5n4pr_rocks_10k_bintree | FAIL | 3 s | -109.5 s | Test log | - |
| 5n4pr_rocks_10k_change | PASS | 156 s | -3.0 s | GitHub job logs | - |