matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
182 stars 94 forks source link

Server-Server API does not specify that sending servers need to be able to give `prev_events` for the events that they send #1228

Open reivilibre opened 2 years ago

reivilibre commented 2 years ago

Link to problem area: https://spec.matrix.org/v1.3/server-server-api/#checks-performed-on-receipt-of-a-pdu

Link to relevant Synapse code: https://github.com/matrix-org/synapse/blob/0bf180cbb43f6e3d489ddaa5d66226b6daeea027/synapse/handlers/federation_event.py#L307-L315

Issue

Synapse requires that a remote homeserver which is sending an event is able to produce, on demand, the prev_events for that event via /get_missing_events. This does not appear to be made clear in the specification, which I think could be troublesome for interoperability. It also just seems like something that is worth noting; particularly when looking to implement faster room joins, this is something that has come up.

turt2live commented 2 years ago

Is this actually a requirement, or is Synapse just doing it "wrong"?

reivilibre commented 1 year ago

When talking to @richvdh, he said that it's somewhat a fundamental tenet of Matrix but he doubts it's written down.

It's not entirely clear to me whether this is an absolutely hard requirement or it's just a side effect of the way Synapse tracks state. Suspect thinking this through is going to need more context than I have on me at the moment.

Since Synapse depends on it and it seems reasonable to expect a server to be able to access the prev_events of the events that it's generating, would this requirement be accepted as a spec clarification?