This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Faster joins: only choose locally-created events as prev_events
when sending events into a partial-state room.
#14105
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.
Fixes #14057. Part of #12997.
The idea and rationale is given in #14057, but I'll re-iterate a bit:
Remote homeservers have 'the right' to ask us for the
prev_events
of any events that we create and send out to them.As a partially-resident server, we can't track the set of servers in the room and so we don't know whether we're able to divulge any given event to another remote homeserver.
In the response to
/send_join
when we start our partial join, we receive a list of servers currently in the room at the point of our join event. This join event is therefore safe to divulge to the given list of homeservers, or if it isn't, that's equivalent to the resident homeserver being malicious or buggy and divulging events improperly itself.We aren't violating any other servers' privacy by divulging our own events (and we know which servers are involved; though communicating that to the user is a separate problem).
If we persist our events in a 'chain' off from that join event, we never enter a situation where we need to divulge a
prev_event
which is another servers' event.In practice, we may technically not have a chain but instead a DAG of events.
So, we:
prev_events
for use in a partial-state room;get_prev_events
is used.