summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2023-07-18 11:56:49 -0400
committerPatrick Cloke <patrickc@matrix.org>2023-07-18 11:56:49 -0400
commit36cd55f6a09e609318b4c5e6d176c7e0bf91e6d3 (patch)
treed909d8f06db6c17a15c51817f31a0727d67a9210
parentDo not return depth. (diff)
downloadsynapse-36cd55f6a09e609318b4c5e6d176c7e0bf91e6d3.tar.xz
Sort auth/state.
-rw-r--r--synapse/federation/federation_server.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index 69beeb95db..2a8b177162 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -772,6 +772,14 @@ class FederationServer(FederationBase):
         auth_chain_events = await self.store.get_events_as_list(auth_chain_event_ids)
         state_events = await self.store.get_events_as_list(state_event_ids)
 
+        # TODO(LM) eigen-server wants events in order.
+        auth_chain_events = sorted(
+            auth_chain_events, key=lambda e: e.internal_metadata.stream_ordering
+        )
+        state_events = sorted(
+            state_events, key=lambda e: e.internal_metadata.stream_ordering
+        )
+
         # we try to do all the async stuff before this point, so that time_now is as
         # accurate as possible.
         time_now = self._clock.time_msec()