Repository navigation
Conversation
…raining Diagnosis-only, no code change. The attached scratch doc walks the `message_decryption_failed INVALID_CIPHERTEXT` path from receive back to the OpenMLS error chain, enumerates the five variants that currently collapse to one opaque code at the app, and proposes four follow-on fix shapes (ordered by risk) with a decision tree for the next 2-phone session. Primary hypothesis: Tier 2 reseal advances the sender ratchet one generation per retry, and under lossy BLE with many concurrent in-flight frames the sender's generation spread exceeds the receiver's `SENDER_RATCHET_OUT_OF_ORDER_TOLERANCE = 32` window, surfacing as `SecretTreeError::TooDistantInThePast` wrapped into `MlsError::Decryption` and reported as `INVALID_CIPHERTEXT`. No `group_epoch_fork_detected` fires because the epoch is still agreed. Refs: https://linear.app/offlineprotocol/issue/OFF-3247
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Diagnosis-only PR. No code change. Attached scratch doc walks the
message_decryption_failed INVALID_CIPHERTEXTpath from the receive sideback to the OpenMLS error chain, enumerates the five underlying variants
that today collapse to one opaque code at the app, and proposes four
follow-on fix shapes (ordered by risk) with a decision tree for the next
2-phone session.
Primary hypothesis
Tier 2 reseal (
protocol/send.rs::reseal_resend_content) advances thesender's MLS encryption ratchet one generation on every retry. In the
observed federated-training session the sender has many messages in
flight concurrently and almost nothing is ACKing (45
message_deliveredacross ~45k
message_retryingand ~9kmessage_failed). Each faileddelivery becomes 5 reseal retries, each burning one more generation. The
sender's generation spread trivially exceeds the receiver's
SENDER_RATCHET_OUT_OF_ORDER_TOLERANCE = 32, so late/reordered framessurface at the receiver as
SecretTreeError::TooDistantInThePast, which the SDK wraps intoMlsError::Decryptionand reports to the app ascode: INVALID_CIPHERTEXT. Nogroup_epoch_fork_detectedfires becausethe epoch is still agreed.
That matches the shape of the real session: round 1 clean, round 2+
decays, iPhone -> Seeker (thin direction) stays up, Seeker -> iPhone
(gradient-chunk fan-out, heavy direction) collapses.
Secondary hypothesis (noted, not primary)
Welcome-wins race at session establishment also produces
INVALID_CIPHERTEXTwithout agroup_epoch_fork_detected. Discarded asprimary because it would show up as a burst at round 1 setup, not as
round 2+ decay after a clean round 1.
Proposed fix shapes
See the "Proposed fix shape" section of the doc. In order:
reasonfield (safe; library-constant strings only). Confirms whichof the five variants is firing before committing to a fix.
SENDER_RATCHET_OUT_OF_ORDER_TOLERANCE(32 -> 128/256).Both sides have to agree, so one SDK bump.
seal_epochonOutboxResealand skip reseal when thesession epoch is unchanged. Replay verbatim when safe; receiver's
dedup catches duplicate ids before OpenMLS sees them.
message_decryption_failedat the IM-app TrainingModulelistener (phone-side ticket, not SDK).
How to verify after a fix lands
Doc includes a grep key: specific OpenMLS error strings that would land
in the reason field once F1 lands, and which fix shape each one points
at.
Refs
Linear: https://linear.app/offlineprotocol/issue/OFF-3247