doc: Better document features of feelers #19958

pull naumenkogs wants to merge 1 commits into bitcoin:master from naumenkogs:2020-09-rename-feeler-to-probe changing 2 files +14 −5
  1. naumenkogs commented at 8:04 am on September 15, 2020: member

    “feeler” and “test-before-evict” are two different strategies suggest in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network. 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
  2. naumenkogs commented at 8:05 am on September 15, 2020: member
  3. fanquake added the label P2P on Sep 15, 2020
  4. naumenkogs force-pushed on Sep 15, 2020
  5. naumenkogs force-pushed on Sep 15, 2020
  6. laanwj commented at 11:22 am on September 15, 2020: member
    Not quite sure what the travis error is. It produces a huge log while executing the diff script though, maybe it’s sending output to stdout accidentally or such?
  7. naumenkogs force-pushed on Sep 15, 2020
  8. naumenkogs force-pushed on Sep 15, 2020
  9. sipa commented at 5:20 pm on September 15, 2020: member
    It seems this unconditionally renames all uses of “feeler” to “probe”. How does that clarify anything?
  10. ajtowns commented at 0:57 am on September 16, 2020: member

    Not quite sure what the travis error is. It produces a huge log while executing the diff script though, maybe it’s sending output to stdout accidentally or such?

    The sed commands in the scripted diff are missing the -i (in place) option.

  11. naumenkogs force-pushed on Sep 16, 2020
  12. naumenkogs commented at 6:48 am on September 16, 2020: member

    @sipa

    1. All uses of “feeler” in our codebase referred to not just feeleres, but also “test before evict conns”, which have different goals per the paper. I suggest that connections encompassing both features should not be called as one of those features, but rather should have its own name (“probe”). Otherwise, it’s very easy to forget that “feeler conns” also do test-before-evict. And we actually had that mistake in the codebase (see the second commit)
    2. The second commit was dropped while I was figuring out travis issues, it’s back now. See extra documentation, where the distinction between two features is clarified.
  13. practicalswift commented at 9:31 am on September 16, 2020: contributor
    Concept ACK: disambiguation is good
  14. amitiuttarwar commented at 8:14 pm on September 16, 2020: contributor

    I’m definitely in favor of fixing the documentation- thanks :)

    I’m not entirely convinced about the rename. I understand how its confusing with the context of terminology presented in the paper, but from a codebase perspective it doesn’t feel super different to say “probes have two functions” vs “feelers have two functions”. If the goal of the rename to disambiguate, why not separate the two? ( but personally I’d find the added docs sufficient )

  15. naumenkogs commented at 6:57 am on September 17, 2020: member

    it doesn’t feel super different to say “probes have two functions” vs “feelers have two functions”.

    “feelers have two functions” is incorrect because the paper which is often referred to (and introduced them) says that feelers have 1 function.

    Also, just by meaning, imo “feeler” well describes the first feature and not the second.

    why not separate the two?

    You suggesting having 2 ConnTypes? I don’t see a problem with having PROBE allowing both features, let’s just not call them feelers, as per above. If we have 2 ConnTypes, it will be if (feeler || test_before_evict) do {} everywhere except one place :)

  16. laanwj commented at 9:13 am on September 17, 2020: member

    If the goal of the rename to disambiguate, why not separate the two?

    Agree here, I think as long as the same concept is used, and documented, consistently, it’s good. You could, for example, add a note in a comment that it’s referred to differently in the paper. Splitting the ConnTypes into more specific cases would also be acceptable, if it clarifies things.

    A wholesale search/replace over the source code is not the kind of change we usually merge. For example it causes conflicts with other PRs that make more significant changes.

  17. in src/net.cpp:1915 in 7a8dbdf412 outdated
    1918-            conn_type = ConnectionType::FEELER;
    1919-            fFeeler = true;
    1920+        } else if (nTime > next_probe_time) {
    1921+            next_probe_time = PoissonNextSend(nTime, PROBE_INTERVAL);
    1922+            conn_type = ConnectionType::PROBE;
    1923+            make_probe = true;
    


    ariard commented at 10:47 pm on September 17, 2020:
    I’ve already made the point elsewhere that it would be better to use IsProbeConn() here. We can’t right now because type asserting methods are part of CNode not ConnectionType but maybe we could move them there and make CConnman a friend class ? Just saying if you have room somewhere on one of your PRs :)
  18. ariard commented at 11:21 pm on September 17, 2020: member

    I think this is confusing for now to have a connection type bearing both the name of a first function and also executing a second different function. It would be better to move towards the paper as these connection strategies design goals are clearly explained there. I’m fine with the current renaming as a way to dissociate ambiguity.

    Note, introducing yet another connection type (ConnectionType::TEST_COLLISION) would work too but I fear the proliferation of connection types in the near-term (like anchors, negotiated-block-relay-only, …) might hinder the code clarification improvement from the connection refactor.

  19. in src/net.h:146 in 7a8dbdf412 outdated
    142@@ -143,12 +143,18 @@ enum class ConnectionType {
    143     MANUAL,
    144 
    145     /**
    146-     * Feeler connections are short lived connections used to increase the
    147-     * number of connectable addresses in our AddrMan. Approximately every
    148-     * FEELER_INTERVAL, we attempt to connect to a random address from the new
    149-     * table. If successful, we add it to the tried table.
    150+     * Probe connections are short lived connections made to check that a node
    


    jonatack commented at 7:55 am on September 18, 2020:

    In 7a8dbdf412aa7a9676f2efeab246c143 “Improve docs about probe connections”, a few nit fixups

    • s/short lived/short-lived/

    • s/It can be useful to/They can be useful for/

    • s/feelers/feeler connections/

  20. jonatack commented at 8:20 am on September 18, 2020: member

    ACK 7a8dbdf412aa7a9676f2efeab246c143a74bae6f

    I think this is an improvement on its own, and separating them into two connection types might be a further improvement for observing and testing them.

  21. EthanHeilman commented at 7:19 pm on September 18, 2020: contributor

    I don’t have a strong opinion on renaming feeler to probe. I just to provide some background on why I decided to reuse feeler connections for test-before-evict.

    1. Avoid additional locks or complexity by adding a thread or events for test-before-evict. I believe my original design required adding a lock and I was paranoid about causing deadlocks.

    2. I wanted a single place to rate limit “helper” connections and their buffers. A feeler connection can attempt to push something from new to tried which is might trigger test-before-evict probe connection. Having them share the same fixed size buffer limits the number of connections they both can make.

    3. Reduce the diff by not having separate mechanisms and variables for each case since they are basically doing the same thing. In some sense we just want a generic probe service that other features can use to probe addrs and to see if they are online.

  22. DrahtBot commented at 1:31 pm on September 19, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #19869 (Better intervals between feelers by naumenkogs)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  23. naumenkogs force-pushed on Sep 23, 2020
  24. naumenkogs commented at 7:20 am on September 23, 2020: member

    Since there was a significant hesitation to renaming enums, and even more hesitation to splitting the enums into two, I’d just take the least intrusive approach: just improve the documentation.

    We can make those other clarifications later, although keep in mind it’s better be done before exposing conn-types in RPC. So if you strongly want to see those changes, please let us know (maybe once again?).

  25. naumenkogs force-pushed on Sep 23, 2020
  26. naumenkogs renamed this:
    Rename feelers to probes
    p2p: Better document feelers' features
    on Sep 23, 2020
  27. naumenkogs renamed this:
    p2p: Better document feelers' features
    p2p: Better document features of feelers
    on Sep 23, 2020
  28. Improve docs about feeler connections 2ea62cae48
  29. in src/net.cpp:1787 in ed737a944f outdated
    1783@@ -1784,7 +1784,7 @@ void CConnman::SetTryNewOutboundPeer(bool flag)
    1784 
    1785 // Return the number of peers we have over our outbound connection limit
    1786 // Exclude peers that are marked for disconnect, or are going to be
    1787-// disconnected soon (eg one-shots and feelers)
    1788+// disconnected soon (eg ADDR_FETCH and PROBE)
    


    amitiuttarwar commented at 4:33 am on September 24, 2020:
    looks like PROBE is leftover here
  30. naumenkogs force-pushed on Sep 24, 2020
  31. practicalswift commented at 6:01 am on September 24, 2020: contributor
    ACK 2ea62cae483b764e30f61c06d8ac65755bbd864c
  32. naumenkogs closed this on Sep 24, 2020

  33. naumenkogs reopened this on Sep 24, 2020

  34. naumenkogs renamed this:
    p2p: Better document features of feelers
    doc, p2p: Better document features of feelers
    on Sep 24, 2020
  35. naumenkogs renamed this:
    doc, p2p: Better document features of feelers
    doc: Better document features of feelers
    on Sep 24, 2020
  36. amitiuttarwar commented at 4:39 pm on September 24, 2020: contributor
    ACK 2ea62cae48. thank you!
  37. EthanHeilman approved
  38. EthanHeilman commented at 1:40 am on September 25, 2020: contributor
    This change does a better job explaining feeler connections
  39. fanquake commented at 12:40 pm on September 29, 2020: member
    @sdaftuar do you have an opinion here?
  40. sdaftuar commented at 3:54 pm on September 29, 2020: member
    utACK, looks good to me.
  41. fanquake merged this on Sep 30, 2020
  42. fanquake closed this on Sep 30, 2020

  43. sidhujag referenced this in commit 4b8bf32203 on Sep 30, 2020
  44. Fabcien referenced this in commit a1ea07026f on Nov 2, 2021
  45. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me