Addrman only contains seed nodes when there’s no externally bound address #7098

issue theuni openend this issue on November 25, 2015
  1. theuni commented at 9:40 pm on November 25, 2015: member

    This seems really nasty.

    ipv4/ipv6 are not set as reachable by default. We only end up setting them to reachable if we’ve discovered an external address. This is extra worrisome now that upnp discovery is off by default.

    The result is that addrman only ever contains dns seeds and possibly static seeds in many common use-cases.

    Possible fixes:

    • Always set ipv4 to reachable. In practice we treat it this way anyway.
    • Set ipv4/ipv6 reachable once bound, regardless of whether it’s routable.
    • Set ipv4/ipv6 to reachable once a respective connection attempt succeeds.
  2. theuni renamed this:
    Addrman only contains seed nodes when there's externally bound address
    Addrman only contains seed nodes when there's no externally bound address
    on Nov 26, 2015
  3. laanwj added the label P2P on Nov 27, 2015
  4. laanwj commented at 9:38 am on November 27, 2015: member

    Always set ipv4 to reachable. In practice we treat it this way anyway.

    Yes, determining connectivity is a difficult problem in general. I remember libevent has some code for ‘guessing’ if it’s on ipv4/ipv6 network by looking at OS-specific things like interfaces, and it’s not pretty, and it gets things wrong sometimes.

    (if you make any default assumptions, don’t forget honoring -onlynet, it can disallow connecting over specific networks)

    Set ipv4/ipv6 reachable once bound, regardless of whether it’s routable.

    I don’t think binding should influence it - reachable for outgoing connections is something else than reachable for incoming connections. Thinking of it, I have a similar issue with Tor/Onion, where being reachable on an .onion is interpreted as being able to connect to onions.

    We don’t do so at the moment, but ideally we’d distinguish between ‘we are reachable on X’ and ‘we can reach out on X’.

    Set ipv4/ipv6 to reachable once a respective connection attempt succeeds.

    That’s seems too late :) A failed connection attempt tells us nothing, only a succesful one does, so this is equivalent to “just assume connectivity exists if there’s an interface”.

  5. laanwj commented at 9:51 am on November 27, 2015: member
    Also, doing this determination once at startup is not really correct either. Networking status can very well change during runtime. (see e.g. #6030)
  6. pstratem commented at 9:58 am on November 27, 2015: contributor
    @laanwj indeed, we really dont know whether we have netgroup connectivity (except for tor)
  7. adamjonas commented at 2:42 pm on December 16, 2020: member
    Based on the discussion, this looks to have been closed by #7553.
  8. MarcoFalke commented at 2:49 pm on December 16, 2020: member
    Is this still an issue with a recent version of Bitcoin Core? If yes, what are the steps to reproduce?
  9. MarcoFalke closed this on Dec 16, 2020

  10. 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 18:12 UTC

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