net: Add Tor extended SOCKS5 error codes #32200

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2025-03-tor-extended-error-codes changing 1 files +35 −11
  1. laanwj commented at 10:52 am on April 2, 2025: member

    Add support for reporting Tor extended SOCKS5 error codes as defined here:

    These give a more direct indication of the problem in case of errors connecting to hidden services, for example:

    02025-04-02T10:34:13Z [net] Socks5() connect to [elided].onion:8333 failed: onion service descriptor can not be found
    

    In the C Tor implementation, to get these one should set the “ExtendedErrors” flag on the “SocksPort” definition, introduced in version 0.4.3.1.

    In Arti, extended error codes are always enabled.

    Also, report the raw error code in case of unknown reply values.

  2. net: Add Tor extended SOCKS5 error codes
    Add support for reporting Tor extended SOCKS5 error codes as defined
    here:
    
    - https://spec.torproject.org/socks-extensions.html#extended-error-codes
    - https://gitlab.torproject.org/tpo/core/arti/-/blob/main/crates/tor-socksproto/src/msg.rs?ref_type=heads#L183
    
    These give a more direct indication of the problem in case of errors
    connecting to hidden services, for example:
    ```
    2025-04-02T10:34:13Z [net] Socks5() connect to [elided].onion:8333 failed: onion service descriptor can not be found
    ```
    
    In the C Tor implementation, to get these one should set the
    "ExtendedErrors" flag on the "SocksPort" definition, introduced in
    version 0.4.3.1.
    
    In Arti, extended error codes are always enabled.
    
    Also, report the raw error code in case of unknown reply values.
    b639417b39
  3. laanwj added the label P2P on Apr 2, 2025
  4. DrahtBot commented at 10:52 am on April 2, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32200.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK 1440000bytes, w0xlt, pablomartin4btc

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  5. pablomartin4btc commented at 1:15 pm on April 3, 2025: member

    utACK b639417b39cced5223953fca65cdcd5d84475127

    (verified that the codes & error descriptions match specifications from the provided links)

  6. ryanofsky assigned ryanofsky on Apr 8, 2025
  7. ryanofsky merged this on Apr 8, 2025
  8. ryanofsky closed this on Apr 8, 2025


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: 2025-04-16 12:12 UTC

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