Skip to content

enhancement: include non public relay addresses to be advertised too #3361 #3365

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

shoriwe
Copy link

@shoriwe shoriwe commented Aug 9, 2025

Reference

#3361

What is the issue

Private based relays are unable to populate the Reservation.Addrs when non of its addresses are public.

Expected behavior.

Permit the relay to respond with all its public addresses which is already filtered with the following line:

if !manet.IsPublicAddr(addr) {

But also include those addresses shared with the connected peer. This could be performed by comparing stream.Conn().RemoteMultiaddr() and stream.Conn().LocalMultiaddr().

Even so, what about including all of its addresses with filtering? Is there any security consideration. Because they could anyway be guessed based on the statements of bellow.

Why this is a issue

A valid circuit multiaddress can be successfully constructed and used based on the known addresses found on the AddrInfo of the connected peer. The problem is, then why we even care of Reservation.Addrs if that is possible this field is latency in the packet. We need to enforce the use of Reservation.Addrs by including information that can be actually used by the relay client.

…maintain the original filtering but with other option to include custom addresses in the reservation
Comment on lines +29 to +47
// Can be called multiple times
func WithRelaySubnets(prefixes ...netip.Prefix) (option Option) {
return func(r *Relay) (err error) {
r.publicSubnets = append(r.publicSubnets, prefixes...)
return nil
}
}

// If the relay has statically assigned addresses that it can advertise
// It can specify those addresses directly here.
// This is useful when we already know our address and we want to directly specify it
// /ip4/192.168.0.10/...
func WithRelayAddresses(addresses ...multiaddr.Multiaddr) (option Option) {
return func(r *Relay) (err error) {
r.publicAddresses = append(r.publicAddresses, addresses...)
return nil
}
}

Copy link
Author

Choose a reason for hiding this comment

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

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.

1 participant