Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thousands of to-device messages to cross-signing keys #15638

Closed
richvdh opened this issue Nov 2, 2020 · 2 comments
Closed

thousands of to-device messages to cross-signing keys #15638

richvdh opened this issue Nov 2, 2020 · 2 comments
Labels
A-E2EE P1 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Synapse

Comments

@richvdh
Copy link
Member

richvdh commented Nov 2, 2020

My server has accumulated hundreds of thousands of to-device messages to three particular device IDs:

synapse=# select count(*),device_id from device_inbox group by 2 order by 1 desc limit 3;
 count  |                  device_id                  
--------+---------------------------------------------
 263318 | 93fB6y9SJ3183h6zpYjImjRE8om8X01O7Xjl7UkcHeo
 263318 | 4CDFPgvgQryGrOAGLlscaauGQPLTLmlYKP/8VgLHzEo
 263318 | fTBqO/U1BB6rTBo+PEa3pExSx5bWVipFa8F1OhRyKrk

these turn out to be the public halves of master, self-signing and user-signing cross-signing keys, and they are mostly key-share requests (and subsequent cancellations). They are coming from both element-web and element-android.

Clearly nothing is ever going to read these messages. It's a shame that synapse accepts/keeps them (cf matrix-org/synapse#3656), but it also seems wasteful that element sends the requests.

@uhoreg
Copy link
Member

uhoreg commented Feb 8, 2021

Key share requests are usually sent to "*" in element, so I guess it's synapse expanding "*" to include the cross-signing "devices".

@anoadragon453
Copy link
Member

Indeed we are: https://github.com/matrix-org/synapse/blob/c7b823525e9598ee4de76099d9ca5ea1ce3977f4/synapse/storage/databases/main/deviceinbox.py#L486-L498

Adding a clause for hidden should prevent to_device messages from being added to devices which should not be visible.

So this isn't any client's fault after all, as * is intended to have messages sent only to visible devices. Thus closing this issue in favour of one for Synapse: matrix-org/synapse#9348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE P1 S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Synapse
Projects
None yet
Development

No branches or pull requests

5 participants