Skip to content

Commit cca90dc

Browse files
committed
batch request headers
1 parent 6f29b31 commit cca90dc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

proto/cusf/mainchain/v1/validator.proto

+17-1
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ message BlockInfo {
7373
}
7474

7575
service ValidatorService {
76-
// Fetches information about a specific mainchain block header.
76+
// Fetches information about a specific mainchain block header,
77+
// and optionally, it's ancestors
7778
rpc GetBlockHeaderInfo(GetBlockHeaderInfoRequest)
7879
returns (GetBlockHeaderInfoResponse);
7980

8081
// Fetches information about a specific mainchain block, and how it pertains
8182
// to events happening on a specific sidechain.
8283
rpc GetBlockInfo(GetBlockInfoRequest) returns (GetBlockInfoResponse);
84+
// Fetches BMM h* commitment for a specific mainchain block,
85+
// and optionally, it's ancestors
8386
rpc GetBmmHStarCommitment(GetBmmHStarCommitmentRequest)
8487
returns (GetBmmHStarCommitmentResponse);
8588
rpc GetChainInfo(GetChainInfoRequest) returns (GetChainInfoResponse);
@@ -97,9 +100,14 @@ service ValidatorService {
97100

98101
message GetBlockHeaderInfoRequest {
99102
cusf.common.v1.ReverseHex block_hash = 1;
103+
// Request block header info for up to `max_ancestors` ancestors.
104+
// Fewer ancestors MAY be returned.
105+
optional uint32 max_ancestors = 2;
100106
}
101107
message GetBlockHeaderInfoResponse {
102108
BlockHeaderInfo header_info = 1;
109+
// Ancestors MUST be sorted newest-first
110+
repeated BlockHeaderInfo ancestor_infos = 2;
103111
}
104112

105113
message GetBlockInfoRequest {
@@ -122,13 +130,21 @@ message GetBlockInfoResponse {
122130
message GetBmmHStarCommitmentRequest {
123131
cusf.common.v1.ReverseHex block_hash = 1;
124132
google.protobuf.UInt32Value sidechain_id = 2;
133+
// Request commitments for up to `max_ancestors` ancestors.
134+
// Fewer ancestors MAY be returned.
135+
optional uint32 max_ancestors = 3;
125136
}
126137
message GetBmmHStarCommitmentResponse {
127138
message BlockNotFoundError {
128139
cusf.common.v1.ReverseHex block_hash = 1;
129140
}
141+
message OptionalCommitment {
142+
optional cusf.common.v1.ConsensusHex commitment = 1;
143+
}
130144
message Commitment {
131145
optional cusf.common.v1.ConsensusHex commitment = 1;
146+
// Ancestors MUST be sorted newest-first
147+
repeated OptionalCommitment ancestor_commitments = 2;
132148
}
133149
oneof result {
134150
BlockNotFoundError block_not_found = 1;

0 commit comments

Comments
 (0)