diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 9d0ce9aa50e5ee0b399b4512b6b26cc119da9f5a..1b709e5e2480d3abf28c4165e903bd6da6242870 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -130,7 +130,9 @@ class FederationHandler(BaseHandler):
         if auth_chain:
             event_ids |= {e.event_id for e in auth_chain}
 
-        seen_ids = (yield self.store.have_events(event_ids)).keys()
+        seen_ids = set(
+            (yield self.store.have_events(event_ids)).keys()
+        )
 
         if state and auth_chain is not None:
             # If we have any state or auth_chain given to us by the replication