Skip to content

Allow up to five minutes for Tor onion-service PoW dials #1190

Description

@binarybaron

Problem

Makers with a high onion-service PoW requirement can take longer than 15 seconds to establish the underlying Tor stream.

authenticate_and_multiplex currently applies one 15-second connection-setup timeout to every address. That timer includes TorTransport::dial and Arti onion-service PoW, so libp2p can cancel a valid onion dial before Arti finishes the PoW and returns the stream.

Expected behavior

Apply an address-aware connection-setup timeout:

  • /onion3 outbound dials get up to 5 minutes, covering Tor establishment, PoW, and the libp2p upgrades.
  • Other outbound addresses retain the existing 15-second timeout.
  • Inbound authentication/multiplexing retains the existing 15-second timeout.

Arti should continue to enforce its own phase-specific hidden-service timeouts; the five-minute value is only the final upper bound for the complete onion connection attempt.

libp2p can race all known maker addresses within one dial attempt, so a working clearnet address may still win quickly while onion PoW continues independently.

Acceptance criteria

  • An onion dial remains active beyond 15 seconds and is bounded at 5 minutes.
  • Non-onion dials still time out after 15 seconds.
  • Arti errors and internal timeouts continue to propagate normally.
  • Add a regression test covering timeout selection for onion and non-onion multiaddresses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions