feat: send messages to 5 relays instead of the newest 3 ones - #8501
Merged
Conversation
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
force-pushed
the
link2xt/same-transport-limit
branch
from
July 31, 2026 06:01
dd0039f to
3233a00
Compare
Hocuri
approved these changes
Jul 31, 2026
link2xt
force-pushed
the
link2xt/same-transport-limit
branch
2 times, most recently
from
August 1, 2026 00:56
6e22966 to
061946b
Compare
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
force-pushed
the
link2xt/same-transport-limit
branch
from
August 1, 2026 01:14
061946b to
13a19ad
Compare
Collaborator
Author
|
Added a test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_timestampfrom
get_all_self_addrs()in the future.