Part of https://github.com/matrix-org/matrix-doc/issues/857 Reference: d69decd5c7/synapse/federation/transport/server.py (L543-L557)
d69decd5c7/synapse/federation/transport/server.py (L543-L557)