diff options
author | fanquake <fanquake@gmail.com> | 2020-09-30 12:17:06 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-09-30 12:41:22 +0800 |
commit | c7ad94428ab6f54661d7a5441e1fdd0ebf034903 (patch) | |
tree | 3655a0b2976800227edb15bcd81ab7d53d6d531d /src/net.h | |
parent | de4b7f25acef14f98ed09b7cbaa065067313d24b (diff) | |
parent | 2ea62cae483b764e30f61c06d8ac65755bbd864c (diff) |
Merge #19958: doc: Better document features of feelers
2ea62cae483b764e30f61c06d8ac65755bbd864c Improve docs about feeler connections (Gleb Naumenko)
Pull request description:
"feeler" and "test-before-evict" are two different strategies suggest in [Eclipse Attacks on Bitcoin’s Peer-to-Peer Network](https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-heilman.pdf). In our codebase, we use `ConnType::FEELER` to implement both.
It is confusing, up to the point that our documentation was just incorrect.
This PR:
- ~clarifies this aspect by renaming "ConnType::FEELER" to "ConnType::PROBE", meaning that this connections only probes that the node is operational, and then disconnects.~
- fixes the documentation
ACKs for top commit:
amitiuttarwar:
ACK 2ea62cae48. thank you!
practicalswift:
ACK 2ea62cae483b764e30f61c06d8ac65755bbd864c
Tree-SHA512: c9c03c09eefeacec28ea199cc3f697b0a98723f2f849f7a8115edc43791f8165e296e0e25a82f0b5a4a781a7de38c8954b48bf74c714eba02cdc21f7460673e5
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -153,10 +153,19 @@ enum class ConnectionType { MANUAL, /** - * Feeler connections are short lived connections used to increase the - * number of connectable addresses in our AddrMan. Approximately every - * FEELER_INTERVAL, we attempt to connect to a random address from the new - * table. If successful, we add it to the tried table. + * Feeler connections are short-lived connections made to check that a node + * is alive. They can be useful for: + * - test-before-evict: if one of the peers is considered for eviction from + * our AddrMan because another peer is mapped to the same slot in the tried table, + * evict only if this longer-known peer is offline. + * - move node addresses from New to Tried table, so that we have more + * connectable addresses in our AddrMan. + * Note that in the literature ("Eclipse Attacks on Bitcoin’s Peer-to-Peer Network") + * only the latter feature is referred to as "feeler connections", + * although in our codebase feeler connections encompass test-before-evict as well. + * We make these connections approximately every FEELER_INTERVAL: + * first we resolve previously found collisions if they exist (test-before-evict), + * otherwise connect to a node from the new table. */ FEELER, |