Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Use _check_sigs_and_hash_and_fetch to validate backfill requests #8350

Merged
merged 4 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8350.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Partially mitigate bug where newly joined servers couldn't get past events in a room when there is a malformed event.
8 changes: 3 additions & 5 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,9 @@ async def backfill(
for p in transaction_data["pdus"]
]

# FIXME: We should handle signature failures more gracefully.
pdus[:] = await make_deferred_yieldable(
defer.gatherResults(
self._check_sigs_and_hashes(room_version, pdus), consumeErrors=True,
).addErrback(unwrapFirstError)
# Check signatures and hash of pdus, removing any from the list that fail checks
pdus[:] = await self._check_sigs_and_hash_and_fetch(
dest, pdus, outlier=True, room_version=room_version
)

return pdus
Expand Down