Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gateway_info_v2, gateway_info_stream_req_v2, gateway_metadata_v2 #432

Merged
merged 6 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 54 additions & 1 deletion src/service/mobile_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ message cbrs_radio_deployment_info {
}

message gateway_metadata {
option deprecated = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

i've only ever tried to deprecate fields with this notation, not entire messages but in those cases rust/prost seems to be unable to handle the message being deprecated and omitted without throwing missing field warnings. hopefully it's easier when the whole message is flagged

Copy link
Member Author

Choose a reason for hiding this comment

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

Honestly, I’ve never thought about how Rust/Prost handles this deprecation, but I didn’t see any related warnings while working on this PR.

// The res12 h3 index asserted address of the gateway as a string
// where an unasserted gateway returns an empty string
string location = 2;
}

message gateway_metadata_v2 {
// The res12 h3 index asserted address of the gateway as a string
// where an unasserted gateway returns an empty string
string location = 2;
Expand All @@ -53,12 +60,22 @@ message gateway_metadata {
}

message gateway_info {
option deprecated = true;
// The public key binary address and on-chain identity of the gateway
bytes address = 1;
// The gateway metadata as recorded on the blockchain
gateway_metadata metadata = 2;
// the asserted device type of the gateway
device_type device_type = 3;
}

message gateway_info_v2 {
// The public key binary address and on-chain identity of the gateway
bytes address = 1;
// The gateway metadata as recorded on the blockchain
gateway_metadata_v2 metadata = 2;
// the asserted device type of the gateway
device_type device_type = 3;
// The unix epoch timestamp (in seconds)
// when the data was read from chain and written to the db
uint64 refreshed_at = 4;
Expand Down Expand Up @@ -94,7 +111,28 @@ message gateway_info_res_v1 {
bytes signature = 4;
}

message gateway_info_res_v2 {
gateway_info_v2 info = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}

message gateway_info_stream_req_v1 {
option deprecated = true;
// max number of gateway info records in each message of the response stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
bytes signer = 2;
bytes signature = 3;
// Device types that will be returned in the response
// Returns all devices if empty
repeated device_type device_types = 4;
}

message gateway_info_stream_req_v2 {
// max number of gateway info records in each message of the response stream
uint32 batch_size = 1;
// pubkey binary of the signing keypair
Expand All @@ -120,6 +158,16 @@ message gateway_info_stream_res_v1 {
bytes signature = 4;
}

message gateway_info_stream_res_v2 {
// a list of gateway info numbering up to the request batch size
repeated gateway_info_v2 gateways = 1;
// unix epoch timestamp in seconds
uint64 timestamp = 2;
// pubkey binary of the signing keypair
bytes signer = 3;
bytes signature = 4;
}

message entity_verify_req_v1 {
// binary identifier of the entity
bytes entity_id = 1;
Expand Down Expand Up @@ -310,7 +358,12 @@ service gateway {
returns (stream gateway_info_stream_res_v1);
// Get a stream of gateway info
rpc info_stream(gateway_info_stream_req_v1)
returns (stream gateway_info_stream_res_v1);
returns (stream gateway_info_stream_res_v1) {
option deprecated = true;
}
// Get a stream of gateway info (V2)
rpc info_stream_v2(gateway_info_stream_req_v2)
returns (stream gateway_info_stream_res_v2);
}

service entity {
Expand Down
Loading