Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove the unused light client requests (#12470)
Browse files Browse the repository at this point in the history
* Remove the unused light client requests

* Add comment about new ids
  • Loading branch information
tomaka authored Oct 11, 2022
1 parent 488fc24 commit 60be7b8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
4 changes: 0 additions & 4 deletions client/network/light/src/light_client_requests/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,8 @@ where
self.on_remote_call_request(&peer, r)?,
Some(schema::v1::light::request::Request::RemoteReadRequest(r)) =>
self.on_remote_read_request(&peer, r)?,
Some(schema::v1::light::request::Request::RemoteHeaderRequest(_r)) =>
return Err(HandleRequestError::BadRequest("Not supported.")),
Some(schema::v1::light::request::Request::RemoteReadChildRequest(r)) =>
self.on_remote_read_child_request(&peer, r)?,
Some(schema::v1::light::request::Request::RemoteChangesRequest(_r)) =>
return Err(HandleRequestError::BadRequest("Not supported.")),
None =>
return Err(HandleRequestError::BadRequest("Remote request without request data.")),
};
Expand Down
51 changes: 2 additions & 49 deletions client/network/light/src/schema/light.v1.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ message Request {
oneof request {
RemoteCallRequest remote_call_request = 1;
RemoteReadRequest remote_read_request = 2;
RemoteHeaderRequest remote_header_request = 3;
RemoteReadChildRequest remote_read_child_request = 4;
RemoteChangesRequest remote_changes_request = 5;
// Note: ids 3 and 5 were used in the past. It would be preferable to not re-use them.
}
}

Expand All @@ -28,8 +27,7 @@ message Response {
oneof response {
RemoteCallResponse remote_call_response = 1;
RemoteReadResponse remote_read_response = 2;
RemoteHeaderResponse remote_header_response = 3;
RemoteChangesResponse remote_changes_response = 4;
// Note: ids 3 and 4 were used in the past. It would be preferable to not re-use them.
}
}

Expand Down Expand Up @@ -73,48 +71,3 @@ message RemoteReadChildRequest {
// Storage keys.
repeated bytes keys = 6;
}

// Remote header request.
message RemoteHeaderRequest {
// Block number to request header for.
bytes block = 2;
}

// Remote header response.
message RemoteHeaderResponse {
// Header. None if proof generation has failed (e.g. header is unknown).
bytes header = 2; // optional
// Header proof.
bytes proof = 3;
}

/// Remote changes request.
message RemoteChangesRequest {
// Hash of the first block of the range (including first) where changes are requested.
bytes first = 2;
// Hash of the last block of the range (including last) where changes are requested.
bytes last = 3;
// Hash of the first block for which the requester has the changes trie root. All other
// affected roots must be proved.
bytes min = 4;
// Hash of the last block that we can use when querying changes.
bytes max = 5;
// Storage child node key which changes are requested.
bytes storage_key = 6; // optional
// Storage key which changes are requested.
bytes key = 7;
}

// Remote changes response.
message RemoteChangesResponse {
// Proof has been generated using block with this number as a max block. Should be
// less than or equal to the RemoteChangesRequest::max block number.
bytes max = 2;
// Changes proof.
repeated bytes proof = 3;
// Changes tries roots missing on the requester' node.
repeated Pair roots = 4;
// Missing changes tries roots proof.
bytes roots_proof = 5;
}

0 comments on commit 60be7b8

Please sign in to comment.