Skip to content

feat(request-response): configurable use of relayed connections#6501

Open
MatthiasvB wants to merge 1 commit into
libp2p:masterfrom
MatthiasvB:feat/make-usage-of-relayed-connections-configurable-in-request-response
Open

feat(request-response): configurable use of relayed connections#6501
MatthiasvB wants to merge 1 commit into
libp2p:masterfrom
MatthiasvB:feat/make-usage-of-relayed-connections-configurable-in-request-response

Conversation

@MatthiasvB

Copy link
Copy Markdown

Description

Add a config flag controlling whether outbound requests may be sent over relay connections. Defaults to enabled (current behaviour); when disabled, only direct connections are used, conserving relay bandwidth. Also filter relayed addresses via multiaddr::Protocol and tolerate the extended DialFailure fields.

Fixes #6238.

AI Assistance Disclosure

Tools used Github Copilot, Claude Code

Attestation (required):

  • I have read every line of this diff, understand what it does, and can explain it in review.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@dariusc93 dariusc93 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds more like a user-specific use-case, in which case wouldnt it make more sense to write a behaviour, wrapping around request-response to perform the filtering based on a specified configuration?

@MatthiasvB

Copy link
Copy Markdown
Author

This sounds more like a user-specific use-case, in which case wouldnt it make more sense to write a behaviour, wrapping around request-response to perform the filtering based on a specified configuration?

Interesting idea. I'm not deeply familiar with the rust-libp2p internals, so the feasibility of this I can't judge. My instinct would tell me that a wrapper around request-response would have a hard time modifying its internal behaviour. Could you give me a few pointers on the architectural decisions that might enable such a wrapper?

@MatthiasvB MatthiasvB force-pushed the feat/make-usage-of-relayed-connections-configurable-in-request-response branch 2 times, most recently from e83150e to e3d9efa Compare June 23, 2026 17:00
Add a config flag controlling whether outbound requests may be sent over relay
connections. Defaults to enabled (current behaviour); when disabled, only direct
connections are used, conserving relay bandwidth.

Promote is_relayed helper to core.
@MatthiasvB MatthiasvB force-pushed the feat/make-usage-of-relayed-connections-configurable-in-request-response branch from e3d9efa to e7249ec Compare June 23, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make usage of expensive (= relayed) connections in high level protocols such as request_response configurable

2 participants