Skip to content

Commit 5e53523

Browse files
authored
Merge pull request #202 from xmtp/rich/remove-unused
There is a bunch of defunct code on both client and server I want to clean up - this should be helpful for new hires, backwards-compatibility for the replication project, debugging, and auditability. Starting with the protos first
2 parents 832e0a6 + 486bb6a commit 5e53523

File tree

8 files changed

+18
-242
lines changed

8 files changed

+18
-242
lines changed

dev/kotlin/generate

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,4 @@ docker run --platform linux/x86_64 --rm -i -v${PWD}:/code xmtp/protoc-kotlin \
4848
mls/message_contents/group_metadata.proto \
4949
mls/message_contents/group_mutable_metadata.proto \
5050
mls/message_contents/content.proto \
51-
mls/message_contents/transcript_messages.proto \
52-
mls/message_contents/credential.proto \
53-
mls/message_contents/association.proto
51+
mls/message_contents/transcript_messages.proto

dev/ts/generate

-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ docker run --rm -i -v${PWD}:/code xmtp/protoc \
3939
message_contents/ecies.proto \
4040
mls/api/v1/mls.proto \
4141
mls/database/intents.proto \
42-
mls/message_contents/association.proto \
4342
mls/message_contents/content.proto \
44-
mls/message_contents/credential.proto \
4543
mls/message_contents/group_membership.proto \
4644
mls/message_contents/group_metadata.proto \
4745
mls/message_contents/group_mutable_metadata.proto \

proto/mls/api/v1/mls.proto

+3-89
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ package xmtp.mls.api.v1;
44

55
import "google/api/annotations.proto";
66
import "google/protobuf/empty.proto";
7-
import "message_contents/signature.proto";
87
import "protoc-gen-openapiv2/options/annotations.proto";
98

109
option go_package = "github.com/xmtp/proto/v3/go/mls/api/v1";
1110
option java_package = "org.xmtp.proto.mls.api.v1";
1211
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
1312
info: {
14-
title: "MlsApi";
15-
version: "1.0";
16-
};
13+
title: "MlsApi"
14+
version: "1.0"
15+
}
1716
};
1817

1918
// RPCs for the new MLS API
@@ -35,14 +34,6 @@ service MlsApi {
3534
};
3635
}
3736

38-
// Register a new installation, which would be validated before storage
39-
rpc RegisterInstallation(RegisterInstallationRequest) returns (RegisterInstallationResponse) {
40-
option (google.api.http) = {
41-
post: "/mls/v1/register-installation"
42-
body: "*"
43-
};
44-
}
45-
4637
// Upload a new KeyPackage, which would be validated before storage
4738
rpc UploadKeyPackage(UploadKeyPackageRequest) returns (google.protobuf.Empty) {
4839
option (google.api.http) = {
@@ -59,25 +50,6 @@ service MlsApi {
5950
};
6051
}
6152

62-
// Would delete all key packages associated with the installation and mark
63-
// the installation as having been revoked
64-
rpc RevokeInstallation(RevokeInstallationRequest) returns (google.protobuf.Empty) {
65-
option (google.api.http) = {
66-
post: "/mls/v1/revoke-installation"
67-
body: "*"
68-
};
69-
}
70-
71-
// Used to check for changes related to members of a group.
72-
// Would return an array of any new installations associated with the wallet
73-
// address, and any revocations that have happened.
74-
rpc GetIdentityUpdates(GetIdentityUpdatesRequest) returns (GetIdentityUpdatesResponse) {
75-
option (google.api.http) = {
76-
post: "/mls/v1/get-identity-updates"
77-
body: "*"
78-
};
79-
}
80-
8153
// Query stored group messages
8254
rpc QueryGroupMessages(QueryGroupMessagesRequest) returns (QueryGroupMessagesResponse) {
8355
option (google.api.http) = {
@@ -190,18 +162,6 @@ message KeyPackageUpload {
190162
bytes key_package_tls_serialized = 1;
191163
}
192164

193-
// Register a new installation
194-
message RegisterInstallationRequest {
195-
// The Key Package contains all information needed to register an installation
196-
KeyPackageUpload key_package = 1;
197-
bool is_inbox_id_credential= 2;
198-
}
199-
200-
// The response to a RegisterInstallationRequest
201-
message RegisterInstallationResponse {
202-
bytes installation_key = 1;
203-
}
204-
205165
// Upload a new key packages
206166
message UploadKeyPackageRequest {
207167
// An individual key package upload request
@@ -230,52 +190,6 @@ message FetchKeyPackagesResponse {
230190
repeated KeyPackage key_packages = 1;
231191
}
232192

233-
// Revoke an installation
234-
message RevokeInstallationRequest {
235-
bytes installation_key = 1;
236-
// All revocations must be validated with a wallet signature over the
237-
// installation_id being revoked (and some sort of standard prologue)
238-
xmtp.message_contents.Signature wallet_signature = 2;
239-
}
240-
241-
// Get all updates for an identity since the specified time
242-
message GetIdentityUpdatesRequest {
243-
repeated string account_addresses = 1;
244-
uint64 start_time_ns = 2;
245-
}
246-
247-
// Used to get any new or revoked installations for a list of wallet addresses
248-
message GetIdentityUpdatesResponse {
249-
// A new installation key was seen for the first time by the nodes
250-
message NewInstallationUpdate {
251-
bytes installation_key = 1;
252-
bytes credential_identity = 2;
253-
}
254-
255-
// An installation was revoked
256-
message RevokedInstallationUpdate {
257-
bytes installation_key = 1;
258-
}
259-
260-
// A wrapper for any update to the wallet
261-
message Update {
262-
uint64 timestamp_ns = 1;
263-
oneof kind {
264-
NewInstallationUpdate new_installation = 2;
265-
RevokedInstallationUpdate revoked_installation = 3;
266-
}
267-
}
268-
269-
// A wrapper for the updates for a single wallet
270-
message WalletUpdates {
271-
repeated Update updates = 1;
272-
}
273-
274-
// A list of updates (or empty objects if no changes) in the original order
275-
// of the request
276-
repeated WalletUpdates updates = 1;
277-
}
278-
279193
// Sort direction for queries
280194
enum SortDirection {
281195
SORT_DIRECTION_UNSPECIFIED = 0;

proto/mls/message_contents/association.proto

-54
This file was deleted.

proto/mls/message_contents/credential.proto

-31
This file was deleted.

proto/mls_validation/v1/service.proto

+12-59
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,19 @@ option go_package = "github.com/xmtp/proto/v3/go/mls_validation/v1";
99

1010
// RPCs for the new MLS API
1111
service ValidationApi {
12-
// Validates and parses a batch of key packages and returns relevant details
13-
rpc ValidateKeyPackages(ValidateKeyPackagesRequest) returns (ValidateKeyPackagesResponse) {}
14-
1512
// Validates and parses a group message and returns relevant details
1613
rpc ValidateGroupMessages(ValidateGroupMessagesRequest) returns (ValidateGroupMessagesResponse) {}
17-
14+
1815
// Gets the final association state for a batch of identity updates
1916
rpc GetAssociationState(GetAssociationStateRequest) returns (GetAssociationStateResponse) {}
20-
17+
2118
// Validates InboxID key packages and returns credential information for them, without checking
2219
// whether an InboxId <> InstallationPublicKey pair is really valid.
23-
rpc ValidateInboxIdKeyPackages(ValidateKeyPackagesRequest) returns (ValidateInboxIdKeyPackagesResponse) {}
24-
25-
// Validate an InboxID Key Package
26-
// need public key possibly
27-
rpc ValidateInboxIds(ValidateInboxIdsRequest) returns (ValidateInboxIdsResponse) {}
28-
}
29-
30-
// Validates a Inbox-ID Key Package Type
31-
message ValidateInboxIdKeyPackagesResponse {
32-
// one response corresponding to information about one key package
33-
message Response {
34-
bool is_ok = 1;
35-
string error_message = 2;
36-
xmtp.identity.MlsCredential credential = 3;
37-
bytes installation_public_key = 4;
38-
uint64 expiration = 5;
39-
}
40-
41-
repeated Response responses = 1;
20+
rpc ValidateInboxIdKeyPackages(ValidateInboxIdKeyPackagesRequest) returns (ValidateInboxIdKeyPackagesResponse) {}
4221
}
4322

4423
// Contains a batch of serialized Key Packages
45-
message ValidateKeyPackagesRequest {
24+
message ValidateInboxIdKeyPackagesRequest {
4625
// Wrapper for each key package
4726
message KeyPackage {
4827
bytes key_package_bytes_tls_serialized = 1;
@@ -52,19 +31,18 @@ message ValidateKeyPackagesRequest {
5231
repeated KeyPackage key_packages = 1;
5332
}
5433

55-
// Response to ValidateKeyPackagesRequest
56-
message ValidateKeyPackagesResponse {
57-
// An individual response to one key package
58-
message ValidationResponse {
34+
// Validates a Inbox-ID Key Package Type
35+
message ValidateInboxIdKeyPackagesResponse {
36+
// one response corresponding to information about one key package
37+
message Response {
5938
bool is_ok = 1;
6039
string error_message = 2;
61-
bytes installation_id = 3;
62-
string account_address = 4;
63-
bytes credential_identity_bytes = 5;
64-
uint64 expiration = 6;
40+
xmtp.identity.MlsCredential credential = 3;
41+
bytes installation_public_key = 4;
42+
uint64 expiration = 5;
6543
}
6644

67-
repeated ValidationResponse responses = 1;
45+
repeated Response responses = 1;
6846
}
6947

7048
// Contains a batch of serialized Group Messages
@@ -102,28 +80,3 @@ message GetAssociationStateResponse {
10280
xmtp.identity.associations.AssociationState association_state = 1;
10381
xmtp.identity.associations.AssociationStateDiff state_diff = 2;
10482
}
105-
106-
// Request to validate an InboxID with the backend service. Ensures an Inbox Id <> Installation key are valid.
107-
message ValidateInboxIdsRequest {
108-
// a single validation request
109-
message ValidationRequest {
110-
xmtp.identity.MlsCredential credential = 1;
111-
bytes installation_public_key = 2;
112-
repeated xmtp.identity.associations.IdentityUpdate identity_updates = 3;
113-
}
114-
115-
// list of validation requests
116-
repeated ValidationRequest requests = 1;
117-
}
118-
119-
// Response to ValidateInboxIdRequest
120-
message ValidateInboxIdsResponse {
121-
// a single validation response
122-
message ValidationResponse {
123-
bool is_ok = 1;
124-
string error_message = 2;
125-
string inbox_id = 3;
126-
}
127-
// List of validation responses
128-
repeated ValidationResponse responses = 1;
129-
}

proto/xmtpv4/message_api/message_api.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ syntax = "proto3";
44
package xmtp.xmtpv4;
55

66
import "google/api/annotations.proto";
7+
import "identity/associations/association.proto";
78
import "identity/associations/signature.proto";
89
import "mls/api/v1/mls.proto";
910

@@ -26,9 +27,8 @@ message ClientEnvelope {
2627
oneof payload {
2728
xmtp.mls.api.v1.GroupMessageInput group_message = 1;
2829
xmtp.mls.api.v1.WelcomeMessageInput welcome_message = 2;
29-
xmtp.mls.api.v1.RegisterInstallationRequest register_installation = 3;
30+
xmtp.identity.associations.IdentityUpdate identity_update = 3;
3031
xmtp.mls.api.v1.UploadKeyPackageRequest upload_key_package = 4;
31-
xmtp.mls.api.v1.RevokeInstallationRequest revoke_installation = 5;
3232
}
3333
AuthenticatedData aad = 6;
3434
}

ts/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ export * as signedPayload from "./message_contents/signed_payload.pb";
1818
export * as ecies from "./message_contents/ecies.pb";
1919
export * as mlsApi from "./mls/api/v1/mls.pb";
2020
export * as mlsDatabaseIntent from "./mls/database/intents.pb";
21-
export * as mlsAssociation from "./mls/message_contents/association.pb";
2221
export * as mlsContent from "./mls/message_contents/content.pb";
23-
export * as mlsCredential from "./mls/message_contents/credential.pb";
2422
export * as mlsGroupMembership from "./mls/message_contents/group_membership.pb";
2523
export * as mlsGroupMetadata from "./mls/message_contents/group_metadata.pb";
2624
export * as mlsGroupMutableMetadata from "./mls/message_contents/group_mutable_metadata.pb";

0 commit comments

Comments
 (0)