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

refactor(server)!: remove duplicate bech32 prefix endpoint #18909

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/auth) [#18351](https://github.com/cosmos/cosmos-sdk/pull/18351) Auth module was moved to its own go.mod `cosmossdk.io/x/auth`
* (types) [#18372](https://github.com/cosmos/cosmos-sdk/pull/18372) Removed global configuration for coin type and purpose. Setters and getters should be removed and access directly to defined types.
* (types) [#18695](https://github.com/cosmos/cosmos-sdk/pull/18695) Removed global configuration for txEncoder.
* (server) [#18909](https://github.com/cosmos/cosmos-sdk/pull/18909) Remove configuration endpoint on grpc reflection endpoint in favour of auth module bech32prefix endpoint already exposed.

### CLI Breaking Changes

Expand Down
3,067 changes: 794 additions & 2,273 deletions api/cosmos/base/reflection/v2alpha1/reflection.pulsar.go

Large diffs are not rendered by default.

39 changes: 0 additions & 39 deletions api/cosmos/base/reflection/v2alpha1/reflection_grpc.pb.go

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

22 changes: 2 additions & 20 deletions proto/cosmos/base/reflection/v2alpha1/reflection.proto
Copy link
Member

Choose a reason for hiding this comment

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

Are we ok with those proto breaking changes? If we keep that global api module, we should deprecate things here instead of outright removing them.

Copy link
Member Author

Choose a reason for hiding this comment

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

i can deprecate and return an error to look for auth.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Since: cosmos-sdk 0.43

Check failure on line 1 in proto/cosmos/base/reflection/v2alpha1/reflection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "ConfigurationDescriptor" was deleted from file.

Check failure on line 1 in proto/cosmos/base/reflection/v2alpha1/reflection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "GetConfigurationDescriptorRequest" was deleted from file.

Check failure on line 1 in proto/cosmos/base/reflection/v2alpha1/reflection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present message "GetConfigurationDescriptorResponse" was deleted from file.
syntax = "proto3";
package cosmos.base.reflection.v2alpha1;

Expand All @@ -7,7 +7,7 @@
option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1";

// AppDescriptor describes a cosmos-sdk based application
message AppDescriptor {

Check failure on line 10 in proto/cosmos/base/reflection/v2alpha1/reflection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "4" with name "configuration" on message "AppDescriptor" was deleted.
// AuthnDescriptor provides information on how to authenticate transactions on the application
// NOTE: experimental and subject to change in future releases.
AuthnDescriptor authn = 1;
Expand All @@ -15,12 +15,12 @@
ChainDescriptor chain = 2;
// codec provides metadata information regarding codec related types
CodecDescriptor codec = 3;
// configuration provides metadata information regarding the sdk.Config type
ConfigurationDescriptor configuration = 4;
// query_services provides metadata information regarding the available queryable endpoints
QueryServicesDescriptor query_services = 5;
// tx provides metadata information regarding how to send transactions to the given application
TxDescriptor tx = 6;

reserved 4;
}

// TxDescriptor describes the accepted transaction type
Expand Down Expand Up @@ -99,12 +99,6 @@
repeated string field_descriptor_names = 2;
}

// ConfigurationDescriptor contains metadata information on the sdk.Config
message ConfigurationDescriptor {
// bech32_account_address_prefix is the account address prefix
string bech32_account_address_prefix = 1;
}

// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction
message MsgDescriptor {
// msg_type_url contains the TypeURL of a sdk.Msg.
Expand All @@ -112,7 +106,7 @@
}

// ReflectionService defines a service for application reflection.
service ReflectionService {

Check failure on line 109 in proto/cosmos/base/reflection/v2alpha1/reflection.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present RPC "GetConfigurationDescriptor" on service "ReflectionService" was deleted.
// GetAuthnDescriptor returns information on how to authenticate transactions in the application
// NOTE: this RPC is still experimental and might be subject to breaking changes or removal in
// future releases of the cosmos-sdk.
Expand All @@ -127,10 +121,6 @@
rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec";
}
// GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application
rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration";
}
// GetQueryServicesDescriptor returns the available gRPC queryable services of the application
rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) {
option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services";
Expand Down Expand Up @@ -165,14 +155,6 @@
CodecDescriptor codec = 1;
}

// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC
message GetConfigurationDescriptorRequest {}
// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC
message GetConfigurationDescriptorResponse {
// config describes the application's sdk.Config
ConfigurationDescriptor config = 1;
}

// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC
message GetQueryServicesDescriptorRequest {}
// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC
Expand Down
10 changes: 0 additions & 10 deletions server/grpc/reflection/v2alpha1/reflection.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
type Config struct {
SigningModes map[string]int32
ChainID string
SdkConfig *sdk.Config
InterfaceRegistry codectypes.InterfaceRegistry
}

Expand Down Expand Up @@ -46,10 +45,6 @@ func (r reflectionServiceServer) GetCodecDescriptor(_ context.Context, _ *GetCod
return &GetCodecDescriptorResponse{Codec: r.desc.Codec}, nil
}

func (r reflectionServiceServer) GetConfigurationDescriptor(_ context.Context, _ *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) {
return &GetConfigurationDescriptorResponse{Config: r.desc.Configuration}, nil
}

func (r reflectionServiceServer) GetQueryServicesDescriptor(_ context.Context, _ *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) {
return &GetQueryServicesDescriptorResponse{Queries: r.desc.QueryServices}, nil
}
Expand All @@ -61,10 +56,6 @@ func (r reflectionServiceServer) GetTxDescriptor(_ context.Context, _ *GetTxDesc
func newReflectionServiceServer(grpcSrv *grpc.Server, conf Config) (reflectionServiceServer, error) {
// set chain descriptor
chainDescriptor := &ChainDescriptor{Id: conf.ChainID}
// set configuration descriptor
configurationDescriptor := &ConfigurationDescriptor{
Bech32AccountAddressPrefix: conf.SdkConfig.GetBech32AccountAddrPrefix(),
}
// set codec descriptor
codecDescriptor, err := newCodecDescriptor(conf.InterfaceRegistry)
if err != nil {
Expand All @@ -82,7 +73,6 @@ func newReflectionServiceServer(grpcSrv *grpc.Server, conf Config) (reflectionSe
Authn: authnDescriptor,
Chain: chainDescriptor,
Codec: codecDescriptor,
Configuration: configurationDescriptor,
QueryServices: queryServiceDescriptor,
Tx: txDescriptor,
}
Expand Down
Loading
Loading