Repository navigation
Restore the fork's persisted storage format on top of upstream main - #56
Merged
Merged
Conversation
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.
ApprovabilityVerdict: 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. |
insipx
approved these changes
Jul 22, 2026
tylerhawkes
force-pushed
the
tyler/restore-fork-storage-format
branch
from
July 22, 2026 22:03
c5ac962 to
1c58e55
Compare
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
force-pushed
the
tyler/restore-fork-storage-format
branch
from
July 22, 2026 22:07
1c58e55 to
30f745f
Compare
…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
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)
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.
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_tagnumbering onExtensionTypeandExtensionThe fork's
ImmutableMetadataoccupies tag 6, shiftingUnknown/Grease/AppDataDictionaryto 7/8/9 (Extension: 6/7/8). This matches the numbering every shipped fork release persisted. Declaration order is untouched —ImmutableMetadatastays declared last — so the0-8-1-storage-formatpositional path keeps upstream's indices.2. Add a fork storage-tag baseline to
compat_testsThe 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 newfork-baselinefeature coversAppDataDictionary's tag withextensions-drafton;test.shruns it.3. Encode
PastEpochDeletionPolicyas a portable, bincode-safeu64Upstream openmls#2051's
#[serde(untagged)]deserializer requiresDeserializer::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: plainu64,KeepAll=u64::MAX(notusize::MAX as u64, which differs on wasm32). The plainu64is load-bearing twice over: it is also byte-identical to the pre-renamemax_past_epochs: usizeat the same struct position, so config data written by libxmtp 1.9/1.10 (openmlsbeb0884d, before this type existed) loads unchanged. A bincode round-trip test guards against regression tountagged.4. Tolerantly deserialize fork-only trailing fields on persisted structs
Restores the fork's hand-written serde for
MessageSecretsStoreandMemberStagedCommitState.MessageSecrets.added_atis#[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 exercisesvisit_map.5. Enforce
app_data_dictionaryimmutability for bareGroupContextExtensionsproposalsReplay of open upstream PR openmls#2125. The dictionary-immutability check ran after the no-
AppDataUpdateearly return, so a commit carrying only aGroupContextExtensionsproposal could rewrite theapp_data_dictionarydirectly, bypassing theAppDataUpdatemachinery. The check now runs ahead of the early return and triggers when either the current or the proposedrequired_capabilitiescontainsAppDataUpdate— a sender can neither evade it by droppingAppDataUpdatein the same proposal nor slip past on the migrating commit. Drop at the upstream merge after openmls#2125 lands.Compatibility
beb0884d: noadded_at,max_past_epochs: usize)added_at→None,max_past_epochs→MaxEpochs(n)e125674)Verification
extensions-draft), 0 failedcompat_tests/test.sh: all four variants green (compat_0_7_1,compat_0_8_1,compat_0_8_1_extensions,fork-baseline)extensions-draft, all targets);cargo fmt --checkcleanvirtual-clients-draftandvirtual-clients-draft,extensions-draftcompile🤖 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_tagnumbering onExtensionTypeandExtensionThe fork's
ImmutableMetadataoccupies tag 6, shiftingUnknown/Grease/AppDataDictionaryto 7/8/9 (Extension: 6/7/8). This matches the numbering every shipped fork release persisted. Declaration order is untouched —ImmutableMetadatastays declared last — so the0-8-1-storage-formatpositional path keeps upstream's indices.2. Add a fork storage-tag baseline to
compat_testsThe 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 newfork-baselinefeature coversAppDataDictionary's tag withextensions-drafton;test.shruns it.3. Encode
PastEpochDeletionPolicyas a portable, bincode-safeu64Upstream openmls#2051's
#[serde(untagged)]deserializer requiresDeserializer::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: plainu64,KeepAll=u64::MAX(notusize::MAX as u64, which differs on wasm32). The plainu64is load-bearing twice over: it is also byte-identical to the pre-renamemax_past_epochs: usizeat the same struct position, so config data written by libxmtp 1.9/1.10 (openmlsbeb0884d, before this type existed) loads unchanged. A bincode round-trip test guards against regression tountagged.4. Tolerantly deserialize fork-only trailing fields on persisted structs
Restores the fork's hand-written serde for
MessageSecretsStoreandMemberStagedCommitState.MessageSecrets.added_atis#[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 exercisesvisit_map.5. Enforce
app_data_dictionaryimmutability for bareGroupContextExtensionsproposalsReplay of open upstream PR openmls#2125. The dictionary-immutability check ran after the no-
AppDataUpdateearly return, so a commit carrying only aGroupContextExtensionsproposal could rewrite theapp_data_dictionarydirectly, bypassing theAppDataUpdatemachinery. The check now runs ahead of the early return and triggers when either the current or the proposedrequired_capabilitiescontainsAppDataUpdate— a sender can neither evade it by droppingAppDataUpdatein the same proposal nor slip past on the migrating commit. Drop at the upstream merge after openmls#2125 lands.Compatibility
beb0884d: noadded_at,max_past_epochs: usize)added_at→None,max_past_epochs→MaxEpochs(n)e125674)Verification
extensions-draft), 0 failedcompat_tests/test.sh: all four variants green (compat_0_7_1,compat_0_8_1,compat_0_8_1_extensions,fork-baseline)extensions-draft, all targets);cargo fmt --checkcleanvirtual-clients-draftandvirtual-clients-draft,extensions-draftcompile🤖 Generated with Claude Code
Changes since #56 opened
PublicGroup.validate_app_data_update_proposals_and_group_contextto reject commits whenGroupContextExtensionsproposal modifiesapp_data_dictionaryif either current or proposedrequired_capabilitiesincludesAppDataUpdateproposal type [d87680e]test_group_context_update_dictionary_without_app_data_updatevalidating rejection ofGroupContextExtensionsproposal that modifiesAppDataDictionarywithoutAppDataUpdateproposals [d87680e]