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 query for operator and chain configuration #13485

Merged
merged 18 commits into from Oct 10, 2022

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented Oct 9, 2022

Description

Closes: #11582

Introduce a new /cosmos/base/node/v1beta1/config gRPC query that exposes operator configuration, most notably the operator's configured minimum gas price.

I added the proto definition to a new proto/cosmos/base/node/v1beta1/query.proto path, as I could not find a more fitting place. Open to suggestions on alternatives, but I'm pretty happy with this location.

I've marked this for backport to 0.45.x and 0.46.x, even though it technically breaks the Application Go API, but I think this is worth it since so many folks have requested this for a variety of reasons.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@alexanderbez alexanderbez changed the title feat: feat: gRPC query for operator and chain configuration Oct 9, 2022
@codecov
Copy link

codecov bot commented Oct 9, 2022

Codecov Report

Merging #13485 (3c31faf) into main (f9945db) will decrease coverage by 0.09%.
The diff coverage is 71.42%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13485      +/-   ##
==========================================
- Coverage   53.90%   53.81%   -0.10%     
==========================================
  Files         642      653      +11     
  Lines       55452    56828    +1376     
==========================================
+ Hits        29893    30581     +688     
- Misses      23155    23801     +646     
- Partials     2404     2446      +42     
Impacted Files Coverage Δ
client/grpc/node/service.go 71.42% <71.42%> (ø)
simapp/app.go 77.84% <0.00%> (ø)
simapp/simd/cmd/genaccounts.go 89.09% <0.00%> (ø)
simapp/simd/cmd/root.go 70.35% <0.00%> (ø)
simapp/state.go 0.00% <0.00%> (ø)
simapp/export.go 11.94% <0.00%> (ø)
simapp/upgrades.go 28.57% <0.00%> (ø)
simapp/genesis_account.go 100.00% <0.00%> (ø)
simapp/test_helpers.go 30.25% <0.00%> (ø)
simapp/genesis.go 100.00% <0.00%> (ø)
... and 1 more

@alexanderbez alexanderbez added backport/0.45.x backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release labels Oct 10, 2022
@alexanderbez alexanderbez marked this pull request as ready for review October 10, 2022 02:14
@alexanderbez alexanderbez requested a review from a team as a code owner October 10, 2022 02:14
// RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes
// on the given mux object.
func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux) {
_ = RegisterServiceHandlerClient(context.Background(), mux, NewServiceClient(clientConn))

Check warning

Code scanning / gosec

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I wouldn't put node and chain configuration together.

Account prefixes in my mind should be exposed by the auth query services and the validator prefixes should be exposed by staking. The fact that there is still the global config is not something we should rely on here as it could go away and I think those prefixes would go to auth and staking modules.

Why are we exposing bech32 pub key prefixes? I thought those were deprecated.

Also regarding node minimum gas price, this makes sense and this location looks good, but it seems that clients won't actually get the gas prices of validators but sentries or full nodes right?

@alexanderbez
Copy link
Contributor Author

Account prefixes in my mind should be exposed by the auth query services and the validator prefixes should be exposed by staking.

I think it's so silly to separate Bech32 HRPs like this. It makes zero sense to me. They really don't belong in any module IMO.

Why are we exposing bech32 pub key prefixes? I thought those were deprecated.

I exposed whatever was in types.Config.

Also regarding node minimum gas price, this makes sense and this location looks good, but it seems that clients won't actually get the gas prices of validators but sentries or full nodes right?

What clients can do is query public nodes to get a good understanding of what the average min gas price is. At the end of the day, yes, it's the proposer's min gas price that matters.

In any case, since I'm getting push back on the bech32 stuff, I'm just going to keep the min gas price field.

@alexanderbez
Copy link
Contributor Author

@Mergifyio backport release/v0.45.x

@mergify
Copy link
Contributor

mergify bot commented Oct 18, 2022

backport release/v0.45.x

✅ Backports have been created

SpicyLemon added a commit to provenance-io/cosmos-sdk that referenced this pull request Oct 24, 2022
* fix: move ics23 to correct folder (cosmos#13549)

* fix: fix liveness tests cosmos#13551

* feat: add `GenSignedMockTx` (cosmos#13557)

* fix: fix `make proto-gen` (cosmos#13564)

* fix: fix `make proto-gen`

* add changelog

* feat: [REDO] gRPC query for operator and chain configuration (backport cosmos#13485) (cosmos#13589)

* chore: bump tendermint to `0.34.22` (cosmos#13585)

* fix: (v0.45.x) regression in return value of WithdrawDelegationRewards when rewards are zero (cosmos#13588)

* fix(server): v0.45.x Populate the PruningKeepEvery config entry in GetConfig. (cosmos#13610)

* Populate the PruningKeepEvery config entry in GetConfig.

* Update changlog.

* feat(cli): add module-account cli cmd and grpc get api (backport cosmos#13612) (cosmos#13617)

* feat(cli): add module-account cli cmd and grpc get api (cosmos#13612)

(cherry picked from commit ddf5cf0)

# Conflicts:
#	CHANGELOG.md
#	api/cosmos/auth/v1beta1/query.pulsar.go
#	api/cosmos/auth/v1beta1/query_grpc.pb.go
#	proto/cosmos/auth/v1beta1/query.proto
#	tests/e2e/auth/suite.go
#	x/auth/client/cli/query.go
#	x/auth/keeper/grpc_query.go
#	x/auth/keeper/grpc_query_test.go
#	x/auth/types/query.pb.go
#	x/auth/types/query.pb.gw.go

* update changelog

* fix conflicts

Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>

* chore: prepare 0.45.10 changelog (cosmos#13624)

* chore: prepare 0.45.10 changelog

* default release notes

* period

* Add missing changelog section for v0.45.9-pio-1.

* Remove the old release notes.

* Remove accidentally duplicated section for v0.45.4.

* Add new v0.45.10-pio-1 section to the changelog and update the release notes to reflect our stuff.

* Include a 'nothing' under unreleased.

* Add links to changlog entries.

Co-authored-by: Aaron Craelius <aaron@regen.network>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com>
jaybxyz pushed a commit to cosmosquad-labs/cosmos-sdk that referenced this pull request Nov 1, 2022
p0mvn pushed a commit to osmosis-labs/cosmos-sdk that referenced this pull request Mar 23, 2023
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/0.46.x PR scheduled for inclusion in the v0.46's next stable release C:CLI C:x/auth C:x/bank
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose chain information via new RPC route
5 participants