Skip to content

Restore the fork's persisted storage format on top of upstream main - #56

Merged
tylerhawkes merged 5 commits into
mainfrom
tyler/restore-fork-storage-format
Jul 22, 2026
Merged

tylerhawkes merged 5 commits into
mainfrom
tyler/restore-fork-storage-format

Conversation

@tylerhawkes

@tylerhawkes tylerhawkes commented Jul 22, 2026 •

Copy link
Copy Markdown

Replays the fork's persisted-storage divergence on top of the merged upstream main (#55), as four focused commits, plus a fifth commit replaying the open upstream security fix openmls#2125. #55 brought the code up to upstream; this PR makes the storage format read/write-compatible with what shipped fork releases (and the libxmtp versions pinned to them) actually persisted. libxmtp persists these structures with bincode — non-self-describing and positional — which drives every choice below.

Commits

1. Restore persisted storage_tag numbering on ExtensionType and Extension
The fork's ImmutableMetadata occupies tag 6, shifting Unknown/Grease/AppDataDictionary to 7/8/9 (Extension: 6/7/8). This matches the numbering every shipped fork release persisted. Declaration order is untouched — ImmutableMetadata stays declared last — so the 0-8-1-storage-format positional path keeps upstream's indices.

2. Add a fork storage-tag baseline to compat_tests
The fork's numbering can never match a published openmls crate, so a new suite pins it positively instead. Upstream's published-crate comparison for these two enums is re-gated to the positional compat_0_8_1* runs, where it still holds. A new fork-baseline feature covers AppDataDictionary's tag with extensions-draft on; test.sh runs it.

3. Encode PastEpochDeletionPolicy as a portable, bincode-safe u64
Upstream openmls#2051's #[serde(untagged)] deserializer requires Deserializer::deserialize_any, which bincode errors on — every group-config load fails at runtime. Upstream's tests miss it because they use serde_json. This restores the fork's encoding verbatim: plain u64, KeepAll = u64::MAX (not usize::MAX as u64, which differs on wasm32). The plain u64 is load-bearing twice over: it is also byte-identical to the pre-rename max_past_epochs: usize at the same struct position, so config data written by libxmtp 1.9/1.10 (openmls beb0884d, before this type existed) loads unchanged. A bincode round-trip test guards against regression to untagged.

4. Tolerantly deserialize fork-only trailing fields on persisted structs
Restores the fork's hand-written serde for MessageSecretsStore and MemberStagedCommitState. MessageSecrets.added_at is #[serde(skip)] and carried as trailing fields on the containing store, read tolerantly (EOF → absent → None) — #[serde(default)] cannot do this because bincode is positional and ignores it. Data written before the fields existed (openmls 0.7.x, libxmtp 1.9/1.10) still loads; the tails sit at the terminal position of their storage blobs, so a tolerant misread can never consume a sibling's bytes. New bincode tests cover the non-self-describing path — the existing storage-compatibility KAT uses serde_json and only exercises visit_map.

5. Enforce app_data_dictionary immutability for bare GroupContextExtensions proposals
Replay of open upstream PR openmls#2125. The dictionary-immutability check ran after the no-AppDataUpdate early return, so a commit carrying only a GroupContextExtensions proposal could rewrite the app_data_dictionary directly, bypassing the AppDataUpdate machinery. The check now runs ahead of the early return and triggers when either the current or the proposed required_capabilities contains AppDataUpdate — a sender can neither evade it by dropping AppDataUpdate in the same proposal nor slip past on the migrating commit. Drop at the upstream merge after openmls#2125 lands.

Compatibility

Written by Read by this branch
libxmtp 1.9/1.10 (openmls beb0884d: no added_at, max_past_epochs: usize) loads; added_at → None, max_past_epochs → MaxEpochs(n)
fork main pre-#55 (e125674) byte-identical encodings; loads unchanged
this branch round-trips

Verification

  • Full lib suite: 266 passed (default), 309 passed (extensions-draft), 0 failed
  • compat_tests/test.sh: all four variants green (compat_0_7_1, compat_0_8_1, compat_0_8_1_extensions, fork-baseline)
  • clippy clean (default and extensions-draft, all targets); cargo fmt --check clean
  • virtual-clients-draft and virtual-clients-draft,extensions-draft compile

🤖 Generated with Claude Code

Note

Replays the fork's persisted-storage divergence on top of the merged upstream main (#55), as four focused commits, plus a fifth commit replaying the open upstream security fix openmls#2125. #55 brought the code up to upstream; this PR makes the storage format read/write-compatible with what shipped fork releases (and the libxmtp versions pinned to them) actually persisted. libxmtp persists these structures with bincode — non-self-describing and positional — which drives every choice below.

Commits

1. Restore persisted storage_tag numbering on ExtensionType and Extension
The fork's ImmutableMetadata occupies tag 6, shifting Unknown/Grease/AppDataDictionary to 7/8/9 (Extension: 6/7/8). This matches the numbering every shipped fork release persisted. Declaration order is untouched — ImmutableMetadata stays declared last — so the 0-8-1-storage-format positional path keeps upstream's indices.

2. Add a fork storage-tag baseline to compat_tests
The fork's numbering can never match a published openmls crate, so a new suite pins it positively instead. Upstream's published-crate comparison for these two enums is re-gated to the positional compat_0_8_1* runs, where it still holds. A new fork-baseline feature covers AppDataDictionary's tag with extensions-draft on; test.sh runs it.

3. Encode PastEpochDeletionPolicy as a portable, bincode-safe u64
Upstream openmls#2051's #[serde(untagged)] deserializer requires Deserializer::deserialize_any, which bincode errors on — every group-config load fails at runtime. Upstream's tests miss it because they use serde_json. This restores the fork's encoding verbatim: plain u64, KeepAll = u64::MAX (not usize::MAX as u64, which differs on wasm32). The plain u64 is load-bearing twice over: it is also byte-identical to the pre-rename max_past_epochs: usize at the same struct position, so config data written by libxmtp 1.9/1.10 (openmls beb0884d, before this type existed) loads unchanged. A bincode round-trip test guards against regression to untagged.

4. Tolerantly deserialize fork-only trailing fields on persisted structs
Restores the fork's hand-written serde for MessageSecretsStore and MemberStagedCommitState. MessageSecrets.added_at is #[serde(skip)] and carried as trailing fields on the containing store, read tolerantly (EOF → absent → None) — #[serde(default)] cannot do this because bincode is positional and ignores it. Data written before the fields existed (openmls 0.7.x, libxmtp 1.9/1.10) still loads; the tails sit at the terminal position of their storage blobs, so a tolerant misread can never consume a sibling's bytes. New bincode tests cover the non-self-describing path — the existing storage-compatibility KAT uses serde_json and only exercises visit_map.

5. Enforce app_data_dictionary immutability for bare GroupContextExtensions proposals
Replay of open upstream PR openmls#2125. The dictionary-immutability check ran after the no-AppDataUpdate early return, so a commit carrying only a GroupContextExtensions proposal could rewrite the app_data_dictionary directly, bypassing the AppDataUpdate machinery. The check now runs ahead of the early return and triggers when either the current or the proposed required_capabilities contains AppDataUpdate — a sender can neither evade it by dropping AppDataUpdate in the same proposal nor slip past on the migrating commit. Drop at the upstream merge after openmls#2125 lands.

Compatibility

Written by Read by this branch
libxmtp 1.9/1.10 (openmls beb0884d: no added_at, max_past_epochs: usize) loads; added_at → None, max_past_epochs → MaxEpochs(n)
fork main pre-#55 (e125674) byte-identical encodings; loads unchanged
this branch round-trips

Verification

  • Full lib suite: 266 passed (default), 309 passed (extensions-draft), 0 failed
  • compat_tests/test.sh: all four variants green (compat_0_7_1, compat_0_8_1, compat_0_8_1_extensions, fork-baseline)
  • clippy clean (default and extensions-draft, all targets); cargo fmt --check clean
  • virtual-clients-draft and virtual-clients-draft,extensions-draft compile

🤖 Generated with Claude Code

Changes since #56 opened

  • Modified validation logic in PublicGroup.validate_app_data_update_proposals_and_group_context to reject commits when GroupContextExtensions proposal modifies app_data_dictionary if either current or proposed required_capabilities includes AppDataUpdate proposal type [d87680e]
  • Added test test_group_context_update_dictionary_without_app_data_update validating rejection of GroupContextExtensions proposal that modifies AppDataDictionary without AppDataUpdate proposals [d87680e]

The merge parked ImmutableMetadata at a free storage_tag (9 on ExtensionType,
8 on Extension) so it would compile without disturbing upstream's numbering.
Existing XMTP groups are persisted with ImmutableMetadata=6 shifting Unknown,
Grease and AppDataDictionary up by one. Restore that layout so the derived
serde impls emit the same bincode variant indices as the fork's old manual
impls (the derive passes storage_tag straight through as the serde
variant_index, so this is byte-identical to what is stored).
compat_0_7_1 serializes our ExtensionType/Extension via the storage_tag path
and compares against published openmls 0.7.1. The XMTP fork intentionally
diverges there (ImmutableMetadata=6 shifts Unknown/Grease/AppDataDictionary up
by one) so it can read groups persisted by older fork releases, so that
comparison can never hold. Keep the upstream data intact; gate the published
extension comparison to the positional (0-8-1-storage-format) build where fork
and upstream agree, and add a fork-owned baseline that positively pins the
fork's storage_tag numbering.
Upstream (openmls#2051) deserializes this policy through a #[serde(untagged)] enum,
which requires a self-describing format. libxmtp persists MlsGroupJoinConfig
through bincode (non-self-describing), where untagged deserialization fails at
runtime — so on the merged tree every group's config load would error. Upstream
does not hit this because its own storage backend uses serde_json.

Restore the fork's plain-u64 encoding: serialize KeepAll as u64::MAX (not the
platform-dependent usize::MAX, which is u32::MAX on wasm32) and deserialize a
plain u64, checking the sentinel before narrowing to usize. This is both
bincode-safe and portable across the 32/64-bit boundary. The pre-8bdba6f tagged
form is dropped: the fork only ever wrote the plain-integer form.
@macroscopeapp

macroscopeapp Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

This PR modifies persisted storage formats, serialization logic, and validation rules with significant runtime implications. All changed files are owned by openmls/maintainers, and there is an unresolved comment about potential timestamp loss during JSON deserialization. Human review is warranted.

You can customize Macroscope's approvability policy. Learn more.

@tylerhawkes
tylerhawkes force-pushed the tyler/restore-fork-storage-format branch from c5ac962 to 1c58e55 Compare July 22, 2026 22:03
Upstream carries several trailing fields with #[serde(default)], which bincode
ignores (it is positional), so 0.7.x-shape data that lacks the field hits EOF
and fails to load. Restore the fork's approach across the persisted types
libxmtp stores through bincode:

- MessageSecrets.added_at: skip on the struct (keeping it byte-identical to the
  upstream five-field shape, since MessageSecrets is not the last field of
  EpochTree) and carry it plus a parallel past_epoch_added_at array as trailing,
  EOF-tolerant fields on MessageSecretsStore, re-hydrated on deserialize.
- MemberStagedCommitState: hand-written serde reading application_export_tree
  (extensions-draft) and new_own_leaf_index (virtual-clients-draft) as trailing,
  EOF-tolerant fields in declaration order, so builds/data without a feature
  still round-trip. The #[cfg]-gated FIELDS entries keep bincode's field-count
  cap correct per feature combination.

Verified against libxmtp releases 1.9/1.10, whose pinned openmls has no added_at
field at all (pure five-field shape), so no 6-field inline data exists to read.
@tylerhawkes
tylerhawkes force-pushed the tyler/restore-fork-storage-format branch from 1c58e55 to 30f745f Compare July 22, 2026 22:07
…ons proposals

Replays open upstream PR openmls#2125: the dictionary-immutability
check ran after the no-AppDataUpdate early return, so a commit carrying only
a GroupContextExtensions proposal could rewrite the app_data_dictionary
directly, bypassing the AppDataUpdate machinery. Move the check ahead of the
early return and trigger it when either the current or the proposed
required_capabilities contains AppDataUpdate.

Drop at the upstream merge after openmls#2125 lands.
@tylerhawkes
tylerhawkes merged commit 3fabbf2 into main Jul 22, 2026
44 checks passed
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 22, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 22, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 23, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 23, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 24, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 25, 2026
…+ GCE dict-immutability fix

Moves the openmls pin from e125674 (the pre-merge fork line) to fork
main 3fabbf2, which carries the merged upstream (openmls/openmls
65396d8), the replayed fork storage format (xmtp/openmls#56), and the
GCE dict-immutability security fix (upstream openmls/openmls#2125,
replayed as #56's fifth commit).

Ripple effects absorbed here:

- extensions-draft-08 -> extensions-draft (upstream #2060 rename), and
  the 0x004D XWing ciphersuite is now behind
  draft-ietf-mls-pq-ciphersuites, so that feature is enabled.
- tls_codec 0.4.2 -> 0.5 to match openmls: trait impls on openmls types
  are version-specific. Encode side is byte-identical; the decode side
  gains strict length-boundary enforcement (rejects non-canonical
  encodings no conforming encoder produces) plus allocation hardening.
- xmtp/hpke-rs fork bumped to the libcrux series hpke-rs 0.7.0 uses so
  hax-lib unifies at 0.3.7 with the new openmls chain; libxmtp's direct
  hpke usage stays on the forked 0.6.1 API (0x004D welcome codepoint).
- App-data processing ported to upstream's redesigned flow:
  process_message now returns commits covering AppDataUpdate proposals
  as UnresolvedAppDataCommit; the wrapper interprets the (already
  reference-resolved) proposals and resumes staging via
  resolve_app_data_commit. The PAUSE-BEFORE-PARSE floor check moves to
  a pre-processing content_type() check (pause-only, so the
  unauthenticated signal is safe) with a staged-commit backstop.
- New ProcessedMessageContent variants handled: OwnPrivateMessage is a
  clean skip (replaces the opaque decryption error own fanned-back
  messages used to produce), OwnPendingCommit and
  UnresolvedAppDataCommit are defensive errors (unreachable under the
  pure-ciphertext wire policy / the resolving wrapper).
- Proposal::_AppAck arms dropped (variant removed upstream).
- cargo-deny: all seven openmls/libcrux advisory allowances removed
  (RUSTSEC-2026-0124, -0207..-0212) — this bump is the fix they were
  waiting on — plus stale RUSTSEC-2021-0139 (ansi_term left the graph).
tylerhawkes added a commit to xmtp/libxmtp that referenced this pull request Jul 25, 2026
…+ GCE dict-immutability fix (#3872)

Repins openmls from `e125674` (the pre-merge fork line) to fork main
`3fabbf2`: the merged upstream (openmls/openmls `65396d8`), the replayed
fork storage format (xmtp/openmls#56), and the GCE dict-immutability
security fix (upstream openmls/openmls#2125, carried as #56's fifth
commit). This supersedes the earlier revision of this PR, which pinned a
pre-merge branch carrying only the GCE fix.

## What the new pin buys

- **Persisted storage format restored on fork main** (xmtp/openmls#56):
storage tags, the bincode-safe `PastEpochDeletionPolicy` encoding, and
tolerant trailing-field deserialization — data written by libxmtp
1.9/1.10 (pre-`added_at`, `max_past_epochs`) and 1.11-dev loads
unchanged. Guarded by bincode round-trip and EOF-tolerance tests
fork-side.
- **GCE dict-immutability**: a bare `GroupContextExtensions` proposal
can no longer rewrite `app_data_dictionary` directly.
- **cargo-deny cleanup**: all seven openmls/libcrux advisory allowances
removed (RUSTSEC-2026-0124, -0207 through -0212 — this bump is the fix
they were waiting on), plus stale RUSTSEC-2021-0139 (`ansi_term` left
the dependency graph). `cargo deny check advisories` passes.

## Ripple effects absorbed

- **Feature renames**: `extensions-draft-08` → `extensions-draft`
(upstream #2060); the 0x004D XWing ciphersuite moved behind
`draft-ietf-mls-pq-ciphersuites`, now enabled.
- **tls_codec 0.4.2 → 0.5** to match openmls (trait impls on openmls
types are version-specific). Encode side is byte-identical; decode side
gains strict length-boundary enforcement — it rejects only non-canonical
encodings that no conforming encoder produces — plus allocation/overflow
hardening. The hpke-rs 0.6.1 fork keeps its own 0.4.2 internally; the
versions never exchange types.
- **xmtp/hpke-rs fork libcrux bump**: the fork's libcrux deps move to
the series upstream hpke-rs 0.7.0 uses, so `hax-lib` unifies at 0.3.7
with the new openmls chain. The forked 0.6.1 API (and the 0x004D
obsolete-XWing welcome codepoint for 1.9/1.10 wire compat) is unchanged;
all 9 XWing draft-06 suites pass fork-side.
- **App-data processing ported to upstream's redesigned flow**:
`unprotect_message` + `process_unverified_message_with_app_data_updates`
are gone; `process_message` now returns commits covering `AppDataUpdate`
proposals as `UnresolvedAppDataCommit`, and the wrapper interprets the
(already reference-resolved) proposals and resumes staging via
`resolve_app_data_commit`. The PAUSE-BEFORE-PARSE floor check moves
ahead of processing, keyed off the framing `content_type()` — safe
because the check only ever pauses a group whose committed floor already
exceeds this client — with a staged-commit backstop. The manual
by-reference proposal resolution block is deleted (upstream resolves
references itself).
- **New `ProcessedMessageContent` variants**: `OwnPrivateMessage` (own
fanned-back message with no matching intent) is a clean skip that still
advances the cursor — replacing the opaque decryption error it used to
produce; `OwnPendingCommit` and `UnresolvedAppDataCommit` are defensive
errors (the former is unreachable under our pure-ciphertext wire policy,
the latter never escapes the wrapper).
- `Proposal::_AppAck` match arms dropped (variant removed upstream);
`non_retryable_error_increments_cursor` renamed to
`own_message_without_intent_skips_and_increments_cursor` to match the
typed skip it now exercises.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants