Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gRPC): Add halt-height to gRPC Node Config Query (backport #19043) #19044

Merged
merged 3 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading