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

MSC4225: Specification of an order in which one-time-keys should be issued #4225

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Nov 6, 2024

@richvdh richvdh changed the title MSC4225: Specification of an order in which one-time-keys should be issued WIP: MSC4225: Specification of an order in which one-time-keys should be issued Nov 6, 2024
@turt2live turt2live added e2e proposal A matrix spec change proposal kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Nov 7, 2024
@richvdh richvdh marked this pull request as ready for review November 7, 2024 13:25
@richvdh richvdh removed the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Nov 7, 2024
@richvdh richvdh changed the title WIP: MSC4225: Specification of an order in which one-time-keys should be issued MSC4225: Specification of an order in which one-time-keys should be issued Nov 7, 2024
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only briefly read the MSC, but seems sane at the core

@turt2live turt2live added the matrix-2.0 Required for Matrix 2.0 label Nov 18, 2024
@turt2live
Copy link
Member

@mscbot fcp merge

@mscbot
Copy link
Collaborator

mscbot commented Nov 18, 2024

Team member @turt2live has proposed to merge this. The next step is review by the rest of the tagged people:

Once at least 75% of reviewers approve (and there are no outstanding concerns), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for information about what commands tagged team members can give me.

@mscbot mscbot added proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period. disposition-merge labels Nov 18, 2024
possible for a to-device message to be delayed so long that the recipient has
discarded the private part of the one-time key. It is, however, a significant
improvement. A possible future solution is for clients that expect to be used
in conditions of poor connectivity to keep old OTKs for longer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AIUI there's almost always going to be situations where the client receives a to-device message using an OTK it no longer has. Is there any mechanism to handle this situation, e.g. a reply asking the sender to retry?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not at the moment. We've had thoughts about that sort of thing. TBH though, I think it's pretty unlikely to happen once we fix the ordering problem, unless the sender literally goes offline for a year just after claiming the OTK.

2. [MSC4162](https://github.com/matrix-org/matrix-spec-proposals/pull/4162)
proposes a mechanism by which a client can inform the server that it is
discarding certain OTKs, so that the server can also remove the public
keys. This seems a heavier-weight solution to the problem.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of wondering whether clients should replace all OTKs on the server at once, rather than appending new ones to the list? That way whenever the client replaces all the OTKs its easier to then say "we can discard the previous batch of OTK private keys in N days".

Just an ideal non-blocking thought.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm... not really following how that would work/help.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the kind of idea I was toying with in my discussion: replacing the whole lot every time would have the effect of removing any keys that the device had deleted from the server. It's probably a similar conclusion to that conversation.

This presents a problem: there is a limit to the number of private one-time
keys that a client can retain. Over time, as keys are repeatedly claimed,
replaced with newly-generated keys, but not actually used, the client must
start to discard older keys.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOI how long do clients typically retain these keys?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libolm kept 100. Vodozemac keeps 5000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge e2e kind:core MSC which is critical to the protocol's success matrix-2.0 Required for Matrix 2.0 proposal A matrix spec change proposal proposed-final-comment-period Currently awaiting signoff of a majority of team members in order to enter the final comment period.
Projects
Status: Ready for FCP ticks
Development

Successfully merging this pull request may close these issues.

5 participants