Skip to content

Commit c24cdcc

Browse files
committed
feat(grpc): add earliest/latest block height to GetSyncing response
Extend the GetSyncingResponse in cosmos.base.tendermint.v1beta1.Service to include earliest_block_height and latest_block_height fields. This enables gRPC clients (like indexers) to discover block availability without needing to query the CometBFT RPC separately. The fields expose the same information as the /status RPC endpoint's sync_info. Changes: - Add earliest_block_height field to GetSyncingResponse proto - Add latest_block_height field to GetSyncingResponse proto - Update service implementation to populate new fields from SyncInfo
1 parent 18e85de commit c24cdcc

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

client/grpc/cmtservice/query.pb.go

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

client/grpc/cmtservice/service.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ func (s queryServer) GetSyncing(ctx context.Context, _ *GetSyncingRequest) (*Get
5555
}
5656

5757
return &GetSyncingResponse{
58-
Syncing: status.SyncInfo.CatchingUp,
58+
Syncing: status.SyncInfo.CatchingUp,
59+
EarliestBlockHeight: status.SyncInfo.EarliestBlockHeight,
60+
LatestBlockHeight: status.SyncInfo.LatestBlockHeight,
5961
}, nil
6062
}
6163

proto/cosmos/base/tendermint/v1beta1/query.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ message GetSyncingRequest {}
126126
// GetSyncingResponse is the response type for the Query/GetSyncing RPC method.
127127
message GetSyncingResponse {
128128
bool syncing = 1;
129+
// earliest_block_height is the earliest block height available on this node.
130+
int64 earliest_block_height = 2;
131+
// latest_block_height is the latest block height available on this node.
132+
int64 latest_block_height = 3;
129133
}
130134

131135
// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method.

0 commit comments

Comments
 (0)