It is impossible to switch off binding for Tor #22726

issue vasild openend this issue on August 17, 2021
  1. vasild commented at 1:33 pm on August 17, 2021: contributor

    Bitcoin Core, by default, would bind to 127.0.0.1:8334 and treat incoming connections on that port as coming from the Tor network. It is not possible to disable that extra bind - only to change it to another address:port with the -bind=...=onion option.

    Expected behavior

    It must be possible to disable the extra bind if it is not needed.

    A workaround is to specify an address:port to which the bind fails, e.g. -bind=1.1.1.1:1=onion. The bind error is logged and ignored. Another workaround is to use -listen=0, but that prevents normal -bind=....

  2. vasild added the label Bug on Aug 17, 2021
  3. hebasto commented at 1:49 pm on August 17, 2021: member
  4. vasild commented at 2:14 pm on August 17, 2021: contributor

    Also #22668 (comment)

    Using -bind=127.0.0.1:8333 -bind=127.0.0.1:8333=onion is a special case of specifying an address:port to which the bind fails (e.g. the onion bind will fail because we have already bound to that port due to -bind). It prints these bizarre messages:

    02021-08-17T14:11:47Z Bound to 127.0.0.1:8333
    12021-08-17T14:11:47Z Unable to bind to 127.0.0.1:8333 on this computer. Bitcoin Core is probably already running.
    
  5. vasild referenced this in commit 1597069982 on Aug 17, 2021
  6. vasild referenced this in commit ceeb317cde on Sep 16, 2021
  7. bitcoin deleted a comment on May 7, 2022
  8. laanwj added the label P2P on May 9, 2022
  9. laanwj commented at 10:50 am on May 9, 2022: member
    -listenonion=0 should disable the bind for onion (as it would never be used anyway), but seems right now it doesn’t.
  10. vasild commented at 3:34 pm on May 9, 2022: contributor

    If -listenonion=0 disables the bind for onion, then this would brick any statically configured Tor services (in torrc).

    The name listenonion is confusing IMO, because it instructs us to automatically create the Tor service via Tor control. We could still be listening on the Tor network if the service is configured in the Tor daemon itself (torrc) and in this case listenonion=0. Maybe -autotorservice is a better name…

  11. laanwj commented at 4:27 pm on May 9, 2022: member
    IMO if you’re statically confguring Tor, you might as well statically configure the Tor bind (in bitcoin’s configuration). The automatic Tor bind is there for automatic Tor configuration.
  12. vasild commented at 6:41 am on May 10, 2022: contributor

    What do you mean by static and automatic Tor bind in bitcoin’s configuration? Right now there is just one type of bind that is done at startup with a default value of 127.0.0.1:8334. The user can change the default value but cannot switch that binding off.

    Do you mean to allow switching off by using listenonion=0 and not using bind=...=onion?

  13. vasild referenced this in commit 0739037d4c on Jun 13, 2022
  14. vasild referenced this in commit cbf17a463a on Oct 25, 2022
  15. vasild referenced this in commit f349830c28 on Aug 16, 2023
  16. vasild referenced this in commit 5f5ec7daf3 on Jan 18, 2024
  17. vasild referenced this in commit b79569b7c4 on Jun 1, 2024
  18. vasild referenced this in commit c365c0bc92 on Jun 1, 2024
  19. vasild referenced this in commit 2ad152ab34 on Jul 1, 2024
  20. vasild referenced this in commit 9a7e5f4d68 on Jul 2, 2024
  21. achow101 closed this on Jul 16, 2024

  22. achow101 referenced this in commit 45750f61d6 on Jul 16, 2024

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

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