This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
Inform syncapi about holes in DAGs #1006
Labels
C-Roomserver
C-Sync-API
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
X-Needs-Discussion
We aren't really sure about this yet so let's talk about it some more
Problem context
Servers send other servers events. These events have
prev_events
. It's possible for a receiving server to be missing thoseprev_events
, creating a hole in the DAG (aka an outlier). In an attempt to fill this hole, there's the API/get_missing_events
which takes thelatest
event IDs and theearliest
event IDs and gives you events walking back fromlatest
and ignoring anything inearliest
(don't be conned into thinking it returns events "between" the two lists, it doesn't have to in the case of forks).In the happy case:
prev_events
we do not recognise./get_missing_events
and the returned events fill in the hole in the DAG.If we cannot obtain the
prev_events
, we can request the/state
of the room at the event and continue on.There are many bad cases:
prev_events
or the requesting server may not be allowed to see those events./state
which then lies about the entire room state.We can try to guard against lies by forcing the server who sent us the event to cough up the prev_events or else their transaction will be rejected.
In addition, the client needs to be informed of a new hole in the DAG, or else they will never hit
/messages
(and hence backfill) the hole, resulting in a gap in message history e.g due to lost connectivity on the server (this is exacerbated for p2p nodes). We need to send a limited sync to reset the client in this scenario.The text was updated successfully, but these errors were encountered: