Skip to content

Commit

Permalink
feat(gRPC): Add halt-height to gRPC Node Config Query (backport #19043)…
Browse files Browse the repository at this point in the history
… (#19044)

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people committed Jan 13, 2024
1 parent c0beb19 commit 8ac0492
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 89 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [v0.50.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.3) - 2023-01-11

### Features

* (gRPC) [#19043](https://github.com/cosmos/cosmos-sdk/pull/19043) Add `halt_height` to the gRPC `/cosmos/base/node/v1beta1/config` request.

### Improvements

* (x/bank) [#18956](https://github.com/cosmos/cosmos-sdk/pull/18956) Introduced a new `DenomOwnersByQuery` query method for `DenomOwners`, which accepts the denom value as a query string parameter, resolving issues with denoms containing slashes.
Expand Down
155 changes: 106 additions & 49 deletions api/cosmos/base/node/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9472,9 +9472,11 @@ paths:
type: string
pruning_keep_recent:
type: string
title: pruning settings
pruning_interval:
type: string
halt_height:
type: string
format: uint64
description: >-
ConfigResponse defines the response structure for the Config gRPC
query.
Expand Down Expand Up @@ -47593,9 +47595,11 @@ definitions:
type: string
pruning_keep_recent:
type: string
title: pruning settings
pruning_interval:
type: string
halt_height:
type: string
format: uint64
description: ConfigResponse defines the response structure for the Config gRPC query.
cosmos.base.node.v1beta1.StatusResponse:
type: object
Expand Down
105 changes: 70 additions & 35 deletions client/grpc/node/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/grpc/node/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigRespo
MinimumGasPrice: sdkCtx.MinGasPrices().String(),
PruningKeepRecent: s.cfg.PruningKeepRecent,
PruningInterval: s.cfg.PruningInterval,
HaltHeight: s.cfg.HaltHeight,
}, nil
}

Expand Down
4 changes: 3 additions & 1 deletion client/grpc/node/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
)

func TestServiceServer_Config(t *testing.T) {
svr := NewQueryServer(client.Context{}, *config.DefaultConfig())
defaultCfg := config.DefaultConfig()
svr := NewQueryServer(client.Context{}, *defaultCfg)
ctx := sdk.Context{}.WithMinGasPrices(sdk.NewDecCoins(sdk.NewInt64DecCoin("stake", 15)))

resp, err := svr.Config(ctx, &ConfigRequest{})
require.NoError(t, err)
require.NotNil(t, resp)
require.Equal(t, ctx.MinGasPrices().String(), resp.MinimumGasPrice)
require.Equal(t, defaultCfg.HaltHeight, resp.HaltHeight)
}
4 changes: 2 additions & 2 deletions proto/cosmos/base/node/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ message ConfigRequest {}

// ConfigResponse defines the response structure for the Config gRPC query.
message ConfigResponse {
string minimum_gas_price = 1;
// pruning settings
string minimum_gas_price = 1;
string pruning_keep_recent = 2;
string pruning_interval = 3;
uint64 halt_height = 4;
}

// StateRequest defines the request structure for the status of a node.
Expand Down

0 comments on commit 8ac0492

Please sign in to comment.