Skip to content

bug: iroh uses invalid relay server as home relay #3308

@flub

Description

@flub

Describe the bug

When configuring iroh to use a RelayMap with only invalid RelayUrls iroh will
select an invalid relay server and advertise it as the home relay at
Endpoint::home_relay.

This is caused by

iroh/iroh/src/magicsock.rs

Lines 2968 to 2971 in 31895bf

if ni.preferred_relay.is_none() {
// Perhaps UDP is blocked. Pick a deterministic but arbitrary one.
ni.preferred_relay = self.pick_relay_fallback();
}

which sets a home relay regardless of the netcheck report.

Relevant Logs

Expected behavior

The home relay should probably only be set once a connection to the home relay is established.

Currently it is set based on the net-report, it should rather be set by the RelayActor whenever it manages to connect to the home relay. The net-report's preferred relay server should be a hint for the RelayActor to which relay server it should use as home relay.

See #3298 (reply in thread) for more background.

Platform(s)

all

Additional Context / Screenshots / GIFs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingc-iroh

    Type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions