Skip to content

Phase 2: d14n service restructuring — remove deprecated services and RPCs #329

Description

@neekolas

Summary

Complete the d14n service restructuring by removing all deprecated RPCs and services introduced in Phase 1 (#328). This is the breaking-change phase — it should only land after all consumers have migrated to the new service endpoints.

Parent issue: #327

Prerequisites

Before this work begins, the following must be true:

  • All nodes use ReplicationApi.SubscribeOriginators instead of SubscribeEnvelopes
  • All clients use QueryApi for queries/subscriptions instead of ReplicationApi
  • All gateways use PublishApi.PublishPayerEnvelopes instead of ReplicationApi.PublishPayerEnvelopes
  • All clients use gateway_api.GatewayApi instead of payer_api.PayerApi
  • Node auth token enforcement is ready for ReplicationApi

Scope

All changes are within proto/xmtpv4/.

1. Remove deprecated RPCs from ReplicationApi

File: proto/xmtpv4/message_api/message_api.proto

Remove the following deprecated RPCs from the ReplicationApi service:

  • SubscribeEnvelopes
  • SubscribeTopics
  • QueryEnvelopes
  • PublishPayerEnvelopes
  • GetInboxIds
  • GetNewestEnvelope

After removal, ReplicationApi should contain only:

service ReplicationApi {
  rpc SubscribeOriginators(SubscribeOriginatorsRequest)
      returns (stream SubscribeOriginatorsResponse) {}
}

2. Clean up orphaned message types

After removing the deprecated RPCs, evaluate whether the following message types are still needed in message_api.proto (they may only be referenced by the new service files via import):

  • EnvelopesQuery — used by SubscribeEnvelopesRequest and QueryEnvelopesRequest
  • SubscribeEnvelopesRequest / SubscribeEnvelopesResponse — used by deprecated SubscribeEnvelopes and NotificationApi

Keep any types still referenced by QueryApi, PublishApi, or NotificationApi. Remove types that are no longer imported by any service.

3. Delete payer_api package

Delete: proto/xmtpv4/payer_api/payer_api.proto (and directory)

Prerequisite: gateway_api.GatewayApi currently imports message types from payer_api. Before deletion:

  1. Move PublishClientEnvelopesRequest, PublishClientEnvelopesResponse, GetNodesRequest, GetNodesResponse into proto/xmtpv4/gateway_api/gateway_api.proto
  2. Update GatewayApi RPC signatures to reference the local types
  3. Remove the payer_api import

4. Update buf.yaml

  • Remove any RPC_REQUEST_RESPONSE_UNIQUE ignore entries for files that no longer have shared types after deprecated RPCs are removed
  • Remove any RPC_RESPONSE_STANDARD_NAME ignore entries that are no longer needed
  • Verify buf lint is clean (or only has pre-existing warnings unrelated to xmtpv4)

5. Enforce ReplicationApi auth (proto-side, if applicable)

If node auth token enforcement requires proto-level changes (e.g., metadata annotations or interceptor configuration), add them to ReplicationApi. Otherwise, this is a server-side concern only and can be skipped in the proto repo.

Verification

cd proto && buf lint && buf build
cd proto && buf breaking --against '.git#subdir=proto'  # expect breaking changes
grep -r "payer_api" proto/  # should return no results

The buf breaking check will flag breaking changes (removed RPCs, deleted package). This is intentional and expected.

Out of scope

  • Server-side implementation changes
  • Client SDK migration
  • Changes to metadata_api, misbehavior_api, or envelopes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions