Skip to content

feat: send messages to 5 relays instead of the newest 3 ones - #8501

Merged
link2xt merged 1 commit into
mainfrom
link2xt/same-transport-limit
Aug 3, 2026
Merged

feat: send messages to 5 relays instead of the newest 3 ones#8501
link2xt merged 1 commit into
mainfrom
link2xt/same-transport-limit

Conversation

@link2xt

@link2xt link2xt commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Otherwise users may add up to 5 relays, but 2 oldest relays are actually ignored.

Having the maximum number of published relays
and the number of relays used the same between all clients makes the order of relays in the key irrelevant.
We may even remove sorting by add_timestamp
from get_all_self_addrs() in the future.

@link2xt

link2xt commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

This needs a test to make sure messages can actually be sent to 5 relays.

"3 relays" limit was chosen with the idea that if users add arbitrary number of relays to the keys and you are in a group, you will have to send messages to a lot of relays and "3 x member count" looked somewhat ok, but with automatic relay management most users will anyway have the number of relays determined by the number this automatic algorithm maintains, and with manual management most users likely have 1 relay only (and some users have 5 and would add all relays they find if they could, but this is rare).

@link2xt
link2xt force-pushed the link2xt/same-transport-limit branch 2 times, most recently from 6e22966 to 061946b Compare August 1, 2026 00:56
Otherwise users may add up to 5 relays, but 2 oldest relays
are actually ignored.

Having the maximum number of published relays
and the number of relays used the same between all clients
makes the order of relays in the key irrelevant.
We may even remove sorting by `add_timestamp`
from `get_all_self_addrs()` in the future.
@link2xt
link2xt force-pushed the link2xt/same-transport-limit branch from 061946b to 13a19ad Compare August 1, 2026 01:14
@link2xt

link2xt commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Added a test.

@link2xt
link2xt merged commit 2ac217d into main Aug 3, 2026
30 checks passed
@link2xt
link2xt deleted the link2xt/same-transport-limit branch August 3, 2026 14:04
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.

2 participants