Skip to content

XIP-81: align with shipped libxmtp - #137

Merged
tylerhawkes merged 4 commits into
tyler/xip-appdatafrom
tyler/xip-appdata-shipped-divergence
Jun 15, 2026
Merged

tylerhawkes merged 4 commits into
tyler/xip-appdatafrom
tyler/xip-appdata-shipped-divergence

Conversation

@tylerhawkes

@tylerhawkes tylerhawkes commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Updates XIP-81 to match what landed in libxmtp.

  • ComponentId layout: counting up from 0x8000, immutables counting down from 0xBFFF. Drops the permission-banded sub-ranges from the draft.
  • Permissions: per-component registry at 0x8000 replaces range defaults + PermissionOverrideMap.
  • Two-step bootstrap: legacy GCE version bump first, then the proposal-then-commit cutover. Old peers pause before legacy extensions get stripped.
  • MinimumSupportedProtocolVersion is itself a component (0x800A), so steady-state floor bumps work via AppDataUpdate.
  • Wire format: TLS codec throughout. ComponentId uses QUIC vlen; inbox-id-bearing components use the versioned InboxId TLS encoding.
  • EnableProposalsOptions { force, min_version } API surface.
  • Deferred from v1: BatchProposal (§4), KeyValue app-data API (§5), cross-group ComponentId allocator (§2.2.2), protocol-version readiness signaling (§3.1).

Note

Align XIP-81 spec with shipped libxmtp implementation

Updates xip-81-app-data-updates.md to match the state of the landed libxmtp implementation.

  • Replaces the permission-banded sub-range model with a contiguous range model (XMTP 0x8000–0xBFFF, Application 0xC000–0xFEFF, Reserved 0xFF00–0xFFFF) and a Component Registry at 0x8000 as the authoritative source for per-component permissions.
  • Hardcodes permission enforcement for 0x8000 (ComponentRegistry), 0x8001 (SuperAdminList), and 0x8002 (AdminList); all unregistered IDs deny by default.
  • Adds a pre-commit evaluation requirement: registry/admin changes and dependent writes cannot be authorized in the same commit (bootstrap excepted).
  • Overhauls migration to a two-step bootstrap: a legacy GCE version-floor bump (Step A), then a proposal-and-commit sequence to install AppDataDictionary and Propossal support (Step B).
  • Defers BatchProposal (Section 4) and the KeyValue application API (Section 5) from v1; marks single-component app_data at 0x8009 as the v1 shipped state.
📊 Macroscope summarized 8cec7b3. 1 file reviewed, 2 issues evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@macroscopeapp

macroscopeapp Bot commented May 20, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

1 blocking correctness issue found. Documentation-only changes to an XIP specification aligning it with shipped implementation. However, the author does not own this file (owned by @jhaaaa), and there is an unresolved review comment about an inconsistency in the validation algorithm description.

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

- Add explicit pre-commit evaluation rule (Section 2.4) and a matching
  security-considerations subsection. Permissions for every AppDataUpdate
  resolve against the pre-commit registry / admin lists; a commit cannot
  grant a permission and exercise it in the same commit. Bootstrap is the
  only exception and routes through a dedicated validator.
- Update Test Cases to use shipped ComponentIds (GroupName at 0x8004,
  SuperAdminList at 0x8001, ConversationType at 0xBFFF, reserved 0xFF50)
  and add tests for the pre-commit rule, unknown-component tolerance,
  steady-state floor bumps, and Step A pause behavior. Move BatchProposal
  and KeyValueDelta tests to a "deferred" list paired with their feature.
- Rationale: replace "Why range-based defaults with an override map" with
  "Why a per-component registry". Note BatchProposal deferral in the
  atomic-batching rationale.
- Security Considerations: drop the "ComponentId range model" framing,
  reference the registry directly, note pre-commit evaluation, drop the
  BatchProposal sub-operation paragraph.
- Backward Compatibility: BatchProposal subsection now notes deferral.
- Section 1.4 table: drop the BatchProposal exception (deferred); reword
  AppDataUpdate row from "proposed" to "shipped".
- Section 3.3 reference fix: "steps 2a-2d" -> "Step B".
- §2.2.1: "register-then-write" was wrongly said to fit in one commit;
  pre-commit evaluation forces split commits (or bootstrap path).
- §2.2.1: clarify that SUPER_ADMIN_LIST permission is enforced in code,
  not from the registry — registry just covers it for type dispatch.
- Rationale "Why one-time migration": drop the "only happens when all
  members support" claim; the shipped version-bump path pauses
  non-supporting peers instead of blocking the migration on them.
- Rationale "Application ComponentId registration alternatives":
  on-chain registry is deferred; v1 ships per-group explicit
  registration with duplicate-id rejection at register time.
- Test 8: spell out the two-proposer scenario so the pre-commit
  evaluation property is testable rather than ambiguous.
…nt handle

- Move pre-d14n migration support out of "Optional future work" and into
  the existing two-step bootstrap line — that mechanism is exactly what
  makes pre-d14n migrations safe (lower-version peers pause on Step A).
- §2.2.2 + Open Questions §5: add a brief note on a 32-byte stable
  identifier per application-range component, resolved by the SDK to the
  per-group 16-bit ComponentId. Lets multiple apps ship components
  without coordinating on the 16-bit namespace.
When receiving an `AppDataUpdate` proposal:

1. Verify the proposer is a current member of the group. All `AppDataUpdate` proposals MUST be rejected with `ActorNotMember` if the proposer is not a member, regardless of the target ComponentId or permission level.
1. Verify the proposer is a current member of the group. All `AppDataUpdate` proposals MUST be rejected with `ActorNotMember` if the proposer is not a member, regardless of the target ComponentId.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Medium XIPs/xip-81-app-data-updates.md:228

Step 7 only rejects Remove operations on immutable components when they are already present, but Section 2.2 states immutable components MUST be rejected unconditionally — including Remove on non-existent IDs. This creates an inconsistency: the validation algorithm allows removing a non-existent immutable ID, while the normative prose forbids it. Consider clarifying step 7 to reject all Remove operations on immutable ranges regardless of presence, or document that the prose overstates the requirement.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file XIPs/xip-81-app-data-updates.md around line 228:

Step 7 only rejects `Remove` operations on immutable components when they are already present, but Section 2.2 states immutable components MUST be rejected unconditionally — including `Remove` on non-existent IDs. This creates an inconsistency: the validation algorithm allows removing a non-existent immutable ID, while the normative prose forbids it. Consider clarifying step 7 to reject all `Remove` operations on immutable ranges regardless of presence, or document that the prose overstates the requirement.

@tylerhawkes
tylerhawkes merged commit b0e8475 into tyler/xip-appdata Jun 15, 2026
3 checks passed
@tylerhawkes
tylerhawkes deleted the tyler/xip-appdata-shipped-divergence branch June 15, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants