Skip to content

Commit 312d6e9

Browse files
authored
[proto] Remove redundant RPC GetLastCommittedBlockNumber() (hyperledger#155)
#### Type of change - Improvement (improvement to code, performance, etc) #### Description - Remove redundant RPC in the coordinator: `GetLastCommittedBlockNumber()` - It was already covered by `GetNextExpectedBlockNumber()` - Remove unnecessary stream check in `GetNextExpectedBlockNumber()` - The sidecar verifies this anyway before calling this method - Align API with VC - Replaced `GetLastCommittedBlockNumber()` with `GetNextExpectedBlockNumber()` - Adjust relevant tests #### Related issues - resolves hyperledger#48 Signed-off-by: Liran Funaro <liran.funaro@gmail.com>
1 parent fdf5de5 commit 312d6e9

23 files changed

Lines changed: 328 additions & 481 deletions

api/protoblocktx/block_tx.pb.go

Lines changed: 124 additions & 191 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/protoblocktx/block_tx.proto

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ message BlockInfo {
9494
uint64 number = 1;
9595
}
9696

97-
message LastCommittedBlock {
98-
optional BlockInfo block = 1;
99-
}
100-
10197
message QueryStatus {
10298
repeated string txIDs = 1;
10399
}

api/protocoordinatorservice/coordinator.pb.go

Lines changed: 41 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/protocoordinatorservice/coordinator.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import "google/protobuf/empty.proto";
1616
service Coordinator {
1717
rpc BlockProcessing(stream Batch) returns (stream protoblocktx.TransactionsStatus);
1818
rpc SetLastCommittedBlockNumber (protoblocktx.BlockInfo) returns (google.protobuf.Empty) {};
19-
rpc GetLastCommittedBlockNumber (google.protobuf.Empty) returns (protoblocktx.LastCommittedBlock) {};
20-
rpc GetNextExpectedBlockNumber (google.protobuf.Empty) returns (protoblocktx.BlockInfo) {};
19+
rpc GetNextBlockNumberToCommit (google.protobuf.Empty) returns (protoblocktx.BlockInfo) {};
2120
rpc GetTransactionsStatus(protoblocktx.QueryStatus) returns (protoblocktx.TransactionsStatus);
2221
rpc GetConfigTransaction(google.protobuf.Empty) returns (protoblocktx.ConfigTransaction) {};
2322
rpc NumberOfWaitingTransactionsForStatus(google.protobuf.Empty) returns (WaitingTransactions);

api/protocoordinatorservice/coordinator_grpc.pb.go

Lines changed: 13 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)