From 6e59fbb0db7bbd4be361347f2a107a75572e5b08 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 27 Sep 2024 21:47:46 +0200 Subject: [PATCH 01/19] feat(server/v2/comebft): fix simulation wiring --- server/v2/cometbft/abci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 85b38e4ccc65..6084bcb8bf78 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -227,7 +227,7 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) ( resp, err = c.handleQueryP2P(path) default: - resp = QueryResult(errorsmod.Wrap(cometerrors.ErrUnknownRequest, "unknown query path"), c.cfg.AppTomlConfig.Trace) + resp = QueryResult(errorsmod.Wrapf(cometerrors.ErrUnknownRequest, "unknown query path %s", path), c.cfg.AppTomlConfig.Trace) } if err != nil { From 19debfe135860b6bcf0908837d5e7256cb933165 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 27 Sep 2024 22:42:45 +0200 Subject: [PATCH 02/19] updates --- CHANGELOG.md | 1 + client/grpc/cmtservice/service.go | 4 +- server/v2/cometbft/abci.go | 2 +- .../client/grpc/cmtservice/autocli.go | 71 ------------------- .../client/grpc/cmtservice/service.go | 49 ------------- server/v2/cometbft/go.mod | 15 +--- server/v2/cometbft/go.sum | 47 ------------ x/staking/keeper/grpc_query.go | 6 +- 8 files changed, 8 insertions(+), 187 deletions(-) delete mode 100644 server/v2/cometbft/client/grpc/cmtservice/autocli.go diff --git a/CHANGELOG.md b/CHANGELOG.md index a100df6fadfc..44818d96dc86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (sims) [#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules ### Bug Fixes + * (sims) [#21952](https://github.com/cosmos/cosmos-sdk/pull/21952) Use liveness matrix for validator sign status in sims * (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators * (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id. diff --git a/client/grpc/cmtservice/service.go b/client/grpc/cmtservice/service.go index 31dfce2255ce..d8673af02e32 100644 --- a/client/grpc/cmtservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -38,12 +38,12 @@ type ( // NewQueryServer creates a new CometBFT query server. func NewQueryServer( - clientCtx CometRPC, + cometRPC CometRPC, queryFn abciQueryFn, consensusAddressCodec address.Codec, ) ServiceServer { return queryServer{ - rpc: clientCtx, + rpc: cometRPC, queryFn: queryFn, consensusCodec: consensusAddressCodec, } diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 6084bcb8bf78..522d7313efeb 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -227,7 +227,7 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) ( resp, err = c.handleQueryP2P(path) default: - resp = QueryResult(errorsmod.Wrapf(cometerrors.ErrUnknownRequest, "unknown query path %s", path), c.cfg.AppTomlConfig.Trace) + resp = QueryResult(errorsmod.Wrapf(cometerrors.ErrUnknownRequest, "unknown query path %s", req.Path), c.cfg.AppTomlConfig.Trace) } if err != nil { diff --git a/server/v2/cometbft/client/grpc/cmtservice/autocli.go b/server/v2/cometbft/client/grpc/cmtservice/autocli.go deleted file mode 100644 index 6d8be1f22994..000000000000 --- a/server/v2/cometbft/client/grpc/cmtservice/autocli.go +++ /dev/null @@ -1,71 +0,0 @@ -package cmtservice - -import ( - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" -) - -var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ - Service: cmtv1beta1.Service_ServiceDesc.ServiceName, - RpcCommandOptions: []*autocliv1.RpcCommandOptions{ - { - RpcMethod: "GetNodeInfo", - Use: "node-info", - Short: "Query the current node info", - }, - { - RpcMethod: "GetSyncing", - Use: "syncing", - Short: "Query node syncing status", - }, - { - RpcMethod: "GetLatestBlock", - Use: "block-latest", - Short: "Query for the latest committed block", - }, - { - RpcMethod: "GetBlockByHeight", - Use: "block-by-height ", - Short: "Query for a committed block by height", - Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, - }, - { - RpcMethod: "GetLatestValidatorSet", - Use: "validator-set", - Alias: []string{"validator-set-latest", "comet-validator-set", "cometbft-validator-set", "tendermint-validator-set"}, - Short: "Query for the latest validator set", - }, - { - RpcMethod: "GetValidatorSetByHeight", - Use: "validator-set-by-height ", - Short: "Query for a validator set by height", - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, - }, - { - RpcMethod: "ABCIQuery", - Skip: true, - }, - }, -} - -// NewCometBFTCommands is a fake `appmodule.Module` to be considered as a module -// and be added in AutoCLI. -func NewCometBFTCommands() *cometModule { - return &cometModule{} -} - -type cometModule struct{} - -func (m cometModule) IsOnePerModuleType() {} -func (m cometModule) IsAppModule() {} - -func (m cometModule) Name() string { - return "comet" -} - -func (m cometModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: CometBFTAutoCLIDescriptor, - } -} diff --git a/server/v2/cometbft/client/grpc/cmtservice/service.go b/server/v2/cometbft/client/grpc/cmtservice/service.go index e4fb1bb7f51d..2bebb51cc3aa 100644 --- a/server/v2/cometbft/client/grpc/cmtservice/service.go +++ b/server/v2/cometbft/client/grpc/cmtservice/service.go @@ -1,56 +1,7 @@ package cmtservice -import ( - "context" - "strings" - - abci "github.com/cometbft/cometbft/api/cometbft/abci/v1" - gogogrpc "github.com/cosmos/gogoproto/grpc" - gogoprotoany "github.com/cosmos/gogoproto/types/any" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - - "cosmossdk.io/core/address" - "cosmossdk.io/server/v2/cometbft/client/rpc" - - cmtservice "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" -) - -var _ gogoprotoany.UnpackInterfacesMessage = &cmtservice.GetLatestValidatorSetResponse{} - const ( QueryPathApp = "app" QueryPathP2P = "p2p" QueryPathStore = "store" ) - -type abciQueryFn = func(context.Context, *abci.QueryRequest) (*abci.QueryResponse, error) - -// RegisterTendermintService registers the CometBFT queries on the gRPC router. -func RegisterTendermintService( - client rpc.CometRPC, - server gogogrpc.Server, - queryFn abciQueryFn, - consensusCodec address.Codec, -) { - cmtservice.RegisterServiceServer(server, cmtservice.NewQueryServer(client, queryFn, consensusCodec)) -} - -// RegisterGRPCGatewayRoutes mounts the CometBFT service's GRPC-gateway routes on the -// given Mux. -func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux) { - _ = cmtservice.RegisterServiceHandlerClient(context.Background(), mux, cmtservice.NewServiceClient(clientConn)) -} - -// SplitABCIQueryPath splits a string path using the delimiter '/'. -// -// e.g. "this/is/funny" becomes []string{"this", "is", "funny"} -func SplitABCIQueryPath(requestPath string) (path []string) { - path = strings.Split(requestPath, "/") - - // first element is empty string - if len(path) > 0 && path[0] == "" { - path = path[1:] - } - - return path -} diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index a1451b39513b..9213bd6541b8 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -18,7 +18,6 @@ replace ( ) require ( - cosmossdk.io/api v0.7.6 cosmossdk.io/core v1.0.0-alpha.3 cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 cosmossdk.io/log v1.4.1 @@ -31,7 +30,6 @@ require ( github.com/cometbft/cometbft/api v1.0.0-rc.1 github.com/cosmos/cosmos-sdk v0.53.0 github.com/cosmos/gogoproto v1.7.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 @@ -41,6 +39,7 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.34.2-20240130113600-88ef6483f90f.2 // indirect + cosmossdk.io/api v0.7.6 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core/testing v0.0.0-20240923163230-04da382a9f29 // indirect cosmossdk.io/depinject v1.0.0 // indirect @@ -54,9 +53,7 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect - github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect @@ -72,7 +69,6 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.0 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect @@ -85,14 +81,12 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.17.0 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -102,10 +96,8 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect @@ -116,7 +108,6 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.2.0 // indirect - github.com/huandu/skiplist v1.2.1 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -169,13 +160,11 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect - golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/term v0.24.0 // indirect golang.org/x/text v0.18.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240924160255-9d4c2d233b61 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 60c3b60a5d83..98c19b9926da 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -47,7 +47,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -75,12 +74,6 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= @@ -116,7 +109,6 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= -github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.0 h1:Ezaxt8aPA3kbkhsfyqwenChGLQwHDAIif3tG9x1FMV8= @@ -156,9 +148,6 @@ github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= @@ -183,12 +172,10 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -196,11 +183,9 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -240,7 +225,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -292,8 +276,6 @@ github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbg github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= -github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -308,7 +290,6 @@ github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= @@ -384,7 +365,6 @@ github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/ github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -468,7 +448,6 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -500,15 +479,10 @@ go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6 go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -522,7 +496,6 @@ golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= @@ -542,7 +515,6 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -577,16 +549,11 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -602,18 +569,15 @@ golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -630,10 +594,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= @@ -644,12 +606,8 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -663,13 +621,10 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -684,11 +639,9 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= diff --git a/x/staking/keeper/grpc_query.go b/x/staking/keeper/grpc_query.go index e55671f34c9e..aaf61daf4707 100644 --- a/x/staking/keeper/grpc_query.go +++ b/x/staking/keeper/grpc_query.go @@ -11,7 +11,6 @@ import ( "cosmossdk.io/collections" errorsmod "cosmossdk.io/errors" "cosmossdk.io/store/prefix" - storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/staking/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" @@ -429,14 +428,13 @@ func (k Querier) Redelegations(ctx context.Context, req *types.QueryRedelegation var pageRes *query.PageResponse var err error - store := runtime.KVStoreAdapter(k.KVStoreService.OpenKVStore(ctx)) switch { case req.DelegatorAddr != "" && req.SrcValidatorAddr != "" && req.DstValidatorAddr != "": redels, err = queryRedelegation(ctx, k, req) case req.DelegatorAddr == "" && req.SrcValidatorAddr != "" && req.DstValidatorAddr == "": redels, pageRes, err = queryRedelegationsFromSrcValidator(ctx, k, req) default: - redels, pageRes, err = queryAllRedelegations(ctx, store, k, req) + redels, pageRes, err = queryAllRedelegations(ctx, k, req) } if err != nil { return nil, status.Error(codes.Internal, err.Error()) @@ -557,7 +555,7 @@ func queryRedelegationsFromSrcValidator(ctx context.Context, k Querier, req *typ }, query.WithCollectionPaginationTriplePrefix[[]byte, []byte, []byte](valAddr)) } -func queryAllRedelegations(ctx context.Context, store storetypes.KVStore, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, res *query.PageResponse, err error) { +func queryAllRedelegations(ctx context.Context, k Querier, req *types.QueryRedelegationsRequest) (redels types.Redelegations, res *query.PageResponse, err error) { delAddr, err := k.authKeeper.AddressCodec().StringToBytes(req.DelegatorAddr) if err != nil { return nil, nil, err From e6c84600a2ba7d5e25f3765b7d6b9c38bc728297 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 8 Oct 2024 17:15:00 +0200 Subject: [PATCH 03/19] updates --- server/v2/cometbft/abci.go | 13 +++++++++---- .../v2/cometbft/client/grpc/cmtservice/service.go | 7 ------- 2 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 server/v2/cometbft/client/grpc/cmtservice/service.go diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index f2d4a4ba46da..101d78754468 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -27,7 +27,6 @@ import ( "cosmossdk.io/log" "cosmossdk.io/schema/appdata" "cosmossdk.io/server/v2/appmanager" - "cosmossdk.io/server/v2/cometbft/client/grpc/cmtservice" "cosmossdk.io/server/v2/cometbft/handlers" "cosmossdk.io/server/v2/cometbft/mempool" "cosmossdk.io/server/v2/cometbft/types" @@ -37,6 +36,12 @@ import ( consensustypes "cosmossdk.io/x/consensus/types" ) +const ( + QueryPathApp = "app" + QueryPathP2P = "p2p" + QueryPathStore = "store" +) + var _ abci.Application = (*Consensus[transaction.Tx])(nil) type Consensus[T transaction.Tx] struct { @@ -223,13 +228,13 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) ( } switch path[0] { - case cmtservice.QueryPathApp: + case QueryPathApp: resp, err = c.handlerQueryApp(ctx, path, req) - case cmtservice.QueryPathStore: + case QueryPathStore: resp, err = c.handleQueryStore(path, c.store, req) - case cmtservice.QueryPathP2P: + case QueryPathP2P: resp, err = c.handleQueryP2P(path) default: diff --git a/server/v2/cometbft/client/grpc/cmtservice/service.go b/server/v2/cometbft/client/grpc/cmtservice/service.go deleted file mode 100644 index 2bebb51cc3aa..000000000000 --- a/server/v2/cometbft/client/grpc/cmtservice/service.go +++ /dev/null @@ -1,7 +0,0 @@ -package cmtservice - -const ( - QueryPathApp = "app" - QueryPathP2P = "p2p" - QueryPathStore = "store" -) From a15551e3d684831ae99644b1ce8a1127a9081963 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 5 Nov 2024 17:38:42 +0100 Subject: [PATCH 04/19] wip --- server/v2/api/grpc/server.go | 15 ++++++++------- server/v2/server_test.go | 2 +- simapp/v2/simdv2/cmd/commands.go | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index 12cc1e6add1a..5a8bb4fb955c 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -51,6 +51,7 @@ func New[T transaction.Tx]( queryable interface { Query(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error) }, + extraGRPCHandlers []func(*grpc.Server), cfg server.ConfigMap, cfgOptions ...CfgOption, ) (*Server[T], error) { @@ -71,12 +72,17 @@ func New[T transaction.Tx]( grpc.UnknownServiceHandler(makeUnknownServiceHandler(queryHandlers, queryable)), ) - // Reflection allows external clients to see what services and methods the gRPC server exposes. + // reflection allows external clients to see what services and methods the gRPC server exposes. gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) - // Register V2 + // register V2 service RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) + // register extra handlers on the grpc server + for _, fn := range extraGRPCHandlers { + fn(grpcSrv) + } + srv.grpcSrv = grpcSrv srv.config = serverCfg srv.logger = logger.With(log.ModuleKey, srv.Name()) @@ -228,8 +234,3 @@ func (s *Server[T]) Stop(ctx context.Context) error { s.logger.Info("stopping gRPC server...", "address", s.config.Address) return api.DoUntilCtxExpired(ctx, s.grpcSrv.GracefulStop) } - -// GetGRPCServer returns the underlying gRPC server. -func (s *Server[T]) GetGRPCServer() *grpc.Server { - return s.grpcSrv -} diff --git a/server/v2/server_test.go b/server/v2/server_test.go index d71416dfb3fd..92aa3f9681c3 100644 --- a/server/v2/server_test.go +++ b/server/v2/server_test.go @@ -64,7 +64,7 @@ func TestServer(t *testing.T) { ctx := serverv2.SetServerContext(context.Background(), v, logger) app := &mockApp[transaction.Tx]{} - grpcServer, err := grpc.New[transaction.Tx](logger, app.InterfaceRegistry(), app.QueryHandlers(), app, cfg) + grpcServer, err := grpc.New[transaction.Tx](logger, app.InterfaceRegistry(), app.QueryHandlers(), app, nil, cfg) require.NoError(t, err) storeServer, err := store.New[transaction.Tx](app.Store(), cfg) diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index c001db4dff92..2f43069291c2 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -83,7 +83,7 @@ func InitRootCmd[T transaction.Tx]( // build full app! simApp := deps.SimApp - grpcServer, err := grpc.New[T](logger, simApp.InterfaceRegistry(), simApp.QueryHandlers(), simApp, deps.GlobalConfig) + grpcServer, err := grpc.New[T](logger, simApp.InterfaceRegistry(), simApp.QueryHandlers(), nil, simApp, deps.GlobalConfig) if err != nil { return nil, err } From 9315b5954cfc9c88edd7b76c4fe4cd819d1c2a68 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 11 Nov 2024 15:23:14 +0100 Subject: [PATCH 05/19] wire nodeservice --- api/cosmos/base/node/v2/query.pulsar.go | 2153 +++++++++++++++++ api/cosmos/base/node/v2/query_grpc.pb.go | 167 ++ client/v2/internal/testpb/msg_grpc.pb.go | 40 +- client/v2/internal/testpb/query_grpc.pb.go | 34 +- proto/cosmos/base/node/v2/query.proto | 40 + server/v2/api/grpc/nodeservice/query.pb.go | 1060 ++++++++ server/v2/api/grpc/nodeservice/query.pb.gw.go | 218 ++ server/v2/api/grpc/nodeservice/service.go | 52 + server/v2/api/grpc/server.go | 6 +- 9 files changed, 3749 insertions(+), 21 deletions(-) create mode 100644 api/cosmos/base/node/v2/query.pulsar.go create mode 100644 api/cosmos/base/node/v2/query_grpc.pb.go create mode 100644 proto/cosmos/base/node/v2/query.proto create mode 100644 server/v2/api/grpc/nodeservice/query.pb.go create mode 100644 server/v2/api/grpc/nodeservice/query.pb.gw.go create mode 100644 server/v2/api/grpc/nodeservice/service.go diff --git a/api/cosmos/base/node/v2/query.pulsar.go b/api/cosmos/base/node/v2/query.pulsar.go new file mode 100644 index 000000000000..16d4ab58bd92 --- /dev/null +++ b/api/cosmos/base/node/v2/query.pulsar.go @@ -0,0 +1,2153 @@ +// Code generated by protoc-gen-go-pulsar. DO NOT EDIT. +package nodev2 + +import ( + fmt "fmt" + runtime "github.com/cosmos/cosmos-proto/runtime" + _ "github.com/cosmos/gogoproto/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoiface "google.golang.org/protobuf/runtime/protoiface" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + io "io" + reflect "reflect" + sync "sync" +) + +var ( + md_ConfigRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_base_node_v2_query_proto_init() + md_ConfigRequest = File_cosmos_base_node_v2_query_proto.Messages().ByName("ConfigRequest") +} + +var _ protoreflect.Message = (*fastReflection_ConfigRequest)(nil) + +type fastReflection_ConfigRequest ConfigRequest + +func (x *ConfigRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConfigRequest)(x) +} + +func (x *ConfigRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ConfigRequest_messageType fastReflection_ConfigRequest_messageType +var _ protoreflect.MessageType = fastReflection_ConfigRequest_messageType{} + +type fastReflection_ConfigRequest_messageType struct{} + +func (x fastReflection_ConfigRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConfigRequest)(nil) +} +func (x fastReflection_ConfigRequest_messageType) New() protoreflect.Message { + return new(fastReflection_ConfigRequest) +} +func (x fastReflection_ConfigRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ConfigRequest) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ConfigRequest) Type() protoreflect.MessageType { + return _fastReflection_ConfigRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ConfigRequest) New() protoreflect.Message { + return new(fastReflection_ConfigRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ConfigRequest) Interface() protoreflect.ProtoMessage { + return (*ConfigRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ConfigRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ConfigRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ConfigRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ConfigRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ConfigRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.ConfigRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ConfigRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ConfigRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ConfigRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ConfigRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ConfigRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ConfigRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ConfigResponse protoreflect.MessageDescriptor + fd_ConfigResponse_minimum_gas_price protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_node_v2_query_proto_init() + md_ConfigResponse = File_cosmos_base_node_v2_query_proto.Messages().ByName("ConfigResponse") + fd_ConfigResponse_minimum_gas_price = md_ConfigResponse.Fields().ByName("minimum_gas_price") +} + +var _ protoreflect.Message = (*fastReflection_ConfigResponse)(nil) + +type fastReflection_ConfigResponse ConfigResponse + +func (x *ConfigResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_ConfigResponse)(x) +} + +func (x *ConfigResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ConfigResponse_messageType fastReflection_ConfigResponse_messageType +var _ protoreflect.MessageType = fastReflection_ConfigResponse_messageType{} + +type fastReflection_ConfigResponse_messageType struct{} + +func (x fastReflection_ConfigResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_ConfigResponse)(nil) +} +func (x fastReflection_ConfigResponse_messageType) New() protoreflect.Message { + return new(fastReflection_ConfigResponse) +} +func (x fastReflection_ConfigResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ConfigResponse) Descriptor() protoreflect.MessageDescriptor { + return md_ConfigResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ConfigResponse) Type() protoreflect.MessageType { + return _fastReflection_ConfigResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ConfigResponse) New() protoreflect.Message { + return new(fastReflection_ConfigResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ConfigResponse) Interface() protoreflect.ProtoMessage { + return (*ConfigResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ConfigResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.MinimumGasPrice != "" { + value := protoreflect.ValueOfString(x.MinimumGasPrice) + if !f(fd_ConfigResponse_minimum_gas_price, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ConfigResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + return x.MinimumGasPrice != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + x.MinimumGasPrice = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ConfigResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + value := x.MinimumGasPrice + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + x.MinimumGasPrice = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + panic(fmt.Errorf("field minimum_gas_price of message cosmos.base.node.v2.ConfigResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_ConfigResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v2.ConfigResponse.minimum_gas_price": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.ConfigResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.ConfigResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_ConfigResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.ConfigResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_ConfigResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ConfigResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_ConfigResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.MinimumGasPrice) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.MinimumGasPrice) > 0 { + i -= len(x.MinimumGasPrice) + copy(dAtA[i:], x.MinimumGasPrice) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.MinimumGasPrice))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*ConfigResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_StatusRequest protoreflect.MessageDescriptor +) + +func init() { + file_cosmos_base_node_v2_query_proto_init() + md_StatusRequest = File_cosmos_base_node_v2_query_proto.Messages().ByName("StatusRequest") +} + +var _ protoreflect.Message = (*fastReflection_StatusRequest)(nil) + +type fastReflection_StatusRequest StatusRequest + +func (x *StatusRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_StatusRequest)(x) +} + +func (x *StatusRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_StatusRequest_messageType fastReflection_StatusRequest_messageType +var _ protoreflect.MessageType = fastReflection_StatusRequest_messageType{} + +type fastReflection_StatusRequest_messageType struct{} + +func (x fastReflection_StatusRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_StatusRequest)(nil) +} +func (x fastReflection_StatusRequest_messageType) New() protoreflect.Message { + return new(fastReflection_StatusRequest) +} +func (x fastReflection_StatusRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_StatusRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_StatusRequest) Descriptor() protoreflect.MessageDescriptor { + return md_StatusRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_StatusRequest) Type() protoreflect.MessageType { + return _fastReflection_StatusRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_StatusRequest) New() protoreflect.Message { + return new(fastReflection_StatusRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_StatusRequest) Interface() protoreflect.ProtoMessage { + return (*StatusRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_StatusRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_StatusRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_StatusRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_StatusRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_StatusRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.StatusRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_StatusRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_StatusRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_StatusRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*StatusRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_StatusResponse protoreflect.MessageDescriptor + fd_StatusResponse_earliest_store_height protoreflect.FieldDescriptor + fd_StatusResponse_height protoreflect.FieldDescriptor + fd_StatusResponse_timestamp protoreflect.FieldDescriptor + fd_StatusResponse_app_hash protoreflect.FieldDescriptor + fd_StatusResponse_validator_hash protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_base_node_v2_query_proto_init() + md_StatusResponse = File_cosmos_base_node_v2_query_proto.Messages().ByName("StatusResponse") + fd_StatusResponse_earliest_store_height = md_StatusResponse.Fields().ByName("earliest_store_height") + fd_StatusResponse_height = md_StatusResponse.Fields().ByName("height") + fd_StatusResponse_timestamp = md_StatusResponse.Fields().ByName("timestamp") + fd_StatusResponse_app_hash = md_StatusResponse.Fields().ByName("app_hash") + fd_StatusResponse_validator_hash = md_StatusResponse.Fields().ByName("validator_hash") +} + +var _ protoreflect.Message = (*fastReflection_StatusResponse)(nil) + +type fastReflection_StatusResponse StatusResponse + +func (x *StatusResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_StatusResponse)(x) +} + +func (x *StatusResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_StatusResponse_messageType fastReflection_StatusResponse_messageType +var _ protoreflect.MessageType = fastReflection_StatusResponse_messageType{} + +type fastReflection_StatusResponse_messageType struct{} + +func (x fastReflection_StatusResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_StatusResponse)(nil) +} +func (x fastReflection_StatusResponse_messageType) New() protoreflect.Message { + return new(fastReflection_StatusResponse) +} +func (x fastReflection_StatusResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_StatusResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_StatusResponse) Descriptor() protoreflect.MessageDescriptor { + return md_StatusResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_StatusResponse) Type() protoreflect.MessageType { + return _fastReflection_StatusResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_StatusResponse) New() protoreflect.Message { + return new(fastReflection_StatusResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_StatusResponse) Interface() protoreflect.ProtoMessage { + return (*StatusResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.EarliestStoreHeight != uint64(0) { + value := protoreflect.ValueOfUint64(x.EarliestStoreHeight) + if !f(fd_StatusResponse_earliest_store_height, value) { + return + } + } + if x.Height != uint64(0) { + value := protoreflect.ValueOfUint64(x.Height) + if !f(fd_StatusResponse_height, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_StatusResponse_timestamp, value) { + return + } + } + if len(x.AppHash) != 0 { + value := protoreflect.ValueOfBytes(x.AppHash) + if !f(fd_StatusResponse_app_hash, value) { + return + } + } + if len(x.ValidatorHash) != 0 { + value := protoreflect.ValueOfBytes(x.ValidatorHash) + if !f(fd_StatusResponse_validator_hash, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + return x.EarliestStoreHeight != uint64(0) + case "cosmos.base.node.v2.StatusResponse.height": + return x.Height != uint64(0) + case "cosmos.base.node.v2.StatusResponse.timestamp": + return x.Timestamp != nil + case "cosmos.base.node.v2.StatusResponse.app_hash": + return len(x.AppHash) != 0 + case "cosmos.base.node.v2.StatusResponse.validator_hash": + return len(x.ValidatorHash) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + x.EarliestStoreHeight = uint64(0) + case "cosmos.base.node.v2.StatusResponse.height": + x.Height = uint64(0) + case "cosmos.base.node.v2.StatusResponse.timestamp": + x.Timestamp = nil + case "cosmos.base.node.v2.StatusResponse.app_hash": + x.AppHash = nil + case "cosmos.base.node.v2.StatusResponse.validator_hash": + x.ValidatorHash = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + value := x.EarliestStoreHeight + return protoreflect.ValueOfUint64(value) + case "cosmos.base.node.v2.StatusResponse.height": + value := x.Height + return protoreflect.ValueOfUint64(value) + case "cosmos.base.node.v2.StatusResponse.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "cosmos.base.node.v2.StatusResponse.app_hash": + value := x.AppHash + return protoreflect.ValueOfBytes(value) + case "cosmos.base.node.v2.StatusResponse.validator_hash": + value := x.ValidatorHash + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + x.EarliestStoreHeight = value.Uint() + case "cosmos.base.node.v2.StatusResponse.height": + x.Height = value.Uint() + case "cosmos.base.node.v2.StatusResponse.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + case "cosmos.base.node.v2.StatusResponse.app_hash": + x.AppHash = value.Bytes() + case "cosmos.base.node.v2.StatusResponse.validator_hash": + x.ValidatorHash = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v2.StatusResponse.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + panic(fmt.Errorf("field earliest_store_height of message cosmos.base.node.v2.StatusResponse is not mutable")) + case "cosmos.base.node.v2.StatusResponse.height": + panic(fmt.Errorf("field height of message cosmos.base.node.v2.StatusResponse is not mutable")) + case "cosmos.base.node.v2.StatusResponse.app_hash": + panic(fmt.Errorf("field app_hash of message cosmos.base.node.v2.StatusResponse is not mutable")) + case "cosmos.base.node.v2.StatusResponse.validator_hash": + panic(fmt.Errorf("field validator_hash of message cosmos.base.node.v2.StatusResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_StatusResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.base.node.v2.StatusResponse.earliest_store_height": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.base.node.v2.StatusResponse.height": + return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.base.node.v2.StatusResponse.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "cosmos.base.node.v2.StatusResponse.app_hash": + return protoreflect.ValueOfBytes(nil) + case "cosmos.base.node.v2.StatusResponse.validator_hash": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) + } + panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_StatusResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.StatusResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_StatusResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_StatusResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_StatusResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*StatusResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.EarliestStoreHeight != 0 { + n += 1 + runtime.Sov(uint64(x.EarliestStoreHeight)) + } + if x.Height != 0 { + n += 1 + runtime.Sov(uint64(x.Height)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.AppHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.ValidatorHash) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*StatusResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.ValidatorHash) > 0 { + i -= len(x.ValidatorHash) + copy(dAtA[i:], x.ValidatorHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorHash))) + i-- + dAtA[i] = 0x2a + } + if len(x.AppHash) > 0 { + i -= len(x.AppHash) + copy(dAtA[i:], x.AppHash) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) + i-- + dAtA[i] = 0x22 + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + if x.Height != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) + i-- + dAtA[i] = 0x10 + } + if x.EarliestStoreHeight != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.EarliestStoreHeight)) + i-- + dAtA[i] = 0x8 + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*StatusResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) + } + x.EarliestStoreHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.EarliestStoreHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + x.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.AppHash = append(x.AppHash[:0], dAtA[iNdEx:postIndex]...) + if x.AppHash == nil { + x.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.ValidatorHash = append(x.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if x.ValidatorHash == nil { + x.ValidatorHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.0 +// protoc (unknown) +// source: cosmos/base/node/v2/query.proto + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// ConfigRequest defines the request structure for the Config gRPC query. +type ConfigRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ConfigRequest) Reset() { + *x = ConfigRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigRequest) ProtoMessage() {} + +// Deprecated: Use ConfigRequest.ProtoReflect.Descriptor instead. +func (*ConfigRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{0} +} + +// ConfigResponse defines the response structure for the Config gRPC query. +type ConfigResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` +} + +func (x *ConfigResponse) Reset() { + *x = ConfigResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfigResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfigResponse) ProtoMessage() {} + +// Deprecated: Use ConfigResponse.ProtoReflect.Descriptor instead. +func (*ConfigResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{1} +} + +func (x *ConfigResponse) GetMinimumGasPrice() string { + if x != nil { + return x.MinimumGasPrice + } + return "" +} + +// StatusRequest defines the request structure for the status of a node. +type StatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *StatusRequest) Reset() { + *x = StatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusRequest) ProtoMessage() {} + +// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. +func (*StatusRequest) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{2} +} + +// StatusResponse defines the response structure for the status of a node. +type StatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` // earliest block height available in the store + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // current block height + Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header +} + +func (x *StatusResponse) Reset() { + *x = StatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_base_node_v2_query_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusResponse) ProtoMessage() {} + +// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. +func (*StatusResponse) Descriptor() ([]byte, []int) { + return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{3} +} + +func (x *StatusResponse) GetEarliestStoreHeight() uint64 { + if x != nil { + return x.EarliestStoreHeight + } + return 0 +} + +func (x *StatusResponse) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *StatusResponse) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + +func (x *StatusResponse) GetAppHash() []byte { + if x != nil { + return x.AppHash + } + return nil +} + +func (x *StatusResponse) GetValidatorHash() []byte { + if x != nil { + return x.ValidatorHash + } + return nil +} + +var File_cosmos_base_node_v2_query_proto protoreflect.FileDescriptor + +var file_cosmos_base_node_v2_query_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, + 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x0e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, + 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, + 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, + 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, + 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, + 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, + 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, + 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, + 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x32, 0xf9, 0x01, 0x0a, + 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, + 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x76, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, + 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, + 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x32, 0xa2, + 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, + 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, + 0x32, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, + 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, + 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cosmos_base_node_v2_query_proto_rawDescOnce sync.Once + file_cosmos_base_node_v2_query_proto_rawDescData = file_cosmos_base_node_v2_query_proto_rawDesc +) + +func file_cosmos_base_node_v2_query_proto_rawDescGZIP() []byte { + file_cosmos_base_node_v2_query_proto_rawDescOnce.Do(func() { + file_cosmos_base_node_v2_query_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_base_node_v2_query_proto_rawDescData) + }) + return file_cosmos_base_node_v2_query_proto_rawDescData +} + +var file_cosmos_base_node_v2_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_base_node_v2_query_proto_goTypes = []interface{}{ + (*ConfigRequest)(nil), // 0: cosmos.base.node.v2.ConfigRequest + (*ConfigResponse)(nil), // 1: cosmos.base.node.v2.ConfigResponse + (*StatusRequest)(nil), // 2: cosmos.base.node.v2.StatusRequest + (*StatusResponse)(nil), // 3: cosmos.base.node.v2.StatusResponse + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp +} +var file_cosmos_base_node_v2_query_proto_depIdxs = []int32{ + 4, // 0: cosmos.base.node.v2.StatusResponse.timestamp:type_name -> google.protobuf.Timestamp + 0, // 1: cosmos.base.node.v2.Service.Config:input_type -> cosmos.base.node.v2.ConfigRequest + 2, // 2: cosmos.base.node.v2.Service.Status:input_type -> cosmos.base.node.v2.StatusRequest + 1, // 3: cosmos.base.node.v2.Service.Config:output_type -> cosmos.base.node.v2.ConfigResponse + 3, // 4: cosmos.base.node.v2.Service.Status:output_type -> cosmos.base.node.v2.StatusResponse + 3, // [3:5] is the sub-list for method output_type + 1, // [1:3] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_cosmos_base_node_v2_query_proto_init() } +func file_cosmos_base_node_v2_query_proto_init() { + if File_cosmos_base_node_v2_query_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cosmos_base_node_v2_query_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_node_v2_query_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfigResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_node_v2_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_base_node_v2_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cosmos_base_node_v2_query_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_cosmos_base_node_v2_query_proto_goTypes, + DependencyIndexes: file_cosmos_base_node_v2_query_proto_depIdxs, + MessageInfos: file_cosmos_base_node_v2_query_proto_msgTypes, + }.Build() + File_cosmos_base_node_v2_query_proto = out.File + file_cosmos_base_node_v2_query_proto_rawDesc = nil + file_cosmos_base_node_v2_query_proto_goTypes = nil + file_cosmos_base_node_v2_query_proto_depIdxs = nil +} diff --git a/api/cosmos/base/node/v2/query_grpc.pb.go b/api/cosmos/base/node/v2/query_grpc.pb.go new file mode 100644 index 000000000000..bbc87612fa09 --- /dev/null +++ b/api/cosmos/base/node/v2/query_grpc.pb.go @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.5.1 +// - protoc (unknown) +// source: cosmos/base/node/v2/query.proto + +package nodev2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Service_Config_FullMethodName = "/cosmos.base.node.v2.Service/Config" + Service_Status_FullMethodName = "/cosmos.base.node.v2.Service/Status" +) + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service defines the gRPC querier service for node related queries. +type ServiceClient interface { + // Config queries for the operator configuration. + Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) + // Status queries for the node status. + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ConfigResponse) + err := c.cc.Invoke(ctx, Service_Config_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(StatusResponse) + err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility. +// +// Service defines the gRPC querier service for node related queries. +type ServiceServer interface { + // Config queries for the operator configuration. + Config(context.Context, *ConfigRequest) (*ConfigResponse, error) + // Status queries for the node status. + Status(context.Context, *StatusRequest) (*StatusResponse, error) + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedServiceServer struct{} + +func (UnimplementedServiceServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") +} +func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} +func (UnimplementedServiceServer) testEmbeddedByValue() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + // If the following call pancis, it indicates UnimplementedServiceServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } + s.RegisterService(&Service_ServiceDesc, srv) +} + +func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Config(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Config_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Config(ctx, req.(*ConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Service_Status_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Service_ServiceDesc is the grpc.ServiceDesc for Service service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Service_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.node.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Config", + Handler: _Service_Config_Handler, + }, + { + MethodName: "Status", + Handler: _Service_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/node/v2/query.proto", +} diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go index b9ccec990607..703528e20e31 100644 --- a/client/v2/internal/testpb/msg_grpc.pb.go +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: testpb/msg.proto @@ -15,8 +15,13 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Msg_Send_FullMethodName = "/testpb.Msg/Send" + Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback" +) // MsgClient is the client API for Msg service. // @@ -36,8 +41,9 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient { } func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgResponse) - err := c.cc.Invoke(ctx, "/testpb.Msg/Send", in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Send_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -45,8 +51,9 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO } func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(MsgClawbackResponse) - err := c.cc.Invoke(ctx, "/testpb.Msg/Clawback", in, out, opts...) + err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -55,7 +62,7 @@ func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts . // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer -// for forward compatibility +// for forward compatibility. type MsgServer interface { // Send a request and returns the request as a response. Send(context.Context, *MsgRequest) (*MsgResponse, error) @@ -63,9 +70,12 @@ type MsgServer interface { mustEmbedUnimplementedMsgServer() } -// UnimplementedMsgServer must be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} +// UnimplementedMsgServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedMsgServer struct{} func (UnimplementedMsgServer) Send(context.Context, *MsgRequest) (*MsgResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") @@ -74,6 +84,7 @@ func (UnimplementedMsgServer) Clawback(context.Context, *MsgClawbackRequest) (*M return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") } func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} +func (UnimplementedMsgServer) testEmbeddedByValue() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to MsgServer will @@ -83,6 +94,13 @@ type UnsafeMsgServer interface { } func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) { + // If the following call pancis, it indicates UnimplementedMsgServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Msg_ServiceDesc, srv) } @@ -96,7 +114,7 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/testpb.Msg/Send", + FullMethod: Msg_Send_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Send(ctx, req.(*MsgRequest)) @@ -114,7 +132,7 @@ func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/testpb.Msg/Clawback", + FullMethod: Msg_Clawback_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest)) diff --git a/client/v2/internal/testpb/query_grpc.pb.go b/client/v2/internal/testpb/query_grpc.pb.go index 56d177ddc86f..7b31c042299a 100644 --- a/client/v2/internal/testpb/query_grpc.pb.go +++ b/client/v2/internal/testpb/query_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: testpb/query.proto @@ -15,8 +15,12 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Query_Echo_FullMethodName = "/testpb.Query/Echo" +) // QueryClient is the client API for Query service. // @@ -35,8 +39,9 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { } func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(EchoResponse) - err := c.cc.Invoke(ctx, "/testpb.Query/Echo", in, out, opts...) + err := c.cc.Invoke(ctx, Query_Echo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -45,21 +50,25 @@ func (c *queryClient) Echo(ctx context.Context, in *EchoRequest, opts ...grpc.Ca // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer -// for forward compatibility +// for forward compatibility. type QueryServer interface { // Echo returns the request in the response Echo(context.Context, *EchoRequest) (*EchoResponse, error) mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer must be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} +// UnimplementedQueryServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedQueryServer struct{} func (UnimplementedQueryServer) Echo(context.Context, *EchoRequest) (*EchoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Echo not implemented") } func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} +func (UnimplementedQueryServer) testEmbeddedByValue() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to QueryServer will @@ -69,6 +78,13 @@ type UnsafeQueryServer interface { } func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + // If the following call pancis, it indicates UnimplementedQueryServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Query_ServiceDesc, srv) } @@ -82,7 +98,7 @@ func _Query_Echo_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/testpb.Query/Echo", + FullMethod: Query_Echo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(QueryServer).Echo(ctx, req.(*EchoRequest)) diff --git a/proto/cosmos/base/node/v2/query.proto b/proto/cosmos/base/node/v2/query.proto new file mode 100644 index 000000000000..db6f802e5c1e --- /dev/null +++ b/proto/cosmos/base/node/v2/query.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; +package cosmos.base.node.v2; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "cosmossdk.io/server/v2/api/grpc/nodeservice"; + +// Service defines the gRPC querier service for node related queries. +service Service { + // Config queries for the operator configuration. + rpc Config(ConfigRequest) returns (ConfigResponse) { + option (google.api.http).get = "/cosmos/base/node/v2/config"; + } + // Status queries for the node status. + rpc Status(StatusRequest) returns (StatusResponse) { + option (google.api.http).get = "/cosmos/base/node/v2/status"; + } +} + +// ConfigRequest defines the request structure for the Config gRPC query. +message ConfigRequest {} + +// ConfigResponse defines the response structure for the Config gRPC query. +message ConfigResponse { + string minimum_gas_price = 1; +} + +// StatusRequest defines the request structure for the status of a node. +message StatusRequest {} + +// StatusResponse defines the response structure for the status of a node. +message StatusResponse { + uint64 earliest_store_height = 1; // earliest block height available in the store + uint64 height = 2; // current block height + google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 4; // app hash of the current block + bytes validator_hash = 5; // validator hash provided by the consensus header +} diff --git a/server/v2/api/grpc/nodeservice/query.pb.go b/server/v2/api/grpc/nodeservice/query.pb.go new file mode 100644 index 000000000000..df4b5dacd069 --- /dev/null +++ b/server/v2/api/grpc/nodeservice/query.pb.go @@ -0,0 +1,1060 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/base/node/v2/query.proto + +package nodeservice + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ConfigRequest defines the request structure for the Config gRPC query. +type ConfigRequest struct { +} + +func (m *ConfigRequest) Reset() { *m = ConfigRequest{} } +func (m *ConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ConfigRequest) ProtoMessage() {} +func (*ConfigRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e86a941b0be4e1ff, []int{0} +} +func (m *ConfigRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConfigRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigRequest.Merge(m, src) +} +func (m *ConfigRequest) XXX_Size() int { + return m.Size() +} +func (m *ConfigRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigRequest proto.InternalMessageInfo + +// ConfigResponse defines the response structure for the Config gRPC query. +type ConfigResponse struct { + MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"` +} + +func (m *ConfigResponse) Reset() { *m = ConfigResponse{} } +func (m *ConfigResponse) String() string { return proto.CompactTextString(m) } +func (*ConfigResponse) ProtoMessage() {} +func (*ConfigResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e86a941b0be4e1ff, []int{1} +} +func (m *ConfigResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConfigResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConfigResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConfigResponse.Merge(m, src) +} +func (m *ConfigResponse) XXX_Size() int { + return m.Size() +} +func (m *ConfigResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConfigResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ConfigResponse proto.InternalMessageInfo + +func (m *ConfigResponse) GetMinimumGasPrice() string { + if m != nil { + return m.MinimumGasPrice + } + return "" +} + +// StatusRequest defines the request structure for the status of a node. +type StatusRequest struct { +} + +func (m *StatusRequest) Reset() { *m = StatusRequest{} } +func (m *StatusRequest) String() string { return proto.CompactTextString(m) } +func (*StatusRequest) ProtoMessage() {} +func (*StatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e86a941b0be4e1ff, []int{2} +} +func (m *StatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusRequest.Merge(m, src) +} +func (m *StatusRequest) XXX_Size() int { + return m.Size() +} +func (m *StatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_StatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusRequest proto.InternalMessageInfo + +// StatusResponse defines the response structure for the status of a node. +type StatusResponse struct { + EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + Timestamp *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` + AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` +} + +func (m *StatusResponse) Reset() { *m = StatusResponse{} } +func (m *StatusResponse) String() string { return proto.CompactTextString(m) } +func (*StatusResponse) ProtoMessage() {} +func (*StatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e86a941b0be4e1ff, []int{3} +} +func (m *StatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_StatusResponse.Merge(m, src) +} +func (m *StatusResponse) XXX_Size() int { + return m.Size() +} +func (m *StatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_StatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_StatusResponse proto.InternalMessageInfo + +func (m *StatusResponse) GetEarliestStoreHeight() uint64 { + if m != nil { + return m.EarliestStoreHeight + } + return 0 +} + +func (m *StatusResponse) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *StatusResponse) GetTimestamp() *time.Time { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *StatusResponse) GetAppHash() []byte { + if m != nil { + return m.AppHash + } + return nil +} + +func (m *StatusResponse) GetValidatorHash() []byte { + if m != nil { + return m.ValidatorHash + } + return nil +} + +func init() { + proto.RegisterType((*ConfigRequest)(nil), "cosmos.base.node.v2.ConfigRequest") + proto.RegisterType((*ConfigResponse)(nil), "cosmos.base.node.v2.ConfigResponse") + proto.RegisterType((*StatusRequest)(nil), "cosmos.base.node.v2.StatusRequest") + proto.RegisterType((*StatusResponse)(nil), "cosmos.base.node.v2.StatusResponse") +} + +func init() { proto.RegisterFile("cosmos/base/node/v2/query.proto", fileDescriptor_e86a941b0be4e1ff) } + +var fileDescriptor_e86a941b0be4e1ff = []byte{ + // 453 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x6f, 0xd3, 0x30, + 0x14, 0xc7, 0xeb, 0x51, 0x3a, 0x66, 0x58, 0x27, 0x32, 0x40, 0xa5, 0x40, 0x5a, 0x75, 0x42, 0xaa, + 0x40, 0xb2, 0xa5, 0x70, 0x45, 0x1c, 0x86, 0x10, 0x3b, 0xa2, 0x94, 0x13, 0x97, 0xc8, 0x4d, 0xbd, + 0xc4, 0xa2, 0x89, 0x3d, 0x3f, 0x27, 0x12, 0x57, 0x3e, 0xc1, 0x24, 0xbe, 0x14, 0xc7, 0x49, 0x5c, + 0x38, 0x01, 0x6a, 0xf9, 0x12, 0xdc, 0x90, 0xed, 0x64, 0xa8, 0xd2, 0xca, 0x6e, 0xf6, 0xfb, 0xff, + 0xde, 0xff, 0xc9, 0xff, 0x67, 0x3c, 0x4a, 0x25, 0x14, 0x12, 0xe8, 0x9c, 0x01, 0xa7, 0xa5, 0x5c, + 0x70, 0x5a, 0x47, 0xf4, 0xac, 0xe2, 0xfa, 0x13, 0x51, 0x5a, 0x1a, 0x19, 0x1c, 0x7a, 0x80, 0x58, + 0x80, 0x58, 0x80, 0xd4, 0xd1, 0xf0, 0x71, 0x26, 0x65, 0xb6, 0xe4, 0x94, 0x29, 0x41, 0x59, 0x59, + 0x4a, 0xc3, 0x8c, 0x90, 0x25, 0xf8, 0x96, 0xe1, 0xa8, 0x51, 0xdd, 0x6d, 0x5e, 0x9d, 0x52, 0x23, + 0x0a, 0x0e, 0x86, 0x15, 0xaa, 0x01, 0xee, 0x65, 0x32, 0x93, 0xee, 0x48, 0xed, 0xc9, 0x57, 0x27, + 0x07, 0x78, 0xff, 0xb5, 0x2c, 0x4f, 0x45, 0x16, 0xf3, 0xb3, 0x8a, 0x83, 0x99, 0xbc, 0xc4, 0xfd, + 0xb6, 0x00, 0x4a, 0x96, 0xc0, 0x83, 0x67, 0xf8, 0x6e, 0x21, 0x4a, 0x51, 0x54, 0x45, 0x92, 0x31, + 0x48, 0x94, 0x16, 0x29, 0x1f, 0xa0, 0x31, 0x9a, 0xee, 0xc5, 0x07, 0x8d, 0xf0, 0x96, 0xc1, 0x3b, + 0x5b, 0xb6, 0x76, 0x33, 0xc3, 0x4c, 0x05, 0xad, 0xdd, 0x0f, 0x84, 0xfb, 0x6d, 0xa5, 0xf1, 0x8b, + 0xf0, 0x7d, 0xce, 0xf4, 0x52, 0x70, 0x30, 0x09, 0x18, 0xa9, 0x79, 0x92, 0x73, 0x91, 0xe5, 0xc6, + 0x79, 0x76, 0xe3, 0xc3, 0x56, 0x9c, 0x59, 0xed, 0xc4, 0x49, 0xc1, 0x03, 0xdc, 0x6b, 0xa0, 0x1d, + 0x07, 0x35, 0xb7, 0xe0, 0x15, 0xde, 0xbb, 0x7c, 0xe7, 0xe0, 0xc6, 0x18, 0x4d, 0x6f, 0x47, 0x43, + 0xe2, 0x93, 0x20, 0x6d, 0x12, 0xe4, 0x7d, 0x4b, 0x1c, 0x77, 0xcf, 0x7f, 0x8e, 0x50, 0xfc, 0xaf, + 0x25, 0x78, 0x88, 0x6f, 0x31, 0xa5, 0x92, 0x9c, 0x41, 0x3e, 0xe8, 0x8e, 0xd1, 0xf4, 0x4e, 0xbc, + 0xcb, 0x94, 0x3a, 0x61, 0x90, 0x07, 0x4f, 0x71, 0xbf, 0x66, 0x4b, 0xb1, 0x60, 0x46, 0x6a, 0x0f, + 0xdc, 0x74, 0xc0, 0xfe, 0x65, 0xd5, 0x62, 0xd1, 0x1f, 0x84, 0x77, 0x67, 0x5c, 0xd7, 0x22, 0xe5, + 0x41, 0x8d, 0x7b, 0x3e, 0xbb, 0x60, 0x42, 0xae, 0xd8, 0x20, 0xd9, 0x48, 0x7a, 0x78, 0xf4, 0x5f, + 0xc6, 0x87, 0x35, 0x39, 0xfa, 0xfc, 0xed, 0xf7, 0x97, 0x9d, 0x27, 0xc1, 0x23, 0x7a, 0xd5, 0x9f, + 0x49, 0xfd, 0xb4, 0x1a, 0xf7, 0x7c, 0xc6, 0x5b, 0xe6, 0x6e, 0xac, 0x64, 0xcb, 0xdc, 0xcd, 0x25, + 0x5d, 0x33, 0x17, 0x1c, 0x7c, 0xfc, 0xe6, 0xeb, 0x2a, 0x44, 0x17, 0xab, 0x10, 0xfd, 0x5a, 0x85, + 0xe8, 0x7c, 0x1d, 0x76, 0x2e, 0xd6, 0x61, 0xe7, 0xfb, 0x3a, 0xec, 0x7c, 0x78, 0xee, 0xbb, 0x60, + 0xf1, 0x91, 0x08, 0x49, 0x81, 0xeb, 0x9a, 0x6b, 0xdb, 0x68, 0xff, 0x6e, 0xa6, 0x55, 0xea, 0x9c, + 0xc0, 0xc7, 0x36, 0xef, 0xb9, 0x4d, 0xbd, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x2c, 0xf6, + 0x43, 0x17, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type ServiceClient interface { + // Config queries for the operator configuration. + Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) + // Status queries for the node status. + Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) +} + +type serviceClient struct { + cc grpc1.ClientConn +} + +func NewServiceClient(cc grpc1.ClientConn) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) { + out := new(ConfigResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.node.v2.Service/Config", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { + out := new(StatusResponse) + err := c.cc.Invoke(ctx, "/cosmos.base.node.v2.Service/Status", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ServiceServer is the server API for Service service. +type ServiceServer interface { + // Config queries for the operator configuration. + Config(context.Context, *ConfigRequest) (*ConfigResponse, error) + // Status queries for the node status. + Status(context.Context, *StatusRequest) (*StatusResponse, error) +} + +// UnimplementedServiceServer can be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (*UnimplementedServiceServer) Config(ctx context.Context, req *ConfigRequest) (*ConfigResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") +} +func (*UnimplementedServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") +} + +func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfigRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Config(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.node.v2.Service/Config", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Config(ctx, req.(*ConfigRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(StatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Status(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.base.node.v2.Service/Status", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var Service_serviceDesc = _Service_serviceDesc +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.base.node.v2.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Config", + Handler: _Service_Config_Handler, + }, + { + MethodName: "Status", + Handler: _Service_Status_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/base/node/v2/query.proto", +} + +func (m *ConfigRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ConfigResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConfigResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MinimumGasPrice) > 0 { + i -= len(m.MinimumGasPrice) + copy(dAtA[i:], m.MinimumGasPrice) + i = encodeVarintQuery(dAtA, i, uint64(len(m.MinimumGasPrice))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StatusRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *StatusResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorHash) > 0 { + i -= len(m.ValidatorHash) + copy(dAtA[i:], m.ValidatorHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorHash))) + i-- + dAtA[i] = 0x2a + } + if len(m.AppHash) > 0 { + i -= len(m.AppHash) + copy(dAtA[i:], m.AppHash) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AppHash))) + i-- + dAtA[i] = 0x22 + } + if m.Timestamp != nil { + n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintQuery(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if m.EarliestStoreHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.EarliestStoreHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ConfigRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ConfigResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MinimumGasPrice) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *StatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *StatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.EarliestStoreHeight != 0 { + n += 1 + sovQuery(uint64(m.EarliestStoreHeight)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Timestamp != nil { + l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp) + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.AppHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.ValidatorHash) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ConfigRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConfigResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConfigResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConfigResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinimumGasPrice = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StatusResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) + } + m.EarliestStoreHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EarliestStoreHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timestamp == nil { + m.Timestamp = new(time.Time) + } + if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) + if m.AppHash == nil { + m.AppHash = []byte{} + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorHash = append(m.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorHash == nil { + m.ValidatorHash = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/server/v2/api/grpc/nodeservice/query.pb.gw.go b/server/v2/api/grpc/nodeservice/query.pb.gw.go new file mode 100644 index 000000000000..e6c9e4d772c4 --- /dev/null +++ b/server/v2/api/grpc/nodeservice/query.pb.gw.go @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/base/node/v2/query.proto + +/* +Package nodeservice is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package nodeservice + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfigRequest + var metadata runtime.ServerMetadata + + msg, err := client.Config(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_Config_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfigRequest + var metadata runtime.ServerMetadata + + msg, err := server.Config(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq StatusRequest + var metadata runtime.ServerMetadata + + msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq StatusRequest + var metadata runtime.ServerMetadata + + msg, err := server.Status(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterServiceHandlerServer registers the http handlers for service Service to "mux". +// UnaryRPC :call ServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead. +func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error { + + mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_Config_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Service_Status_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterServiceHandler(ctx, mux, conn) +} + +// RegisterServiceHandler registers the http handlers for service Service to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterServiceHandlerClient(ctx, mux, NewServiceClient(conn)) +} + +// RegisterServiceHandlerClient registers the http handlers for service Service +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "ServiceClient" to call the correct interceptors. +func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error { + + mux.Handle("GET", pattern_Service_Config_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_Config_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Config_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Service_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Service_Status_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Service_Config_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v2", "config"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Service_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v2", "status"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Service_Config_0 = runtime.ForwardResponseMessage + + forward_Service_Status_0 = runtime.ForwardResponseMessage +) diff --git a/server/v2/api/grpc/nodeservice/service.go b/server/v2/api/grpc/nodeservice/service.go new file mode 100644 index 000000000000..adaafbed1a2c --- /dev/null +++ b/server/v2/api/grpc/nodeservice/service.go @@ -0,0 +1,52 @@ +package nodeservice + +import ( + context "context" + "errors" + + "cosmossdk.io/core/appmodule" + corecontext "cosmossdk.io/core/context" + "cosmossdk.io/core/server" +) + +var _ ServiceServer = queryServer{} + +type queryServer struct { + cfg server.ConfigMap +} + +func NewQueryServer(cfg server.ConfigMap) ServiceServer { + return queryServer{cfg: cfg} +} + +func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigResponse, error) { + minGasPricesStr := "" + minGasPrices, ok := s.cfg["server.minimum_gas_price"] + if !ok { + minGasPricesStr = minGasPrices.(string) + } + + return &ConfigResponse{ + MinimumGasPrice: minGasPricesStr, + }, nil +} + +func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusResponse, error) { + environment, ok := ctx.Value(corecontext.EnvironmentContextKey).(appmodule.Environment) + if !ok { + return nil, errors.New("environment not set") + } + + headerInfo := environment.HeaderService.HeaderInfo(ctx) + + return &StatusResponse{ + // TODO: Get earliest version from store. + // + // Ref: ... + // EarliestStoreHeight: sdkCtx.MultiStore(), + Height: uint64(headerInfo.Height), + Timestamp: &headerInfo.Time, + AppHash: headerInfo.AppHash, + ValidatorHash: headerInfo.Hash, + }, nil +} diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index 9b40d3d5fdd1..e3a0c4e1ce68 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -26,6 +26,7 @@ import ( "cosmossdk.io/log" serverv2 "cosmossdk.io/server/v2" "cosmossdk.io/server/v2/api/grpc/gogoreflection" + "cosmossdk.io/server/v2/api/grpc/nodeservice" ) const ( @@ -72,9 +73,12 @@ func New[T transaction.Tx]( // reflection allows external clients to see what services and methods the gRPC server exposes. gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) - // Register V2 grpc handlers + // register V2 grpc handlers RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) + // register node service + nodeservice.RegisterServiceServer(grpcSrv, nodeservice.NewQueryServer(cfg)) + // register extra handlers on the grpc server for _, fn := range extraGRPCHandlers { fn(grpcSrv) From e15a6758364ba1c704c96b752a1dc1630edaf1ab Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 11 Nov 2024 15:30:30 +0100 Subject: [PATCH 06/19] simplify --- api/cosmos/base/node/v2/query.pulsar.go | 166 +++++++-------------- proto/cosmos/base/node/v2/query.proto | 9 +- server/v2/api/grpc/nodeservice/query.pb.go | 111 +++++--------- server/v2/api/grpc/nodeservice/service.go | 4 - 4 files changed, 94 insertions(+), 196 deletions(-) diff --git a/api/cosmos/base/node/v2/query.pulsar.go b/api/cosmos/base/node/v2/query.pulsar.go index 16d4ab58bd92..00373bb0df86 100644 --- a/api/cosmos/base/node/v2/query.pulsar.go +++ b/api/cosmos/base/node/v2/query.pulsar.go @@ -1148,18 +1148,16 @@ func (x *fastReflection_StatusRequest) ProtoMethods() *protoiface.Methods { } var ( - md_StatusResponse protoreflect.MessageDescriptor - fd_StatusResponse_earliest_store_height protoreflect.FieldDescriptor - fd_StatusResponse_height protoreflect.FieldDescriptor - fd_StatusResponse_timestamp protoreflect.FieldDescriptor - fd_StatusResponse_app_hash protoreflect.FieldDescriptor - fd_StatusResponse_validator_hash protoreflect.FieldDescriptor + md_StatusResponse protoreflect.MessageDescriptor + fd_StatusResponse_height protoreflect.FieldDescriptor + fd_StatusResponse_timestamp protoreflect.FieldDescriptor + fd_StatusResponse_app_hash protoreflect.FieldDescriptor + fd_StatusResponse_validator_hash protoreflect.FieldDescriptor ) func init() { file_cosmos_base_node_v2_query_proto_init() md_StatusResponse = File_cosmos_base_node_v2_query_proto.Messages().ByName("StatusResponse") - fd_StatusResponse_earliest_store_height = md_StatusResponse.Fields().ByName("earliest_store_height") fd_StatusResponse_height = md_StatusResponse.Fields().ByName("height") fd_StatusResponse_timestamp = md_StatusResponse.Fields().ByName("timestamp") fd_StatusResponse_app_hash = md_StatusResponse.Fields().ByName("app_hash") @@ -1231,12 +1229,6 @@ func (x *fastReflection_StatusResponse) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.EarliestStoreHeight != uint64(0) { - value := protoreflect.ValueOfUint64(x.EarliestStoreHeight) - if !f(fd_StatusResponse_earliest_store_height, value) { - return - } - } if x.Height != uint64(0) { value := protoreflect.ValueOfUint64(x.Height) if !f(fd_StatusResponse_height, value) { @@ -1276,8 +1268,6 @@ func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescripto // a repeated field is populated if it is non-empty. func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - return x.EarliestStoreHeight != uint64(0) case "cosmos.base.node.v2.StatusResponse.height": return x.Height != uint64(0) case "cosmos.base.node.v2.StatusResponse.timestamp": @@ -1302,8 +1292,6 @@ func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) boo // Clear is a mutating operation and unsafe for concurrent use. func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - x.EarliestStoreHeight = uint64(0) case "cosmos.base.node.v2.StatusResponse.height": x.Height = uint64(0) case "cosmos.base.node.v2.StatusResponse.timestamp": @@ -1328,9 +1316,6 @@ func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { // of the value; to obtain a mutable reference, use Mutable. func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - value := x.EarliestStoreHeight - return protoreflect.ValueOfUint64(value) case "cosmos.base.node.v2.StatusResponse.height": value := x.Height return protoreflect.ValueOfUint64(value) @@ -1363,8 +1348,6 @@ func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescrip // Set is a mutating operation and unsafe for concurrent use. func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - x.EarliestStoreHeight = value.Uint() case "cosmos.base.node.v2.StatusResponse.height": x.Height = value.Uint() case "cosmos.base.node.v2.StatusResponse.timestamp": @@ -1398,8 +1381,6 @@ func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) x.Timestamp = new(timestamppb.Timestamp) } return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - panic(fmt.Errorf("field earliest_store_height of message cosmos.base.node.v2.StatusResponse is not mutable")) case "cosmos.base.node.v2.StatusResponse.height": panic(fmt.Errorf("field height of message cosmos.base.node.v2.StatusResponse is not mutable")) case "cosmos.base.node.v2.StatusResponse.app_hash": @@ -1419,8 +1400,6 @@ func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) // For lists, maps, and messages, this returns a new, empty, mutable value. func (x *fastReflection_StatusResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.earliest_store_height": - return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.base.node.v2.StatusResponse.height": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.base.node.v2.StatusResponse.timestamp": @@ -1499,9 +1478,6 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - if x.EarliestStoreHeight != 0 { - n += 1 + runtime.Sov(uint64(x.EarliestStoreHeight)) - } if x.Height != 0 { n += 1 + runtime.Sov(uint64(x.Height)) } @@ -1551,14 +1527,14 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], x.ValidatorHash) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorHash))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(x.AppHash) > 0 { i -= len(x.AppHash) copy(dAtA[i:], x.AppHash) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if x.Timestamp != nil { encoded, err := options.Marshal(x.Timestamp) @@ -1572,16 +1548,11 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { copy(dAtA[i:], encoded) i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } if x.Height != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) i-- - dAtA[i] = 0x10 - } - if x.EarliestStoreHeight != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.EarliestStoreHeight)) - i-- dAtA[i] = 0x8 } if input.Buf != nil { @@ -1634,25 +1605,6 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) - } - x.EarliestStoreHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.EarliestStoreHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } @@ -1671,7 +1623,7 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { break } } - case 3: + case 2: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } @@ -1707,7 +1659,7 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } @@ -1741,7 +1693,7 @@ func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { x.AppHash = []byte{} } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) } @@ -1919,11 +1871,10 @@ type StatusResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` // earliest block height available in the store - Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` // current block height - Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp - AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block - ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` // current block height + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block + ValidatorHash []byte `protobuf:"bytes,4,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header } func (x *StatusResponse) Reset() { @@ -1946,13 +1897,6 @@ func (*StatusResponse) Descriptor() ([]byte, []int) { return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{3} } -func (x *StatusResponse) GetEarliestStoreHeight() uint64 { - if x != nil { - return x.EarliestStoreHeight - } - return 0 -} - func (x *StatusResponse) GetHeight() uint64 { if x != nil { return x.Height @@ -1998,50 +1942,46 @@ var file_cosmos_base_node_v2_query_proto_rawDesc = []byte{ 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xde, 0x01, 0x0a, 0x0e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, - 0x0a, 0x15, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x65, - 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x48, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, - 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, - 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, - 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x32, 0xf9, 0x01, 0x0a, - 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaa, 0x01, 0x0a, 0x0e, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, + 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x32, 0xf9, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, - 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x76, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, + 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, + 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x76, 0x0a, 0x06, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, - 0x32, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, - 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x32, 0xa2, - 0x02, 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, - 0x61, 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, - 0x32, 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, - 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, - 0x73, 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, + 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, + 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x42, + 0x4e, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, + 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1f, + 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, + 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, + 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/cosmos/base/node/v2/query.proto b/proto/cosmos/base/node/v2/query.proto index db6f802e5c1e..76120c2f784a 100644 --- a/proto/cosmos/base/node/v2/query.proto +++ b/proto/cosmos/base/node/v2/query.proto @@ -32,9 +32,8 @@ message StatusRequest {} // StatusResponse defines the response structure for the status of a node. message StatusResponse { - uint64 earliest_store_height = 1; // earliest block height available in the store - uint64 height = 2; // current block height - google.protobuf.Timestamp timestamp = 3 [(gogoproto.stdtime) = true]; // block height timestamp - bytes app_hash = 4; // app hash of the current block - bytes validator_hash = 5; // validator hash provided by the consensus header + uint64 height = 1; // current block height + google.protobuf.Timestamp timestamp = 2 [(gogoproto.stdtime) = true]; // block height timestamp + bytes app_hash = 3; // app hash of the current block + bytes validator_hash = 4; // validator hash provided by the consensus header } diff --git a/server/v2/api/grpc/nodeservice/query.pb.go b/server/v2/api/grpc/nodeservice/query.pb.go index df4b5dacd069..08ef1d0e9fe9 100644 --- a/server/v2/api/grpc/nodeservice/query.pb.go +++ b/server/v2/api/grpc/nodeservice/query.pb.go @@ -154,11 +154,10 @@ var xxx_messageInfo_StatusRequest proto.InternalMessageInfo // StatusResponse defines the response structure for the status of a node. type StatusResponse struct { - EarliestStoreHeight uint64 `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"` - Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Timestamp *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` - AppHash []byte `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - ValidatorHash []byte `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Timestamp *time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` + AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` + ValidatorHash []byte `protobuf:"bytes,4,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` } func (m *StatusResponse) Reset() { *m = StatusResponse{} } @@ -194,13 +193,6 @@ func (m *StatusResponse) XXX_DiscardUnknown() { var xxx_messageInfo_StatusResponse proto.InternalMessageInfo -func (m *StatusResponse) GetEarliestStoreHeight() uint64 { - if m != nil { - return m.EarliestStoreHeight - } - return 0 -} - func (m *StatusResponse) GetHeight() uint64 { if m != nil { return m.Height @@ -239,36 +231,34 @@ func init() { func init() { proto.RegisterFile("cosmos/base/node/v2/query.proto", fileDescriptor_e86a941b0be4e1ff) } var fileDescriptor_e86a941b0be4e1ff = []byte{ - // 453 bytes of a gzipped FileDescriptorProto + // 430 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0xeb, 0x51, 0x3a, 0x66, 0x58, 0x27, 0x32, 0x40, 0xa5, 0x40, 0x5a, 0x75, 0x42, 0xaa, - 0x40, 0xb2, 0xa5, 0x70, 0x45, 0x1c, 0x86, 0x10, 0x3b, 0xa2, 0x94, 0x13, 0x97, 0xc8, 0x4d, 0xbd, - 0xc4, 0xa2, 0x89, 0x3d, 0x3f, 0x27, 0x12, 0x57, 0x3e, 0xc1, 0x24, 0xbe, 0x14, 0xc7, 0x49, 0x5c, - 0x38, 0x01, 0x6a, 0xf9, 0x12, 0xdc, 0x90, 0xed, 0x64, 0xa8, 0xd2, 0xca, 0x6e, 0xf6, 0xfb, 0xff, - 0xde, 0xff, 0xc9, 0xff, 0x67, 0x3c, 0x4a, 0x25, 0x14, 0x12, 0xe8, 0x9c, 0x01, 0xa7, 0xa5, 0x5c, - 0x70, 0x5a, 0x47, 0xf4, 0xac, 0xe2, 0xfa, 0x13, 0x51, 0x5a, 0x1a, 0x19, 0x1c, 0x7a, 0x80, 0x58, - 0x80, 0x58, 0x80, 0xd4, 0xd1, 0xf0, 0x71, 0x26, 0x65, 0xb6, 0xe4, 0x94, 0x29, 0x41, 0x59, 0x59, - 0x4a, 0xc3, 0x8c, 0x90, 0x25, 0xf8, 0x96, 0xe1, 0xa8, 0x51, 0xdd, 0x6d, 0x5e, 0x9d, 0x52, 0x23, - 0x0a, 0x0e, 0x86, 0x15, 0xaa, 0x01, 0xee, 0x65, 0x32, 0x93, 0xee, 0x48, 0xed, 0xc9, 0x57, 0x27, - 0x07, 0x78, 0xff, 0xb5, 0x2c, 0x4f, 0x45, 0x16, 0xf3, 0xb3, 0x8a, 0x83, 0x99, 0xbc, 0xc4, 0xfd, - 0xb6, 0x00, 0x4a, 0x96, 0xc0, 0x83, 0x67, 0xf8, 0x6e, 0x21, 0x4a, 0x51, 0x54, 0x45, 0x92, 0x31, - 0x48, 0x94, 0x16, 0x29, 0x1f, 0xa0, 0x31, 0x9a, 0xee, 0xc5, 0x07, 0x8d, 0xf0, 0x96, 0xc1, 0x3b, - 0x5b, 0xb6, 0x76, 0x33, 0xc3, 0x4c, 0x05, 0xad, 0xdd, 0x0f, 0x84, 0xfb, 0x6d, 0xa5, 0xf1, 0x8b, - 0xf0, 0x7d, 0xce, 0xf4, 0x52, 0x70, 0x30, 0x09, 0x18, 0xa9, 0x79, 0x92, 0x73, 0x91, 0xe5, 0xc6, - 0x79, 0x76, 0xe3, 0xc3, 0x56, 0x9c, 0x59, 0xed, 0xc4, 0x49, 0xc1, 0x03, 0xdc, 0x6b, 0xa0, 0x1d, - 0x07, 0x35, 0xb7, 0xe0, 0x15, 0xde, 0xbb, 0x7c, 0xe7, 0xe0, 0xc6, 0x18, 0x4d, 0x6f, 0x47, 0x43, - 0xe2, 0x93, 0x20, 0x6d, 0x12, 0xe4, 0x7d, 0x4b, 0x1c, 0x77, 0xcf, 0x7f, 0x8e, 0x50, 0xfc, 0xaf, - 0x25, 0x78, 0x88, 0x6f, 0x31, 0xa5, 0x92, 0x9c, 0x41, 0x3e, 0xe8, 0x8e, 0xd1, 0xf4, 0x4e, 0xbc, - 0xcb, 0x94, 0x3a, 0x61, 0x90, 0x07, 0x4f, 0x71, 0xbf, 0x66, 0x4b, 0xb1, 0x60, 0x46, 0x6a, 0x0f, - 0xdc, 0x74, 0xc0, 0xfe, 0x65, 0xd5, 0x62, 0xd1, 0x1f, 0x84, 0x77, 0x67, 0x5c, 0xd7, 0x22, 0xe5, - 0x41, 0x8d, 0x7b, 0x3e, 0xbb, 0x60, 0x42, 0xae, 0xd8, 0x20, 0xd9, 0x48, 0x7a, 0x78, 0xf4, 0x5f, - 0xc6, 0x87, 0x35, 0x39, 0xfa, 0xfc, 0xed, 0xf7, 0x97, 0x9d, 0x27, 0xc1, 0x23, 0x7a, 0xd5, 0x9f, - 0x49, 0xfd, 0xb4, 0x1a, 0xf7, 0x7c, 0xc6, 0x5b, 0xe6, 0x6e, 0xac, 0x64, 0xcb, 0xdc, 0xcd, 0x25, - 0x5d, 0x33, 0x17, 0x1c, 0x7c, 0xfc, 0xe6, 0xeb, 0x2a, 0x44, 0x17, 0xab, 0x10, 0xfd, 0x5a, 0x85, - 0xe8, 0x7c, 0x1d, 0x76, 0x2e, 0xd6, 0x61, 0xe7, 0xfb, 0x3a, 0xec, 0x7c, 0x78, 0xee, 0xbb, 0x60, - 0xf1, 0x91, 0x08, 0x49, 0x81, 0xeb, 0x9a, 0x6b, 0xdb, 0x68, 0xff, 0x6e, 0xa6, 0x55, 0xea, 0x9c, - 0xc0, 0xc7, 0x36, 0xef, 0xb9, 0x4d, 0xbd, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x2c, 0xf6, - 0x43, 0x17, 0x03, 0x00, 0x00, + 0x14, 0xc7, 0xeb, 0x51, 0x75, 0xcc, 0xb0, 0x4e, 0x18, 0x84, 0x4a, 0x81, 0xb4, 0xca, 0x84, 0x54, + 0x81, 0x64, 0x4b, 0xe1, 0x8a, 0x38, 0x0c, 0x21, 0x38, 0xa2, 0x8c, 0x13, 0x97, 0xca, 0x4d, 0x3d, + 0xc7, 0x62, 0x89, 0x3d, 0x3f, 0x27, 0x12, 0x57, 0x3e, 0xc1, 0x24, 0xbe, 0x05, 0x9f, 0x84, 0xe3, + 0x24, 0x2e, 0xdc, 0x40, 0x2d, 0x5f, 0x82, 0x1b, 0x72, 0x9c, 0x0c, 0x55, 0x5a, 0xd9, 0xcd, 0xfe, + 0xfb, 0xf7, 0xfe, 0x2f, 0xef, 0xff, 0x82, 0x27, 0x99, 0x86, 0x42, 0x03, 0x5b, 0x70, 0x10, 0xac, + 0xd4, 0x4b, 0xc1, 0xea, 0x84, 0x9d, 0x55, 0xc2, 0x7e, 0xa2, 0xc6, 0x6a, 0xa7, 0xc9, 0xdd, 0x00, + 0x50, 0x0f, 0x50, 0x0f, 0xd0, 0x3a, 0x19, 0x3f, 0x92, 0x5a, 0xcb, 0x53, 0xc1, 0xb8, 0x51, 0x8c, + 0x97, 0xa5, 0x76, 0xdc, 0x29, 0x5d, 0x42, 0x28, 0x19, 0x4f, 0xda, 0xd7, 0xe6, 0xb6, 0xa8, 0x4e, + 0x98, 0x53, 0x85, 0x00, 0xc7, 0x0b, 0xd3, 0x02, 0xf7, 0xa4, 0x96, 0xba, 0x39, 0x32, 0x7f, 0x0a, + 0x6a, 0x7c, 0x80, 0xf7, 0x5f, 0xe9, 0xf2, 0x44, 0xc9, 0x54, 0x9c, 0x55, 0x02, 0x5c, 0xfc, 0x02, + 0x0f, 0x3b, 0x01, 0x8c, 0x2e, 0x41, 0x90, 0xa7, 0xf8, 0x4e, 0xa1, 0x4a, 0x55, 0x54, 0xc5, 0x5c, + 0x72, 0x98, 0x1b, 0xab, 0x32, 0x31, 0x42, 0x53, 0x34, 0xdb, 0x4b, 0x0f, 0xda, 0x87, 0x37, 0x1c, + 0xde, 0x79, 0xd9, 0xdb, 0x1d, 0x3b, 0xee, 0x2a, 0xe8, 0xec, 0xbe, 0x22, 0x3c, 0xec, 0x94, 0xd6, + 0xef, 0x3e, 0x1e, 0xe4, 0x42, 0xc9, 0xdc, 0x35, 0x26, 0xfd, 0xb4, 0xbd, 0x91, 0x97, 0x78, 0xef, + 0xf2, 0x9b, 0x47, 0x3b, 0x53, 0x34, 0xbb, 0x95, 0x8c, 0x69, 0x98, 0x8a, 0x76, 0x53, 0xd1, 0xf7, + 0x1d, 0x71, 0xd4, 0x3f, 0xff, 0x39, 0x41, 0xe9, 0xbf, 0x12, 0xf2, 0x00, 0xdf, 0xe4, 0xc6, 0xcc, + 0x73, 0x0e, 0xf9, 0xe8, 0xc6, 0x14, 0xcd, 0x6e, 0xa7, 0xbb, 0xdc, 0x98, 0xb7, 0x1c, 0x72, 0xf2, + 0x04, 0x0f, 0x6b, 0x7e, 0xaa, 0x96, 0xdc, 0x69, 0x1b, 0x80, 0x7e, 0x03, 0xec, 0x5f, 0xaa, 0x1e, + 0x4b, 0xfe, 0x20, 0xbc, 0x7b, 0x2c, 0x6c, 0xad, 0x32, 0x41, 0x6a, 0x3c, 0x08, 0x39, 0x90, 0x98, + 0x5e, 0xb1, 0x0d, 0xba, 0x91, 0xda, 0xf8, 0xf0, 0xbf, 0x4c, 0x18, 0x3c, 0x3e, 0xfc, 0xfc, 0xfd, + 0xf7, 0x97, 0x9d, 0xc7, 0xe4, 0x21, 0xbb, 0x6a, 0xff, 0x59, 0xe8, 0x56, 0xe3, 0x41, 0xc8, 0x6b, + 0x4b, 0xdf, 0x8d, 0x78, 0xb7, 0xf4, 0xdd, 0x0c, 0xfc, 0x9a, 0xbe, 0xd0, 0xc0, 0x47, 0xaf, 0xbf, + 0xad, 0x22, 0x74, 0xb1, 0x8a, 0xd0, 0xaf, 0x55, 0x84, 0xce, 0xd7, 0x51, 0xef, 0x62, 0x1d, 0xf5, + 0x7e, 0xac, 0xa3, 0xde, 0x87, 0x67, 0xa1, 0x0a, 0x96, 0x1f, 0xa9, 0xd2, 0x0c, 0x84, 0xad, 0x85, + 0xf5, 0x85, 0xfe, 0x3f, 0x94, 0xd6, 0x64, 0x8d, 0x13, 0x84, 0xd8, 0x16, 0x83, 0x66, 0x53, 0xcf, + 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x97, 0xef, 0x5b, 0x0e, 0xe3, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -493,14 +483,14 @@ func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.ValidatorHash) i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorHash))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(m.AppHash) > 0 { i -= len(m.AppHash) copy(dAtA[i:], m.AppHash) i = encodeVarintQuery(dAtA, i, uint64(len(m.AppHash))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if m.Timestamp != nil { n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp):]) @@ -510,16 +500,11 @@ func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= n1 i = encodeVarintQuery(dAtA, i, uint64(n1)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } if m.Height != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.Height)) i-- - dAtA[i] = 0x10 - } - if m.EarliestStoreHeight != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.EarliestStoreHeight)) - i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil @@ -573,9 +558,6 @@ func (m *StatusResponse) Size() (n int) { } var l int _ = l - if m.EarliestStoreHeight != 0 { - n += 1 + sovQuery(uint64(m.EarliestStoreHeight)) - } if m.Height != 0 { n += 1 + sovQuery(uint64(m.Height)) } @@ -812,25 +794,6 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EarliestStoreHeight", wireType) - } - m.EarliestStoreHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EarliestStoreHeight |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) } @@ -849,7 +812,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { break } } - case 3: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } @@ -885,7 +848,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) } @@ -919,7 +882,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { m.AppHash = []byte{} } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) } diff --git a/server/v2/api/grpc/nodeservice/service.go b/server/v2/api/grpc/nodeservice/service.go index adaafbed1a2c..b35c57d97f99 100644 --- a/server/v2/api/grpc/nodeservice/service.go +++ b/server/v2/api/grpc/nodeservice/service.go @@ -40,10 +40,6 @@ func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusRespo headerInfo := environment.HeaderService.HeaderInfo(ctx) return &StatusResponse{ - // TODO: Get earliest version from store. - // - // Ref: ... - // EarliestStoreHeight: sdkCtx.MultiStore(), Height: uint64(headerInfo.Height), Timestamp: &headerInfo.Time, AppHash: headerInfo.AppHash, From 6fcfeadf5b76d703046166b4e03930425f3d0349 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 13 Nov 2024 15:04:50 +0100 Subject: [PATCH 07/19] updates --- server/v2/api/grpc/server.go | 6 +- server/v2/cometbft/client/grpc/autocli.go | 71 +++++++++++++++++++++++ server/v2/cometbft/client/grpc/service.go | 1 + server/v2/cometbft/client/rpc/block.go | 16 +++-- server/v2/cometbft/client/rpc/utils.go | 20 +------ 5 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 server/v2/cometbft/client/grpc/autocli.go create mode 100644 server/v2/cometbft/client/grpc/service.go diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index e3a0c4e1ce68..acee74ba1dde 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -70,15 +70,15 @@ func New[T transaction.Tx]( grpc.UnknownServiceHandler(makeUnknownServiceHandler(queryHandlers, queryable)), ) - // reflection allows external clients to see what services and methods the gRPC server exposes. - gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) - // register V2 grpc handlers RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) // register node service nodeservice.RegisterServiceServer(grpcSrv, nodeservice.NewQueryServer(cfg)) + // reflection allows external clients to see what services and methods the gRPC server exposes. + gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) + // register extra handlers on the grpc server for _, fn := range extraGRPCHandlers { fn(grpcSrv) diff --git a/server/v2/cometbft/client/grpc/autocli.go b/server/v2/cometbft/client/grpc/autocli.go new file mode 100644 index 000000000000..3a63326750ac --- /dev/null +++ b/server/v2/cometbft/client/grpc/autocli.go @@ -0,0 +1,71 @@ +package grpc + +import ( + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" +) + +var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ + Service: cmtv1beta1.Service_ServiceDesc.ServiceName, + RpcCommandOptions: []*autocliv1.RpcCommandOptions{ + { + RpcMethod: "GetNodeInfo", + Use: "node-info", + Short: "Query the current node info", + }, + { + RpcMethod: "GetSyncing", + Use: "syncing", + Short: "Query node syncing status", + }, + { + RpcMethod: "GetLatestBlock", + Use: "block-latest", + Short: "Query for the latest committed block", + }, + { + RpcMethod: "GetBlockByHeight", + Use: "block-by-height ", + Short: "Query for a committed block by height", + Long: "Query for a specific committed block using the CometBFT RPC `block_by_height` method", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, + }, + { + RpcMethod: "GetLatestValidatorSet", + Use: "validator-set", + Alias: []string{"validator-set-latest", "comet-validator-set", "cometbft-validator-set", "tendermint-validator-set"}, + Short: "Query for the latest validator set", + }, + { + RpcMethod: "GetValidatorSetByHeight", + Use: "validator-set-by-height ", + Short: "Query for a validator set by height", + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "height"}}, + }, + { + RpcMethod: "ABCIQuery", + Skip: true, + }, + }, +} + +// NewCometBFTCommands is a fake `appmodule.Module` to be considered as a module +// and be added in AutoCLI. +func NewCometBFTCommands() *cometModule { + return &cometModule{} +} + +type cometModule struct{} + +func (m cometModule) IsOnePerModuleType() {} +func (m cometModule) IsAppModule() {} + +func (m cometModule) Name() string { + return "comet" +} + +func (m cometModule) AutoCLIOptions() *autocliv1.ModuleOptions { + return &autocliv1.ModuleOptions{ + Query: CometBFTAutoCLIDescriptor, + } +} diff --git a/server/v2/cometbft/client/grpc/service.go b/server/v2/cometbft/client/grpc/service.go new file mode 100644 index 000000000000..21e034e4c0fa --- /dev/null +++ b/server/v2/cometbft/client/grpc/service.go @@ -0,0 +1 @@ +package grpc diff --git a/server/v2/cometbft/client/rpc/block.go b/server/v2/cometbft/client/rpc/block.go index 1342f69f52ff..23d96a5b2f43 100644 --- a/server/v2/cometbft/client/rpc/block.go +++ b/server/v2/cometbft/client/rpc/block.go @@ -50,9 +50,15 @@ func QueryBlocks(ctx context.Context, rpcClient CometRPC, page, limit int, query return nil, err } - result := NewSearchBlocksResult(int64(resBlocks.TotalCount), int64(len(blocks)), int64(page), int64(limit), blocks) - - return result, nil + totalPages := calcTotalPages(int64(resBlocks.TotalCount), int64(limit)) + return &sdk.SearchBlocksResult{ + TotalCount: int64(resBlocks.TotalCount), + Count: int64(len(blocks)), + PageNumber: int64(page), + PageTotal: totalPages, + Limit: int64(limit), + Blocks: blocks, + }, nil } // GetBlockByHeight gets block by height @@ -65,7 +71,7 @@ func GetBlockByHeight(ctx context.Context, rpcClient CometRPC, height *int64) (* return nil, err } - out, err := NewResponseResultBlock(resBlock) + out, err := responseResultBlock(resBlock) if err != nil { return nil, err } @@ -90,7 +96,7 @@ func GetBlockByHash(ctx context.Context, rpcClient CometRPC, hashHexString strin } else if resBlock.Block == nil { return nil, fmt.Errorf("block not found with hash: %s", hashHexString) } - out, err := NewResponseResultBlock(resBlock) + out, err := responseResultBlock(resBlock) if err != nil { return nil, err } diff --git a/server/v2/cometbft/client/rpc/utils.go b/server/v2/cometbft/client/rpc/utils.go index 0ac0b23259e6..87431b529f4f 100644 --- a/server/v2/cometbft/client/rpc/utils.go +++ b/server/v2/cometbft/client/rpc/utils.go @@ -6,8 +6,6 @@ import ( cmttypes "github.com/cometbft/cometbft/api/cometbft/types/v1" coretypes "github.com/cometbft/cometbft/rpc/core/types" gogoproto "github.com/cosmos/gogoproto/proto" - - sdk "github.com/cosmos/cosmos-sdk/types" ) // formatBlockResults parses the indexed blocks into a slice of BlockResponse objects. @@ -17,7 +15,7 @@ func formatBlockResults(resBlocks []*coretypes.ResultBlock) ([]*cmttypes.Block, out = make([]*cmttypes.Block, len(resBlocks)) ) for i := range resBlocks { - out[i], err = NewResponseResultBlock(resBlocks[i]) + out[i], err = responseResultBlock(resBlocks[i]) if err != nil { return nil, fmt.Errorf("unable to create response block from comet result block: %v: %w", resBlocks[i], err) } @@ -29,20 +27,8 @@ func formatBlockResults(resBlocks []*coretypes.ResultBlock) ([]*cmttypes.Block, return out, nil } -func NewSearchBlocksResult(totalCount, count, page, limit int64, blocks []*cmttypes.Block) *sdk.SearchBlocksResult { - totalPages := calcTotalPages(totalCount, limit) - return &sdk.SearchBlocksResult{ - TotalCount: totalCount, - Count: count, - PageNumber: page, - PageTotal: totalPages, - Limit: limit, - Blocks: blocks, - } -} - -// NewResponseResultBlock returns a BlockResponse given a ResultBlock from CometBFT -func NewResponseResultBlock(res *coretypes.ResultBlock) (*cmttypes.Block, error) { +// responseResultBlock returns a BlockResponse given a ResultBlock from CometBFT +func responseResultBlock(res *coretypes.ResultBlock) (*cmttypes.Block, error) { blkProto, err := res.Block.ToProto() if err != nil { return nil, err From 1722c183d30f3ac8d0ae80143a9947d01477147c Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 11:50:33 +0100 Subject: [PATCH 08/19] tidy --- server/v2/cometbft/go.mod | 2 +- server/v2/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 43f3ee20d833..2894dff2a675 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -18,6 +18,7 @@ replace ( ) require ( + cosmossdk.io/api v0.7.6 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v1.0.0-alpha.6 cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 @@ -42,7 +43,6 @@ require ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.1-20240701160653-fedbb9acfd2f.1 // indirect buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.1-20240130113600-88ef6483f90f.1 // indirect - cosmossdk.io/api v0.7.6 // indirect cosmossdk.io/core/testing v0.0.0 // indirect cosmossdk.io/depinject v1.1.0 // indirect cosmossdk.io/errors v1.0.1 // indirect diff --git a/server/v2/go.mod b/server/v2/go.mod index 9530393d52c1..cc692130a346 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -35,6 +35,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/grpc v1.68.0 google.golang.org/protobuf v1.35.2 ) @@ -113,7 +114,6 @@ require ( golang.org/x/text v0.20.0 // indirect golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect From 28c7ddfcec76b2b879fc4db5de9051ef3e1a2478 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 12:53:27 +0100 Subject: [PATCH 09/19] updates --- client/grpc/cmtservice/service.go | 2 +- server/v2/api/grpc/server.go | 10 ++-- server/v2/cometbft/abci.go | 2 +- server/v2/cometbft/client/grpc/service.go | 1 - server/v2/cometbft/go.mod | 13 +++++- server/v2/cometbft/go.sum | 46 +++++++++++++++++++ .../{client/grpc/autocli.go => grpc.go} | 41 ++++++++--------- server/v2/cometbft/query.go | 3 +- simapp/v2/simdv2/cmd/commands.go | 43 +++++++++++------ simapp/v2/simdv2/cmd/root_di.go | 1 + 10 files changed, 118 insertions(+), 44 deletions(-) delete mode 100644 server/v2/cometbft/client/grpc/service.go rename server/v2/cometbft/{client/grpc/autocli.go => grpc.go} (70%) diff --git a/client/grpc/cmtservice/service.go b/client/grpc/cmtservice/service.go index d8673af02e32..7d56efd3389d 100644 --- a/client/grpc/cmtservice/service.go +++ b/client/grpc/cmtservice/service.go @@ -284,7 +284,7 @@ func (s queryServer) ABCIQuery(ctx context.Context, req *ABCIQueryRequest) (*ABC func RegisterTendermintService( clientCtx client.Context, server gogogrpc.Server, - iRegistry codectypes.InterfaceRegistry, + _ codectypes.InterfaceRegistry, queryFn abciQueryFn, ) { node, err := clientCtx.GetNode() diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index acee74ba1dde..c40696871b85 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -49,7 +49,7 @@ func New[T transaction.Tx]( interfaceRegistry server.InterfaceRegistry, queryHandlers map[string]appmodulev2.Handler, queryable func(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error), - extraGRPCHandlers []func(*grpc.Server), + extraGRPCHandlers []func(*grpc.Server) error, cfg server.ConfigMap, cfgOptions ...CfgOption, ) (*Server[T], error) { @@ -70,7 +70,7 @@ func New[T transaction.Tx]( grpc.UnknownServiceHandler(makeUnknownServiceHandler(queryHandlers, queryable)), ) - // register V2 grpc handlers + // register grpc query handler v2 RegisterServiceServer(grpcSrv, &v2Service{queryHandlers, queryable}) // register node service @@ -80,8 +80,12 @@ func New[T transaction.Tx]( gogoreflection.Register(grpcSrv, slices.Collect(maps.Keys(queryHandlers)), logger.With("sub-module", "grpc-reflection")) // register extra handlers on the grpc server + var err error for _, fn := range extraGRPCHandlers { - fn(grpcSrv) + err = errors.Join(err, fn(grpcSrv)) + } + if err != nil { + return nil, fmt.Errorf("failed to register extra gRPC handlers: %w", err) } srv.grpcSrv = grpcSrv diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 142739a25d10..1b64ec60874c 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -230,7 +230,7 @@ func (c *Consensus[T]) Query(ctx context.Context, req *abciproto.QueryRequest) ( resp, err = c.handlerQueryApp(ctx, path, req) case QueryPathStore: - resp, err = c.handleQueryStore(path, c.store, req) + resp, err = c.handleQueryStore(path, req) case QueryPathP2P: resp, err = c.handleQueryP2P(path) diff --git a/server/v2/cometbft/client/grpc/service.go b/server/v2/cometbft/client/grpc/service.go deleted file mode 100644 index 21e034e4c0fa..000000000000 --- a/server/v2/cometbft/client/grpc/service.go +++ /dev/null @@ -1 +0,0 @@ -package grpc diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 2894dff2a675..190837996fdc 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -36,6 +36,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 + google.golang.org/grpc v1.68.0 google.golang.org/protobuf v1.35.2 sigs.k8s.io/yaml v1.4.0 ) @@ -54,7 +55,9 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect + github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.2.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect @@ -74,6 +77,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect + github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/iavl v1.3.1 // indirect github.com/cosmos/ics23/go v0.11.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect @@ -86,12 +90,14 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.18.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/go-kit/kit v0.13.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect + github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -101,7 +107,10 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/handlers v1.5.2 // indirect + github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.3 // indirect + github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect @@ -113,6 +122,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.2 // indirect github.com/hdevalence/ed25519consensus v0.2.0 // indirect + github.com/huandu/skiplist v1.2.1 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -167,15 +177,16 @@ require ( golang.org/x/arch v0.12.0 // indirect golang.org/x/crypto v0.29.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect + golang.org/x/mod v0.18.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/sync v0.9.0 // indirect golang.org/x/sys v0.27.0 // indirect golang.org/x/term v0.26.0 // indirect golang.org/x/text v0.20.0 // indirect + golang.org/x/tools v0.22.0 // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/grpc v1.68.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 71bf95231d82..571e7e81a979 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -47,6 +47,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -83,6 +84,12 @@ github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJ github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= @@ -118,6 +125,7 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= +github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.3.1 h1:+W1G2uSUtJMqMGpwz/fKiwZxY2DDT/9/0hyNLm6Geu0= @@ -157,6 +165,9 @@ github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -181,10 +192,12 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -192,9 +205,11 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -234,6 +249,7 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -285,6 +301,8 @@ github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6 github.com/hdevalence/ed25519consensus v0.2.0 h1:37ICyZqdyj0lAZ8P4D1d1id3HqbbG1N3iBb1Tb4rdcU= github.com/hdevalence/ed25519consensus v0.2.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= +github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.1 h1:dTi93MgjwErA/8idWTzIw4Y1kZsMWx35fmI2c8Rij7w= github.com/huandu/skiplist v1.2.1/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= @@ -299,6 +317,7 @@ github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= @@ -376,6 +395,7 @@ github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/ github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -493,10 +513,15 @@ go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6 go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/arch v0.12.0 h1:UsYJhbzPYGsT0HbEdmYcqtCv8UNGvnaL561NnIUvaKg= golang.org/x/arch v0.12.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -512,6 +537,7 @@ golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= @@ -531,6 +557,7 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -565,11 +592,16 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -585,15 +617,18 @@ golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -610,8 +645,10 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= @@ -622,8 +659,12 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0= google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -637,10 +678,13 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -655,9 +699,11 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= diff --git a/server/v2/cometbft/client/grpc/autocli.go b/server/v2/cometbft/grpc.go similarity index 70% rename from server/v2/cometbft/client/grpc/autocli.go rename to server/v2/cometbft/grpc.go index 3a63326750ac..94a17a9adf28 100644 --- a/server/v2/cometbft/client/grpc/autocli.go +++ b/server/v2/cometbft/grpc.go @@ -1,10 +1,28 @@ -package grpc +package cometbft import ( + "google.golang.org/grpc" + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" + "cosmossdk.io/core/address" + "cosmossdk.io/server/v2/cometbft/client/rpc" + + "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" ) +// GRPCServiceRegistrar returns a function that registers the CometBFT gRPC service +func (c *Consensus[T]) GRPCServiceRegistrar( + cometRPC rpc.CometRPC, + consensusAddressCodec address.ConsensusAddressCodec, +) func(srv *grpc.Server) error { + return func(srv *grpc.Server) error { + cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(cometRPC, c.Query, consensusAddressCodec)) + return nil + } +} + +// CometBFTAutoCLIDescriptor is the auto-generated CLI descriptor for the CometBFT service var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ Service: cmtv1beta1.Service_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ @@ -48,24 +66,3 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, }, } - -// NewCometBFTCommands is a fake `appmodule.Module` to be considered as a module -// and be added in AutoCLI. -func NewCometBFTCommands() *cometModule { - return &cometModule{} -} - -type cometModule struct{} - -func (m cometModule) IsOnePerModuleType() {} -func (m cometModule) IsAppModule() {} - -func (m cometModule) Name() string { - return "comet" -} - -func (m cometModule) AutoCLIOptions() *autocliv1.ModuleOptions { - return &autocliv1.ModuleOptions{ - Query: CometBFTAutoCLIDescriptor, - } -} diff --git a/server/v2/cometbft/query.go b/server/v2/cometbft/query.go index 8a624f56fc32..f032b2807355 100644 --- a/server/v2/cometbft/query.go +++ b/server/v2/cometbft/query.go @@ -8,7 +8,6 @@ import ( crypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1" errorsmod "cosmossdk.io/errors/v2" - "cosmossdk.io/server/v2/cometbft/types" cometerrors "cosmossdk.io/server/v2/cometbft/types/errors" ) @@ -84,7 +83,7 @@ func (c *Consensus[T]) handlerQueryApp(ctx context.Context, path []string, req * return nil, errorsmod.Wrapf(cometerrors.ErrUnknownRequest, "unknown query: %s", path) } -func (c *Consensus[T]) handleQueryStore(path []string, _ types.Store, req *abci.QueryRequest) (*abci.QueryResponse, error) { +func (c *Consensus[T]) handleQueryStore(path []string, req *abci.QueryRequest) (*abci.QueryResponse, error) { req.Path = "/" + strings.Join(path[1:], "/") if req.Height <= 1 && req.Prove { return nil, errorsmod.Wrap( diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 3acf7c0950d2..408e7e2cfe25 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -5,6 +5,7 @@ import ( "io" "github.com/spf13/cobra" + "google.golang.org/grpc" "cosmossdk.io/client/v2/offchain" coreserver "cosmossdk.io/core/server" @@ -12,7 +13,7 @@ import ( "cosmossdk.io/log" runtimev2 "cosmossdk.io/runtime/v2" serverv2 "cosmossdk.io/server/v2" - "cosmossdk.io/server/v2/api/grpc" + grpcserver "cosmossdk.io/server/v2/api/grpc" "cosmossdk.io/server/v2/api/rest" "cosmossdk.io/server/v2/api/telemetry" "cosmossdk.io/server/v2/cometbft" @@ -40,7 +41,10 @@ type CommandDependencies[T transaction.Tx] struct { TxConfig client.TxConfig ModuleManager *runtimev2.MM[T] SimApp *simapp.SimApp[T] - Consensus serverv2.ServerComponent[T] + // could be more generic with serverv2.ServerComponent[T] + // however, we want to register extra grpc handlers + ConsensusServer *cometbft.CometBFTServer[T] + ClientContext client.Context } func InitRootCmd[T transaction.Tx]( @@ -66,8 +70,8 @@ func InitRootCmd[T transaction.Tx]( // build CLI skeleton for initial config parsing or a client application invocation if deps.SimApp == nil { - if deps.Consensus == nil { - deps.Consensus = cometbft.NewWithConfigOptions[T](initCometConfig()) + if deps.ConsensusServer == nil { + deps.ConsensusServer = cometbft.NewWithConfigOptions[T](initCometConfig()) } return serverv2.AddCommands[T]( rootCmd, @@ -75,8 +79,8 @@ func InitRootCmd[T transaction.Tx]( io.NopCloser(nil), deps.GlobalConfig, initServerConfig(), - deps.Consensus, - &grpc.Server[T]{}, + deps.ConsensusServer, + &grpcserver.Server[T]{}, &serverstore.Server[T]{}, &telemetry.Server[T]{}, &rest.Server[T]{}, @@ -85,10 +89,7 @@ func InitRootCmd[T transaction.Tx]( // build full app! simApp := deps.SimApp - grpcServer, err := grpc.New[T](logger, simApp.InterfaceRegistry(), simApp.QueryHandlers(), simApp.Query, deps.GlobalConfig) - if err != nil { - return nil, err - } + // store component (not a server) storeComponent, err := serverstore.New[T](simApp.Store(), deps.GlobalConfig) if err != nil { @@ -100,8 +101,8 @@ func InitRootCmd[T transaction.Tx]( } // consensus component - if deps.Consensus == nil { - deps.Consensus, err = cometbft.New( + if deps.ConsensusServer == nil { + deps.ConsensusServer, err = cometbft.New( logger, simApp.Name(), simApp.Store(), @@ -112,15 +113,31 @@ func InitRootCmd[T transaction.Tx]( deps.GlobalConfig, initCometOptions[T](), ) + if err != nil { return nil, err } } + telemetryServer, err := telemetry.New[T](deps.GlobalConfig, logger) if err != nil { return nil, err } + grpcServer, err := grpcserver.New[T]( + logger, + simApp.InterfaceRegistry(), + simApp.QueryHandlers(), + simApp.Query, + []func(*grpc.Server) error{ + deps.ConsensusServer.Consensus.GRPCServiceRegistrar(deps.ClientContext.Client, deps.ClientContext.ConsensusAddressCodec), + }, + deps.GlobalConfig, + ) + if err != nil { + return nil, err + } + // wire server commands return serverv2.AddCommands[T]( rootCmd, @@ -128,7 +145,7 @@ func InitRootCmd[T transaction.Tx]( simApp, deps.GlobalConfig, initServerConfig(), - deps.Consensus, + deps.ConsensusServer, grpcServer, storeComponent, telemetryServer, diff --git a/simapp/v2/simdv2/cmd/root_di.go b/simapp/v2/simdv2/cmd/root_di.go index 1d71876a8fde..c2dddc9992f2 100644 --- a/simapp/v2/simdv2/cmd/root_di.go +++ b/simapp/v2/simdv2/cmd/root_di.go @@ -94,6 +94,7 @@ func NewRootCmd[T transaction.Tx]( TxConfig: clientCtx.TxConfig, ModuleManager: moduleManager, SimApp: simApp, + ClientContext: clientCtx, } rootCommand = &cobra.Command{ Use: "simdv2", From c67a32efcd369dc018d3d05df146ea424876af1a Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 13:13:02 +0100 Subject: [PATCH 10/19] simulate --- server/v2/cometbft/grpc.go | 124 +++++++++++++++++++++++++++++-- simapp/v2/go.mod | 2 +- simapp/v2/simdv2/cmd/commands.go | 4 +- 3 files changed, 123 insertions(+), 7 deletions(-) diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index 94a17a9adf28..44781a0868a2 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -1,23 +1,36 @@ package cometbft import ( + "context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" - "cosmossdk.io/core/address" - "cosmossdk.io/server/v2/cometbft/client/rpc" + "cosmossdk.io/core/transaction" + errorsmod "cosmossdk.io/errors/v2" + + "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + txtypes "github.com/cosmos/cosmos-sdk/types/tx" ) // GRPCServiceRegistrar returns a function that registers the CometBFT gRPC service +// Those services are defined for backward compatibility. +// Eventually, they will be removed in favor of the new gRPC services. func (c *Consensus[T]) GRPCServiceRegistrar( - cometRPC rpc.CometRPC, - consensusAddressCodec address.ConsensusAddressCodec, + clientCtx client.Context, ) func(srv *grpc.Server) error { return func(srv *grpc.Server) error { - cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(cometRPC, c.Query, consensusAddressCodec)) + cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(clientCtx.Client, c.Query, clientCtx.ConsensusAddressCodec)) + txtypes.RegisterServiceServer(srv, txServer[T]{clientCtx, c}) + return nil } } @@ -66,3 +79,104 @@ var CometBFTAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{ }, }, } + +type txServer[T transaction.Tx] struct { + clientCtx client.Context + consensus *Consensus[T] +} + +// BroadcastTx implements tx.ServiceServer. +func (t txServer[T]) BroadcastTx(ctx context.Context, req *txtypes.BroadcastTxRequest) (*txtypes.BroadcastTxResponse, error) { + return client.TxServiceBroadcast(ctx, t.clientCtx, req) +} + +// GetBlockWithTxs implements tx.ServiceServer. +func (t txServer[T]) GetBlockWithTxs(context.Context, *txtypes.GetBlockWithTxsRequest) (*txtypes.GetBlockWithTxsResponse, error) { + panic("unimplemented") +} + +// GetTx implements tx.ServiceServer. +func (t txServer[T]) GetTx(context.Context, *txtypes.GetTxRequest) (*txtypes.GetTxResponse, error) { + panic("unimplemented") +} + +// GetTxsEvent implements tx.ServiceServer. +func (t txServer[T]) GetTxsEvent(context.Context, *txtypes.GetTxsEventRequest) (*txtypes.GetTxsEventResponse, error) { + panic("unimplemented") +} + +// Simulate implements tx.ServiceServer. +func (t txServer[T]) Simulate(ctx context.Context, req *txtypes.SimulateRequest) (*txtypes.SimulateResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid empty tx") + } + + txBytes := req.TxBytes + if txBytes == nil && req.Tx != nil { + // This block is for backwards-compatibility. + // We used to support passing a `Tx` in req. But if we do that, sig + // verification might not pass, because the .Marshal() below might not + // be the same marshaling done by the client. + var err error + txBytes, err = proto.Marshal(req.Tx) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid tx; %v", err) + } + } + + if txBytes == nil { + return nil, status.Errorf(codes.InvalidArgument, "empty txBytes is not allowed") + } + + tx, err := t.consensus.txCodec.Decode(txBytes) + if err != nil { + return nil, errorsmod.Wrap(err, "failed to decode tx") + } + + txResult, _, err := t.consensus.app.Simulate(ctx, tx) + if err != nil { + return nil, status.Errorf(codes.Unknown, "%v with gas used: '%d'", err, txResult.GasUsed) + } + + msgResponses := make([]*codectypes.Any, 0, len(txResult.Resp)) + // pack the messages into Any + for _, msg := range txResult.Resp { + anyMsg, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, status.Errorf(codes.Unknown, "failed to pack message response: %v", err) + } + msgResponses = append(msgResponses, anyMsg) + } + + return &txtypes.SimulateResponse{ + GasInfo: &sdk.GasInfo{ + GasUsed: txResult.GasUsed, + GasWanted: txResult.GasWanted, + }, + Result: &sdk.Result{ + MsgResponses: msgResponses, + }, + }, nil +} + +// TxDecode implements tx.ServiceServer. +func (t txServer[T]) TxDecode(context.Context, *txtypes.TxDecodeRequest) (*txtypes.TxDecodeResponse, error) { + panic("unimplemented") +} + +// TxDecodeAmino implements tx.ServiceServer. +func (t txServer[T]) TxDecodeAmino(context.Context, *txtypes.TxDecodeAminoRequest) (*txtypes.TxDecodeAminoResponse, error) { + panic("unimplemented") +} + +// TxEncode implements tx.ServiceServer. +func (t txServer[T]) TxEncode(context.Context, *txtypes.TxEncodeRequest) (*txtypes.TxEncodeResponse, error) { + panic("unimplemented") +} + +// TxEncodeAmino implements tx.ServiceServer. +func (t txServer[T]) TxEncodeAmino(context.Context, *txtypes.TxEncodeAminoRequest) (*txtypes.TxEncodeAminoResponse, error) { + panic("unimplemented") +} + +var _ txtypes.ServiceServer = txServer[transaction.Tx]{} diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 382c5675155d..95338cb2c2a2 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -46,6 +46,7 @@ require ( cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 + google.golang.org/grpc v1.68.0 ) require ( @@ -238,7 +239,6 @@ require ( google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/grpc v1.68.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 408e7e2cfe25..565292718731 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -130,7 +130,9 @@ func InitRootCmd[T transaction.Tx]( simApp.QueryHandlers(), simApp.Query, []func(*grpc.Server) error{ - deps.ConsensusServer.Consensus.GRPCServiceRegistrar(deps.ClientContext.Client, deps.ClientContext.ConsensusAddressCodec), + deps.ConsensusServer.Consensus.GRPCServiceRegistrar( + deps.ClientContext, + ), }, deps.GlobalConfig, ) From 5e55ce845bc4b95cba077d16093741df626fa5ef Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 13:15:43 +0100 Subject: [PATCH 11/19] updates --- server/v2/cometbft/grpc.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index 44781a0868a2..f5aeba0ec5c4 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -92,17 +92,17 @@ func (t txServer[T]) BroadcastTx(ctx context.Context, req *txtypes.BroadcastTxRe // GetBlockWithTxs implements tx.ServiceServer. func (t txServer[T]) GetBlockWithTxs(context.Context, *txtypes.GetBlockWithTxsRequest) (*txtypes.GetBlockWithTxsResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // GetTx implements tx.ServiceServer. func (t txServer[T]) GetTx(context.Context, *txtypes.GetTxRequest) (*txtypes.GetTxResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // GetTxsEvent implements tx.ServiceServer. func (t txServer[T]) GetTxsEvent(context.Context, *txtypes.GetTxsEventRequest) (*txtypes.GetTxsEventResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // Simulate implements tx.ServiceServer. @@ -161,22 +161,22 @@ func (t txServer[T]) Simulate(ctx context.Context, req *txtypes.SimulateRequest) // TxDecode implements tx.ServiceServer. func (t txServer[T]) TxDecode(context.Context, *txtypes.TxDecodeRequest) (*txtypes.TxDecodeResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // TxDecodeAmino implements tx.ServiceServer. func (t txServer[T]) TxDecodeAmino(context.Context, *txtypes.TxDecodeAminoRequest) (*txtypes.TxDecodeAminoResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // TxEncode implements tx.ServiceServer. func (t txServer[T]) TxEncode(context.Context, *txtypes.TxEncodeRequest) (*txtypes.TxEncodeResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } // TxEncodeAmino implements tx.ServiceServer. func (t txServer[T]) TxEncodeAmino(context.Context, *txtypes.TxEncodeAminoRequest) (*txtypes.TxEncodeAminoResponse, error) { - panic("unimplemented") + return nil, status.Error(codes.Unimplemented, "not implemented") } var _ txtypes.ServiceServer = txServer[transaction.Tx]{} From b995dbd90751c9c3c76060a241bfd9f8a3683cb8 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 14:32:03 +0100 Subject: [PATCH 12/19] remove scrums of previous app closer --- server/v2/cometbft/abci.go | 3 --- server/v2/cometbft/abci_test.go | 2 +- server/v2/cometbft/server.go | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 1b64ec60874c..42f34565c8bf 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -48,7 +48,6 @@ type Consensus[T transaction.Tx] struct { logger log.Logger appName, version string app appmanager.AppManager[T] - appCloser func() error txCodec transaction.Codec[T] store types.Store streaming streaming.Manager @@ -83,7 +82,6 @@ func NewConsensus[T transaction.Tx]( logger log.Logger, appName string, app appmanager.AppManager[T], - appCloser func() error, mp mempool.Mempool[T], indexedEvents map[string]struct{}, queryHandlersMap map[string]appmodulev2.Handler, @@ -96,7 +94,6 @@ func NewConsensus[T transaction.Tx]( appName: appName, version: getCometBFTServerVersion(), app: app, - appCloser: appCloser, cfg: cfg, store: store, logger: logger, diff --git a/server/v2/cometbft/abci_test.go b/server/v2/cometbft/abci_test.go index 85433d426cfe..ab29139da33e 100644 --- a/server/v2/cometbft/abci_test.go +++ b/server/v2/cometbft/abci_test.go @@ -699,7 +699,7 @@ func setUpConsensus(t *testing.T, gasLimit uint64, mempool mempool.Mempool[mock. nil, ) - return NewConsensus[mock.Tx](log.NewNopLogger(), "testing-app", am, func() error { return nil }, + return NewConsensus[mock.Tx](log.NewNopLogger(), "testing-app", am, mempool, map[string]struct{}{}, nil, mockStore, Config{AppTomlConfig: DefaultAppTomlConfig()}, mock.TxCodec{}, "test") } diff --git a/server/v2/cometbft/server.go b/server/v2/cometbft/server.go index 55f80f69ed3a..a8269317fad7 100644 --- a/server/v2/cometbft/server.go +++ b/server/v2/cometbft/server.go @@ -116,7 +116,6 @@ func New[T transaction.Tx]( logger, appName, appManager, - nil, srv.serverOptions.Mempool(cfg), indexEvents, queryHandlers, From 5bbd256714fd0d1482d490c83c2ceadc5ac47641 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 15:16:32 +0100 Subject: [PATCH 13/19] implement nodeservice v1beta1 by comet --- server/v2/api/grpc/nodeservice/service.go | 27 +++++++++----------- server/v2/cometbft/grpc.go | 30 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 16 deletions(-) diff --git a/server/v2/api/grpc/nodeservice/service.go b/server/v2/api/grpc/nodeservice/service.go index b35c57d97f99..b2df2221254f 100644 --- a/server/v2/api/grpc/nodeservice/service.go +++ b/server/v2/api/grpc/nodeservice/service.go @@ -2,10 +2,8 @@ package nodeservice import ( context "context" - "errors" + fmt "fmt" - "cosmossdk.io/core/appmodule" - corecontext "cosmossdk.io/core/context" "cosmossdk.io/core/server" ) @@ -21,8 +19,8 @@ func NewQueryServer(cfg server.ConfigMap) ServiceServer { func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigResponse, error) { minGasPricesStr := "" - minGasPrices, ok := s.cfg["server.minimum_gas_price"] - if !ok { + minGasPrices, ok := s.cfg["server"].(map[string]interface{})["minimum-gas-prices"] + if ok { minGasPricesStr = minGasPrices.(string) } @@ -32,17 +30,14 @@ func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigRespo } func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusResponse, error) { - environment, ok := ctx.Value(corecontext.EnvironmentContextKey).(appmodule.Environment) - if !ok { - return nil, errors.New("environment not set") - } + // note, environment nor execution context isn't available in the context - headerInfo := environment.HeaderService.HeaderInfo(ctx) + // return &StatusResponse{ + // Height: uint64(headerInfo.Height), + // Timestamp: &headerInfo.Time, + // AppHash: headerInfo.AppHash, + // ValidatorHash: headerInfo.Hash, + // }, nil - return &StatusResponse{ - Height: uint64(headerInfo.Height), - Timestamp: &headerInfo.Time, - AppHash: headerInfo.AppHash, - ValidatorHash: headerInfo.Hash, - }, nil + return &StatusResponse{}, fmt.Errorf("not implemented") } diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index f5aeba0ec5c4..303d6de880f0 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -12,10 +12,12 @@ import ( "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors/v2" + v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1" "github.com/cosmos/gogoproto/proto" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" + nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" txtypes "github.com/cosmos/cosmos-sdk/types/tx" @@ -30,6 +32,7 @@ func (c *Consensus[T]) GRPCServiceRegistrar( return func(srv *grpc.Server) error { cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(clientCtx.Client, c.Query, clientCtx.ConsensusAddressCodec)) txtypes.RegisterServiceServer(srv, txServer[T]{clientCtx, c}) + nodeservice.RegisterServiceServer(srv, nodeServer[T]{c}) return nil } @@ -180,3 +183,30 @@ func (t txServer[T]) TxEncodeAmino(context.Context, *txtypes.TxEncodeAminoReques } var _ txtypes.ServiceServer = txServer[transaction.Tx]{} + +type nodeServer[T transaction.Tx] struct { + consensus *Consensus[T] +} + +func (s nodeServer[T]) Config(ctx context.Context, _ *nodeservice.ConfigRequest) (*nodeservice.ConfigResponse, error) { + return &nodeservice.ConfigResponse{ + MinimumGasPrice: "check cosmos.base.v2.Service/Config", + PruningKeepRecent: "ambiguous in v2", + PruningInterval: "ambiguous in v2", + HaltHeight: s.consensus.cfg.AppTomlConfig.HaltHeight, + }, nil +} + +func (s nodeServer[T]) Status(ctx context.Context, _ *nodeservice.StatusRequest) (*nodeservice.StatusResponse, error) { + nodeInfo, err := s.consensus.Info(ctx, &v1.InfoRequest{}) + if err != nil { + return nil, err + } + + return &nodeservice.StatusResponse{ + Height: uint64(nodeInfo.LastBlockHeight), + Timestamp: nil, + AppHash: nil, + ValidatorHash: nodeInfo.LastBlockAppHash, + }, nil +} From f33fe9e969ebf2a27ccc7bbea2c0d6b17a10f5f4 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 15:37:37 +0100 Subject: [PATCH 14/19] meh --- server/v2/cometbft/grpc.go | 13 +++++++++++-- simapp/v2/simdv2/cmd/commands.go | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index 303d6de880f0..db7c61a2d196 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -9,6 +9,7 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" cmtv1beta1 "cosmossdk.io/api/cosmos/base/tendermint/v1beta1" + "cosmossdk.io/core/server" "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors/v2" @@ -28,11 +29,12 @@ import ( // Eventually, they will be removed in favor of the new gRPC services. func (c *Consensus[T]) GRPCServiceRegistrar( clientCtx client.Context, + cfg server.ConfigMap, ) func(srv *grpc.Server) error { return func(srv *grpc.Server) error { cmtservice.RegisterServiceServer(srv, cmtservice.NewQueryServer(clientCtx.Client, c.Query, clientCtx.ConsensusAddressCodec)) txtypes.RegisterServiceServer(srv, txServer[T]{clientCtx, c}) - nodeservice.RegisterServiceServer(srv, nodeServer[T]{c}) + nodeservice.RegisterServiceServer(srv, nodeServer[T]{cfg, c}) return nil } @@ -185,12 +187,19 @@ func (t txServer[T]) TxEncodeAmino(context.Context, *txtypes.TxEncodeAminoReques var _ txtypes.ServiceServer = txServer[transaction.Tx]{} type nodeServer[T transaction.Tx] struct { + cfg server.ConfigMap consensus *Consensus[T] } func (s nodeServer[T]) Config(ctx context.Context, _ *nodeservice.ConfigRequest) (*nodeservice.ConfigResponse, error) { + minGasPricesStr := "" + minGasPrices, ok := s.cfg["server"].(map[string]interface{})["minimum-gas-prices"] + if ok { + minGasPricesStr = minGasPrices.(string) + } + return &nodeservice.ConfigResponse{ - MinimumGasPrice: "check cosmos.base.v2.Service/Config", + MinimumGasPrice: minGasPricesStr, PruningKeepRecent: "ambiguous in v2", PruningInterval: "ambiguous in v2", HaltHeight: s.consensus.cfg.AppTomlConfig.HaltHeight, diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 565292718731..636d28426d1b 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -132,6 +132,7 @@ func InitRootCmd[T transaction.Tx]( []func(*grpc.Server) error{ deps.ConsensusServer.Consensus.GRPCServiceRegistrar( deps.ClientContext, + deps.GlobalConfig, ), }, deps.GlobalConfig, From d3e7082c4a99e8400137b6a7071f8c038fa6ff22 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 15:46:16 +0100 Subject: [PATCH 15/19] `make lint-fix` --- server/v2/cometbft/grpc.go | 5 ++--- server/v2/stf/branch/mergeiter.go | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index db7c61a2d196..3e8f1855ba06 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -3,6 +3,8 @@ package cometbft import ( "context" + v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1" + "github.com/cosmos/gogoproto/proto" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -13,9 +15,6 @@ import ( "cosmossdk.io/core/transaction" errorsmod "cosmossdk.io/errors/v2" - v1 "github.com/cometbft/cometbft/api/cometbft/abci/v1" - "github.com/cosmos/gogoproto/proto" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" diff --git a/server/v2/stf/branch/mergeiter.go b/server/v2/stf/branch/mergeiter.go index 58d237c09920..22e6320890ba 100644 --- a/server/v2/stf/branch/mergeiter.go +++ b/server/v2/stf/branch/mergeiter.go @@ -7,9 +7,7 @@ import ( corestore "cosmossdk.io/core/store" ) -var ( - errInvalidIterator = errors.New("invalid iterator") -) +var errInvalidIterator = errors.New("invalid iterator") // mergedIterator merges a parent Iterator and a child Iterator. // The child iterator may contain items that shadow or override items in the parent iterator. From 765bd5769e5caac3fe573606e554e63778ad9368 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 16:22:22 +0100 Subject: [PATCH 16/19] `make lint-fix` --- simapp/v2/simdv2/cmd/commands.go | 1 - tests/integration/accounts/base_account_test.go | 2 +- tests/integration/accounts/wiring_test.go | 4 +++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 636d28426d1b..8f900333e989 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -113,7 +113,6 @@ func InitRootCmd[T transaction.Tx]( deps.GlobalConfig, initCometOptions[T](), ) - if err != nil { return nil, err } diff --git a/tests/integration/accounts/base_account_test.go b/tests/integration/accounts/base_account_test.go index 367f099984d4..a50975b8ff79 100644 --- a/tests/integration/accounts/base_account_test.go +++ b/tests/integration/accounts/base_account_test.go @@ -6,6 +6,7 @@ import ( gogoproto "github.com/cosmos/gogoproto/proto" gogoany "github.com/cosmos/gogoproto/types/any" + "github.com/stretchr/testify/require" "cosmossdk.io/simapp" baseaccountv1 "cosmossdk.io/x/accounts/defaults/base/v1" @@ -17,7 +18,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) var ( diff --git a/tests/integration/accounts/wiring_test.go b/tests/integration/accounts/wiring_test.go index 466bfbc2b765..a60d941e49a8 100644 --- a/tests/integration/accounts/wiring_test.go +++ b/tests/integration/accounts/wiring_test.go @@ -3,12 +3,14 @@ package accounts import ( "testing" + "github.com/stretchr/testify/require" + "cosmossdk.io/core/header" storetypes "cosmossdk.io/store/types" counterv1 "cosmossdk.io/x/accounts/testing/counter/v1" "cosmossdk.io/x/bank/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" ) // TestDependencies aims to test wiring between different account components, From eb78af61f86e5e2f23eb2a44b8054b968787d4f7 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 16:53:16 +0100 Subject: [PATCH 17/19] updates --- server/v2/cometbft/abci.go | 48 +++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 42f34565c8bf..c7ba9123ddbb 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -11,6 +11,9 @@ import ( abci "github.com/cometbft/cometbft/abci/types" abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + txtypes "github.com/cosmos/cosmos-sdk/types/tx" gogoproto "github.com/cosmos/gogoproto/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" @@ -269,6 +272,50 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq handlerFullName = string(md.Input().FullName()) } + // special case for simulation as it is an external gRPC registered on the grpc server component + // and not on the app itself, so it won't pass the router afterwards. + if req.Path == "/cosmos.tx.v1beta1.Service/Simulate" { + simulateRequest := &txtypes.SimulateRequest{} + err = gogoproto.Unmarshal(req.Data, simulateRequest) + if err != nil { + return nil, true, fmt.Errorf("unable to decode gRPC request with path %s from ABCI.Query: %w", req.Path, err) + } + + tx, err := c.txCodec.Decode(simulateRequest.TxBytes) + if err != nil { + return nil, true, fmt.Errorf("failed to decode tx: %w", err) + } + + txResult, _, err := c.app.Simulate(ctx, tx) + if err != nil { + return nil, false, fmt.Errorf("%v with gas used: '%d'", err, txResult.GasUsed) + } + + msgResponses := make([]*codectypes.Any, 0, len(txResult.Resp)) + // pack the messages into Any + for _, msg := range txResult.Resp { + anyMsg, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, true, fmt.Errorf("failed to pack message response: %w", err) + } + + msgResponses = append(msgResponses, anyMsg) + } + + resp := &txtypes.SimulateResponse{ + GasInfo: &sdk.GasInfo{ + GasUsed: txResult.GasUsed, + GasWanted: txResult.GasWanted, + }, + Result: &sdk.Result{ + MsgResponses: msgResponses, + }, + } + + res, err := queryResponse(resp, req.Height) + return res, true, err + } + handler, found := c.queryHandlersMap[handlerFullName] if !found { return nil, true, fmt.Errorf("no query handler found for %s", req.Path) @@ -283,7 +330,6 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq resp := QueryResult(err, c.cfg.AppTomlConfig.Trace) resp.Height = req.Height return resp, true, err - } resp, err = queryResponse(res, req.Height) From 3f6c19bafa43b846b70aed054a54902ccf3ad361 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 18 Nov 2024 17:24:08 +0100 Subject: [PATCH 18/19] tpo --- server/v2/cometbft/abci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index c7ba9123ddbb..e8c72f6ef343 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -288,7 +288,7 @@ func (c *Consensus[T]) maybeRunGRPCQuery(ctx context.Context, req *abci.QueryReq txResult, _, err := c.app.Simulate(ctx, tx) if err != nil { - return nil, false, fmt.Errorf("%v with gas used: '%d'", err, txResult.GasUsed) + return nil, true, fmt.Errorf("%v with gas used: '%d'", err, txResult.GasUsed) } msgResponses := make([]*codectypes.Any, 0, len(txResult.Resp)) From c86df3a622d59aeb6c5ce69a418aa177b5ea53fc Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 19 Nov 2024 14:35:29 +0100 Subject: [PATCH 19/19] feedback --- api/cosmos/base/node/v2/query.pulsar.go | 1188 +---------------- api/cosmos/base/node/v2/query_grpc.pb.go | 40 - proto/cosmos/base/node/v2/query.proto | 19 +- server/v2/api/grpc/nodeservice/query.pb.go | 529 +------- server/v2/api/grpc/nodeservice/query.pb.gw.go | 65 - server/v2/api/grpc/nodeservice/service.go | 14 - server/v2/api/grpc/server.go | 30 +- server/v2/server_test.go | 2 +- simapp/v2/go.mod | 2 +- simapp/v2/simdv2/cmd/commands.go | 7 +- 10 files changed, 87 insertions(+), 1809 deletions(-) diff --git a/api/cosmos/base/node/v2/query.pulsar.go b/api/cosmos/base/node/v2/query.pulsar.go index 00373bb0df86..e4039ccde48b 100644 --- a/api/cosmos/base/node/v2/query.pulsar.go +++ b/api/cosmos/base/node/v2/query.pulsar.go @@ -4,12 +4,10 @@ package nodev2 import ( fmt "fmt" runtime "github.com/cosmos/cosmos-proto/runtime" - _ "github.com/cosmos/gogoproto/gogoproto" _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" io "io" reflect "reflect" sync "sync" @@ -791,977 +789,6 @@ func (x *fastReflection_ConfigResponse) ProtoMethods() *protoiface.Methods { } } -var ( - md_StatusRequest protoreflect.MessageDescriptor -) - -func init() { - file_cosmos_base_node_v2_query_proto_init() - md_StatusRequest = File_cosmos_base_node_v2_query_proto.Messages().ByName("StatusRequest") -} - -var _ protoreflect.Message = (*fastReflection_StatusRequest)(nil) - -type fastReflection_StatusRequest StatusRequest - -func (x *StatusRequest) ProtoReflect() protoreflect.Message { - return (*fastReflection_StatusRequest)(x) -} - -func (x *StatusRequest) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_base_node_v2_query_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_StatusRequest_messageType fastReflection_StatusRequest_messageType -var _ protoreflect.MessageType = fastReflection_StatusRequest_messageType{} - -type fastReflection_StatusRequest_messageType struct{} - -func (x fastReflection_StatusRequest_messageType) Zero() protoreflect.Message { - return (*fastReflection_StatusRequest)(nil) -} -func (x fastReflection_StatusRequest_messageType) New() protoreflect.Message { - return new(fastReflection_StatusRequest) -} -func (x fastReflection_StatusRequest_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_StatusRequest -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_StatusRequest) Descriptor() protoreflect.MessageDescriptor { - return md_StatusRequest -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_StatusRequest) Type() protoreflect.MessageType { - return _fastReflection_StatusRequest_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_StatusRequest) New() protoreflect.Message { - return new(fastReflection_StatusRequest) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_StatusRequest) Interface() protoreflect.ProtoMessage { - return (*StatusRequest)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_StatusRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_StatusRequest) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusRequest) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_StatusRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_StatusRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusRequest")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusRequest does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_StatusRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.StatusRequest", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_StatusRequest) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusRequest) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_StatusRequest) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_StatusRequest) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*StatusRequest) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*StatusRequest) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*StatusRequest) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - -var ( - md_StatusResponse protoreflect.MessageDescriptor - fd_StatusResponse_height protoreflect.FieldDescriptor - fd_StatusResponse_timestamp protoreflect.FieldDescriptor - fd_StatusResponse_app_hash protoreflect.FieldDescriptor - fd_StatusResponse_validator_hash protoreflect.FieldDescriptor -) - -func init() { - file_cosmos_base_node_v2_query_proto_init() - md_StatusResponse = File_cosmos_base_node_v2_query_proto.Messages().ByName("StatusResponse") - fd_StatusResponse_height = md_StatusResponse.Fields().ByName("height") - fd_StatusResponse_timestamp = md_StatusResponse.Fields().ByName("timestamp") - fd_StatusResponse_app_hash = md_StatusResponse.Fields().ByName("app_hash") - fd_StatusResponse_validator_hash = md_StatusResponse.Fields().ByName("validator_hash") -} - -var _ protoreflect.Message = (*fastReflection_StatusResponse)(nil) - -type fastReflection_StatusResponse StatusResponse - -func (x *StatusResponse) ProtoReflect() protoreflect.Message { - return (*fastReflection_StatusResponse)(x) -} - -func (x *StatusResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_base_node_v2_query_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -var _fastReflection_StatusResponse_messageType fastReflection_StatusResponse_messageType -var _ protoreflect.MessageType = fastReflection_StatusResponse_messageType{} - -type fastReflection_StatusResponse_messageType struct{} - -func (x fastReflection_StatusResponse_messageType) Zero() protoreflect.Message { - return (*fastReflection_StatusResponse)(nil) -} -func (x fastReflection_StatusResponse_messageType) New() protoreflect.Message { - return new(fastReflection_StatusResponse) -} -func (x fastReflection_StatusResponse_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_StatusResponse -} - -// Descriptor returns message descriptor, which contains only the protobuf -// type information for the message. -func (x *fastReflection_StatusResponse) Descriptor() protoreflect.MessageDescriptor { - return md_StatusResponse -} - -// Type returns the message type, which encapsulates both Go and protobuf -// type information. If the Go type information is not needed, -// it is recommended that the message descriptor be used instead. -func (x *fastReflection_StatusResponse) Type() protoreflect.MessageType { - return _fastReflection_StatusResponse_messageType -} - -// New returns a newly allocated and mutable empty message. -func (x *fastReflection_StatusResponse) New() protoreflect.Message { - return new(fastReflection_StatusResponse) -} - -// Interface unwraps the message reflection interface and -// returns the underlying ProtoMessage interface. -func (x *fastReflection_StatusResponse) Interface() protoreflect.ProtoMessage { - return (*StatusResponse)(x) -} - -// Range iterates over every populated field in an undefined order, -// calling f for each field descriptor and value encountered. -// Range returns immediately if f returns false. -// While iterating, mutating operations may only be performed -// on the current field descriptor. -func (x *fastReflection_StatusResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if x.Height != uint64(0) { - value := protoreflect.ValueOfUint64(x.Height) - if !f(fd_StatusResponse_height, value) { - return - } - } - if x.Timestamp != nil { - value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) - if !f(fd_StatusResponse_timestamp, value) { - return - } - } - if len(x.AppHash) != 0 { - value := protoreflect.ValueOfBytes(x.AppHash) - if !f(fd_StatusResponse_app_hash, value) { - return - } - } - if len(x.ValidatorHash) != 0 { - value := protoreflect.ValueOfBytes(x.ValidatorHash) - if !f(fd_StatusResponse_validator_hash, value) { - return - } - } -} - -// Has reports whether a field is populated. -// -// Some fields have the property of nullability where it is possible to -// distinguish between the default value of a field and whether the field -// was explicitly populated with the default value. Singular message fields, -// member fields of a oneof, and proto2 scalar fields are nullable. Such -// fields are populated only if explicitly set. -// -// In other cases (aside from the nullable cases above), -// a proto3 scalar field is populated if it contains a non-zero value, and -// a repeated field is populated if it is non-empty. -func (x *fastReflection_StatusResponse) Has(fd protoreflect.FieldDescriptor) bool { - switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.height": - return x.Height != uint64(0) - case "cosmos.base.node.v2.StatusResponse.timestamp": - return x.Timestamp != nil - case "cosmos.base.node.v2.StatusResponse.app_hash": - return len(x.AppHash) != 0 - case "cosmos.base.node.v2.StatusResponse.validator_hash": - return len(x.ValidatorHash) != 0 - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) - } -} - -// Clear clears the field such that a subsequent Has call reports false. -// -// Clearing an extension field clears both the extension type and value -// associated with the given field number. -// -// Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusResponse) Clear(fd protoreflect.FieldDescriptor) { - switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.height": - x.Height = uint64(0) - case "cosmos.base.node.v2.StatusResponse.timestamp": - x.Timestamp = nil - case "cosmos.base.node.v2.StatusResponse.app_hash": - x.AppHash = nil - case "cosmos.base.node.v2.StatusResponse.validator_hash": - x.ValidatorHash = nil - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) - } -} - -// Get retrieves the value for a field. -// -// For unpopulated scalars, it returns the default value, where -// the default value of a bytes scalar is guaranteed to be a copy. -// For unpopulated composite types, it returns an empty, read-only view -// of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_StatusResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { - switch descriptor.FullName() { - case "cosmos.base.node.v2.StatusResponse.height": - value := x.Height - return protoreflect.ValueOfUint64(value) - case "cosmos.base.node.v2.StatusResponse.timestamp": - value := x.Timestamp - return protoreflect.ValueOfMessage(value.ProtoReflect()) - case "cosmos.base.node.v2.StatusResponse.app_hash": - value := x.AppHash - return protoreflect.ValueOfBytes(value) - case "cosmos.base.node.v2.StatusResponse.validator_hash": - value := x.ValidatorHash - return protoreflect.ValueOfBytes(value) - default: - if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", descriptor.FullName())) - } -} - -// Set stores the value for a field. -// -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType. -// When setting a composite type, it is unspecified whether the stored value -// aliases the source's memory in any way. If the composite value is an -// empty, read-only value, then it panics. -// -// Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { - switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.height": - x.Height = value.Uint() - case "cosmos.base.node.v2.StatusResponse.timestamp": - x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) - case "cosmos.base.node.v2.StatusResponse.app_hash": - x.AppHash = value.Bytes() - case "cosmos.base.node.v2.StatusResponse.validator_hash": - x.ValidatorHash = value.Bytes() - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) - } -} - -// Mutable returns a mutable reference to a composite type. -// -// If the field is unpopulated, it may allocate a composite value. -// For a field belonging to a oneof, it implicitly clears any other field -// that may be currently set within the same oneof. -// For extension fields, it implicitly stores the provided ExtensionType -// if not already stored. -// It panics if the field does not contain a composite type. -// -// Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.timestamp": - if x.Timestamp == nil { - x.Timestamp = new(timestamppb.Timestamp) - } - return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) - case "cosmos.base.node.v2.StatusResponse.height": - panic(fmt.Errorf("field height of message cosmos.base.node.v2.StatusResponse is not mutable")) - case "cosmos.base.node.v2.StatusResponse.app_hash": - panic(fmt.Errorf("field app_hash of message cosmos.base.node.v2.StatusResponse is not mutable")) - case "cosmos.base.node.v2.StatusResponse.validator_hash": - panic(fmt.Errorf("field validator_hash of message cosmos.base.node.v2.StatusResponse is not mutable")) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) - } -} - -// NewField returns a new value that is assignable to the field -// for the given descriptor. For scalars, this returns the default value. -// For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_StatusResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { - switch fd.FullName() { - case "cosmos.base.node.v2.StatusResponse.height": - return protoreflect.ValueOfUint64(uint64(0)) - case "cosmos.base.node.v2.StatusResponse.timestamp": - m := new(timestamppb.Timestamp) - return protoreflect.ValueOfMessage(m.ProtoReflect()) - case "cosmos.base.node.v2.StatusResponse.app_hash": - return protoreflect.ValueOfBytes(nil) - case "cosmos.base.node.v2.StatusResponse.validator_hash": - return protoreflect.ValueOfBytes(nil) - default: - if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.base.node.v2.StatusResponse")) - } - panic(fmt.Errorf("message cosmos.base.node.v2.StatusResponse does not contain field %s", fd.FullName())) - } -} - -// WhichOneof reports which field within the oneof is populated, -// returning nil if none are populated. -// It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_StatusResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - switch d.FullName() { - default: - panic(fmt.Errorf("%s is not a oneof field in cosmos.base.node.v2.StatusResponse", d.FullName())) - } - panic("unreachable") -} - -// GetUnknown retrieves the entire list of unknown fields. -// The caller may only mutate the contents of the RawFields -// if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_StatusResponse) GetUnknown() protoreflect.RawFields { - return x.unknownFields -} - -// SetUnknown stores an entire list of unknown fields. -// The raw fields must be syntactically valid according to the wire format. -// An implementation may panic if this is not the case. -// Once stored, the caller must not mutate the content of the RawFields. -// An empty RawFields may be passed to clear the fields. -// -// SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_StatusResponse) SetUnknown(fields protoreflect.RawFields) { - x.unknownFields = fields -} - -// IsValid reports whether the message is valid. -// -// An invalid message is an empty, read-only value. -// -// An invalid message often corresponds to a nil pointer of the concrete -// message type, but the details are implementation dependent. -// Validity is not part of the protobuf data model, and may not -// be preserved in marshaling or other operations. -func (x *fastReflection_StatusResponse) IsValid() bool { - return x != nil -} - -// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. -// This method may return nil. -// -// The returned methods type is identical to -// "google.golang.org/protobuf/runtime/protoiface".Methods. -// Consult the protoiface package documentation for details. -func (x *fastReflection_StatusResponse) ProtoMethods() *protoiface.Methods { - size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*StatusResponse) - if x == nil { - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: 0, - } - } - options := runtime.SizeInputToOptions(input) - _ = options - var n int - var l int - _ = l - if x.Height != 0 { - n += 1 + runtime.Sov(uint64(x.Height)) - } - if x.Timestamp != nil { - l = options.Size(x.Timestamp) - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.AppHash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - l = len(x.ValidatorHash) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) - } - if x.unknownFields != nil { - n += len(x.unknownFields) - } - return protoiface.SizeOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Size: n, - } - } - - marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*StatusResponse) - if x == nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - options := runtime.MarshalInputToOptions(input) - _ = options - size := options.Size(x) - dAtA := make([]byte, size) - i := len(dAtA) - _ = i - var l int - _ = l - if x.unknownFields != nil { - i -= len(x.unknownFields) - copy(dAtA[i:], x.unknownFields) - } - if len(x.ValidatorHash) > 0 { - i -= len(x.ValidatorHash) - copy(dAtA[i:], x.ValidatorHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ValidatorHash))) - i-- - dAtA[i] = 0x22 - } - if len(x.AppHash) > 0 { - i -= len(x.AppHash) - copy(dAtA[i:], x.AppHash) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AppHash))) - i-- - dAtA[i] = 0x1a - } - if x.Timestamp != nil { - encoded, err := options.Marshal(x.Timestamp) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x12 - } - if x.Height != 0 { - i = runtime.EncodeVarint(dAtA, i, uint64(x.Height)) - i-- - dAtA[i] = 0x8 - } - if input.Buf != nil { - input.Buf = append(input.Buf, dAtA...) - } else { - input.Buf = dAtA - } - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, nil - } - unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*StatusResponse) - if x == nil { - return protoiface.UnmarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Flags: input.Flags, - }, nil - } - options := runtime.UnmarshalInputToOptions(input) - _ = options - dAtA := input.Buf - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - x.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - x.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Timestamp == nil { - x.Timestamp = ×tamppb.Timestamp{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.AppHash = append(x.AppHash[:0], dAtA[iNdEx:postIndex]...) - if x.AppHash == nil { - x.AppHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.ValidatorHash = append(x.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) - if x.ValidatorHash == nil { - x.ValidatorHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := runtime.Skip(dAtA[iNdEx:]) - if err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if (iNdEx + skippy) > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if !options.DiscardUnknown { - x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) - } - iNdEx += skippy - } - } - - if iNdEx > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil - } - return &protoiface.Methods{ - NoUnkeyedLiterals: struct{}{}, - Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, - Size: size, - Marshal: marshal, - Unmarshal: unmarshal, - Merge: nil, - CheckInitialized: nil, - } -} - // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -1838,93 +865,6 @@ func (x *ConfigResponse) GetMinimumGasPrice() string { return "" } -// StatusRequest defines the request structure for the status of a node. -type StatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *StatusRequest) Reset() { - *x = StatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_base_node_v2_query_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusRequest) ProtoMessage() {} - -// Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. -func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{2} -} - -// StatusResponse defines the response structure for the status of a node. -type StatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` // current block height - Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // block height timestamp - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` // app hash of the current block - ValidatorHash []byte `protobuf:"bytes,4,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` // validator hash provided by the consensus header -} - -func (x *StatusResponse) Reset() { - *x = StatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cosmos_base_node_v2_query_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StatusResponse) ProtoMessage() {} - -// Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. -func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_cosmos_base_node_v2_query_proto_rawDescGZIP(), []int{3} -} - -func (x *StatusResponse) GetHeight() uint64 { - if x != nil { - return x.Height - } - return 0 -} - -func (x *StatusResponse) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *StatusResponse) GetAppHash() []byte { - if x != nil { - return x.AppHash - } - return nil -} - -func (x *StatusResponse) GetValidatorHash() []byte { - if x != nil { - return x.ValidatorHash - } - return nil -} - var File_cosmos_base_node_v2_query_proto protoreflect.FileDescriptor var file_cosmos_base_node_v2_query_proto_rawDesc = []byte{ @@ -1933,55 +873,33 @@ var file_cosmos_base_node_v2_query_proto_rawDesc = []byte{ 0x6f, 0x12, 0x13, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x0e, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, - 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, - 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, - 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xaa, 0x01, 0x0a, 0x0e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, - 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x68, - 0x61, 0x73, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x69, 0x64, - 0x61, 0x74, 0x6f, 0x72, 0x48, 0x61, 0x73, 0x68, 0x32, 0xf9, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, - 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, - 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, - 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x76, 0x0a, 0x06, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, - 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2b, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, - 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x43, 0x42, - 0x4e, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x2e, - 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1f, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, - 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x3a, - 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x69, 0x6d, + 0x75, 0x6d, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x47, 0x61, 0x73, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x32, 0x81, 0x01, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x76, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0xc1, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, + 0x2e, 0x76, 0x32, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x2b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, + 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x76, 0x32, 0xa2, 0x02, + 0x03, 0x43, 0x42, 0x4e, 0xaa, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, + 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x13, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x1f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x73, 0x65, 0x5c, 0x4e, + 0x6f, 0x64, 0x65, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x16, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, 0x73, + 0x65, 0x3a, 0x3a, 0x4e, 0x6f, 0x64, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1996,25 +914,19 @@ func file_cosmos_base_node_v2_query_proto_rawDescGZIP() []byte { return file_cosmos_base_node_v2_query_proto_rawDescData } -var file_cosmos_base_node_v2_query_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_cosmos_base_node_v2_query_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_cosmos_base_node_v2_query_proto_goTypes = []interface{}{ - (*ConfigRequest)(nil), // 0: cosmos.base.node.v2.ConfigRequest - (*ConfigResponse)(nil), // 1: cosmos.base.node.v2.ConfigResponse - (*StatusRequest)(nil), // 2: cosmos.base.node.v2.StatusRequest - (*StatusResponse)(nil), // 3: cosmos.base.node.v2.StatusResponse - (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*ConfigRequest)(nil), // 0: cosmos.base.node.v2.ConfigRequest + (*ConfigResponse)(nil), // 1: cosmos.base.node.v2.ConfigResponse } var file_cosmos_base_node_v2_query_proto_depIdxs = []int32{ - 4, // 0: cosmos.base.node.v2.StatusResponse.timestamp:type_name -> google.protobuf.Timestamp - 0, // 1: cosmos.base.node.v2.Service.Config:input_type -> cosmos.base.node.v2.ConfigRequest - 2, // 2: cosmos.base.node.v2.Service.Status:input_type -> cosmos.base.node.v2.StatusRequest - 1, // 3: cosmos.base.node.v2.Service.Config:output_type -> cosmos.base.node.v2.ConfigResponse - 3, // 4: cosmos.base.node.v2.Service.Status:output_type -> cosmos.base.node.v2.StatusResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 0, // 0: cosmos.base.node.v2.Service.Config:input_type -> cosmos.base.node.v2.ConfigRequest + 1, // 1: cosmos.base.node.v2.Service.Config:output_type -> cosmos.base.node.v2.ConfigResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_cosmos_base_node_v2_query_proto_init() } @@ -2047,30 +959,6 @@ func file_cosmos_base_node_v2_query_proto_init() { return nil } } - file_cosmos_base_node_v2_query_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cosmos_base_node_v2_query_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -2078,7 +966,7 @@ func file_cosmos_base_node_v2_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_base_node_v2_query_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 2, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/base/node/v2/query_grpc.pb.go b/api/cosmos/base/node/v2/query_grpc.pb.go index bbc87612fa09..f87770fb5e63 100644 --- a/api/cosmos/base/node/v2/query_grpc.pb.go +++ b/api/cosmos/base/node/v2/query_grpc.pb.go @@ -20,7 +20,6 @@ const _ = grpc.SupportPackageIsVersion9 const ( Service_Config_FullMethodName = "/cosmos.base.node.v2.Service/Config" - Service_Status_FullMethodName = "/cosmos.base.node.v2.Service/Status" ) // ServiceClient is the client API for Service service. @@ -31,8 +30,6 @@ const ( type ServiceClient interface { // Config queries for the operator configuration. Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) - // Status queries for the node status. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type serviceClient struct { @@ -53,16 +50,6 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g return out, nil } -func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(StatusResponse) - err := c.cc.Invoke(ctx, Service_Status_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - // ServiceServer is the server API for Service service. // All implementations must embed UnimplementedServiceServer // for forward compatibility. @@ -71,8 +58,6 @@ func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...g type ServiceServer interface { // Config queries for the operator configuration. Config(context.Context, *ConfigRequest) (*ConfigResponse, error) - // Status queries for the node status. - Status(context.Context, *StatusRequest) (*StatusResponse, error) mustEmbedUnimplementedServiceServer() } @@ -86,9 +71,6 @@ type UnimplementedServiceServer struct{} func (UnimplementedServiceServer) Config(context.Context, *ConfigRequest) (*ConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") } -func (UnimplementedServiceServer) Status(context.Context, *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} func (UnimplementedServiceServer) testEmbeddedByValue() {} @@ -128,24 +110,6 @@ func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: Service_Status_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - // Service_ServiceDesc is the grpc.ServiceDesc for Service service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -157,10 +121,6 @@ var Service_ServiceDesc = grpc.ServiceDesc{ MethodName: "Config", Handler: _Service_Config_Handler, }, - { - MethodName: "Status", - Handler: _Service_Status_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/base/node/v2/query.proto", diff --git a/proto/cosmos/base/node/v2/query.proto b/proto/cosmos/base/node/v2/query.proto index 76120c2f784a..24de6fd21223 100644 --- a/proto/cosmos/base/node/v2/query.proto +++ b/proto/cosmos/base/node/v2/query.proto @@ -2,8 +2,6 @@ syntax = "proto3"; package cosmos.base.node.v2; import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; option go_package = "cosmossdk.io/server/v2/api/grpc/nodeservice"; @@ -13,10 +11,6 @@ service Service { rpc Config(ConfigRequest) returns (ConfigResponse) { option (google.api.http).get = "/cosmos/base/node/v2/config"; } - // Status queries for the node status. - rpc Status(StatusRequest) returns (StatusResponse) { - option (google.api.http).get = "/cosmos/base/node/v2/status"; - } } // ConfigRequest defines the request structure for the Config gRPC query. @@ -25,15 +19,4 @@ message ConfigRequest {} // ConfigResponse defines the response structure for the Config gRPC query. message ConfigResponse { string minimum_gas_price = 1; -} - -// StatusRequest defines the request structure for the status of a node. -message StatusRequest {} - -// StatusResponse defines the response structure for the status of a node. -message StatusResponse { - uint64 height = 1; // current block height - google.protobuf.Timestamp timestamp = 2 [(gogoproto.stdtime) = true]; // block height timestamp - bytes app_hash = 3; // app hash of the current block - bytes validator_hash = 4; // validator hash provided by the consensus header -} +} \ No newline at end of file diff --git a/server/v2/api/grpc/nodeservice/query.pb.go b/server/v2/api/grpc/nodeservice/query.pb.go index 08ef1d0e9fe9..7201c35db4f1 100644 --- a/server/v2/api/grpc/nodeservice/query.pb.go +++ b/server/v2/api/grpc/nodeservice/query.pb.go @@ -6,26 +6,21 @@ package nodeservice import ( context "context" fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - github_com_cosmos_gogoproto_types "github.com/cosmos/gogoproto/types" _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf -var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -115,150 +110,33 @@ func (m *ConfigResponse) GetMinimumGasPrice() string { return "" } -// StatusRequest defines the request structure for the status of a node. -type StatusRequest struct { -} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e86a941b0be4e1ff, []int{2} -} -func (m *StatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(m, src) -} -func (m *StatusRequest) XXX_Size() int { - return m.Size() -} -func (m *StatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusRequest proto.InternalMessageInfo - -// StatusResponse defines the response structure for the status of a node. -type StatusResponse struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Timestamp *time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` - AppHash []byte `protobuf:"bytes,3,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - ValidatorHash []byte `protobuf:"bytes,4,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e86a941b0be4e1ff, []int{3} -} -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} -func (m *StatusResponse) XXX_Size() int { - return m.Size() -} -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *StatusResponse) GetTimestamp() *time.Time { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *StatusResponse) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - -func (m *StatusResponse) GetValidatorHash() []byte { - if m != nil { - return m.ValidatorHash - } - return nil -} - func init() { proto.RegisterType((*ConfigRequest)(nil), "cosmos.base.node.v2.ConfigRequest") proto.RegisterType((*ConfigResponse)(nil), "cosmos.base.node.v2.ConfigResponse") - proto.RegisterType((*StatusRequest)(nil), "cosmos.base.node.v2.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "cosmos.base.node.v2.StatusResponse") } func init() { proto.RegisterFile("cosmos/base/node/v2/query.proto", fileDescriptor_e86a941b0be4e1ff) } var fileDescriptor_e86a941b0be4e1ff = []byte{ - // 430 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0x41, 0x6f, 0xd3, 0x30, - 0x14, 0xc7, 0xeb, 0x51, 0x75, 0xcc, 0xb0, 0x4e, 0x18, 0x84, 0x4a, 0x81, 0xb4, 0xca, 0x84, 0x54, - 0x81, 0x64, 0x4b, 0xe1, 0x8a, 0x38, 0x0c, 0x21, 0x38, 0xa2, 0x8c, 0x13, 0x97, 0xca, 0x4d, 0x3d, - 0xc7, 0x62, 0x89, 0x3d, 0x3f, 0x27, 0x12, 0x57, 0x3e, 0xc1, 0x24, 0xbe, 0x05, 0x9f, 0x84, 0xe3, - 0x24, 0x2e, 0xdc, 0x40, 0x2d, 0x5f, 0x82, 0x1b, 0x72, 0x9c, 0x0c, 0x55, 0x5a, 0xd9, 0xcd, 0xfe, - 0xfb, 0xf7, 0xfe, 0x2f, 0xef, 0xff, 0x82, 0x27, 0x99, 0x86, 0x42, 0x03, 0x5b, 0x70, 0x10, 0xac, - 0xd4, 0x4b, 0xc1, 0xea, 0x84, 0x9d, 0x55, 0xc2, 0x7e, 0xa2, 0xc6, 0x6a, 0xa7, 0xc9, 0xdd, 0x00, - 0x50, 0x0f, 0x50, 0x0f, 0xd0, 0x3a, 0x19, 0x3f, 0x92, 0x5a, 0xcb, 0x53, 0xc1, 0xb8, 0x51, 0x8c, - 0x97, 0xa5, 0x76, 0xdc, 0x29, 0x5d, 0x42, 0x28, 0x19, 0x4f, 0xda, 0xd7, 0xe6, 0xb6, 0xa8, 0x4e, - 0x98, 0x53, 0x85, 0x00, 0xc7, 0x0b, 0xd3, 0x02, 0xf7, 0xa4, 0x96, 0xba, 0x39, 0x32, 0x7f, 0x0a, - 0x6a, 0x7c, 0x80, 0xf7, 0x5f, 0xe9, 0xf2, 0x44, 0xc9, 0x54, 0x9c, 0x55, 0x02, 0x5c, 0xfc, 0x02, - 0x0f, 0x3b, 0x01, 0x8c, 0x2e, 0x41, 0x90, 0xa7, 0xf8, 0x4e, 0xa1, 0x4a, 0x55, 0x54, 0xc5, 0x5c, - 0x72, 0x98, 0x1b, 0xab, 0x32, 0x31, 0x42, 0x53, 0x34, 0xdb, 0x4b, 0x0f, 0xda, 0x87, 0x37, 0x1c, - 0xde, 0x79, 0xd9, 0xdb, 0x1d, 0x3b, 0xee, 0x2a, 0xe8, 0xec, 0xbe, 0x22, 0x3c, 0xec, 0x94, 0xd6, - 0xef, 0x3e, 0x1e, 0xe4, 0x42, 0xc9, 0xdc, 0x35, 0x26, 0xfd, 0xb4, 0xbd, 0x91, 0x97, 0x78, 0xef, - 0xf2, 0x9b, 0x47, 0x3b, 0x53, 0x34, 0xbb, 0x95, 0x8c, 0x69, 0x98, 0x8a, 0x76, 0x53, 0xd1, 0xf7, - 0x1d, 0x71, 0xd4, 0x3f, 0xff, 0x39, 0x41, 0xe9, 0xbf, 0x12, 0xf2, 0x00, 0xdf, 0xe4, 0xc6, 0xcc, - 0x73, 0x0e, 0xf9, 0xe8, 0xc6, 0x14, 0xcd, 0x6e, 0xa7, 0xbb, 0xdc, 0x98, 0xb7, 0x1c, 0x72, 0xf2, - 0x04, 0x0f, 0x6b, 0x7e, 0xaa, 0x96, 0xdc, 0x69, 0x1b, 0x80, 0x7e, 0x03, 0xec, 0x5f, 0xaa, 0x1e, - 0x4b, 0xfe, 0x20, 0xbc, 0x7b, 0x2c, 0x6c, 0xad, 0x32, 0x41, 0x6a, 0x3c, 0x08, 0x39, 0x90, 0x98, - 0x5e, 0xb1, 0x0d, 0xba, 0x91, 0xda, 0xf8, 0xf0, 0xbf, 0x4c, 0x18, 0x3c, 0x3e, 0xfc, 0xfc, 0xfd, - 0xf7, 0x97, 0x9d, 0xc7, 0xe4, 0x21, 0xbb, 0x6a, 0xff, 0x59, 0xe8, 0x56, 0xe3, 0x41, 0xc8, 0x6b, - 0x4b, 0xdf, 0x8d, 0x78, 0xb7, 0xf4, 0xdd, 0x0c, 0xfc, 0x9a, 0xbe, 0xd0, 0xc0, 0x47, 0xaf, 0xbf, - 0xad, 0x22, 0x74, 0xb1, 0x8a, 0xd0, 0xaf, 0x55, 0x84, 0xce, 0xd7, 0x51, 0xef, 0x62, 0x1d, 0xf5, - 0x7e, 0xac, 0xa3, 0xde, 0x87, 0x67, 0xa1, 0x0a, 0x96, 0x1f, 0xa9, 0xd2, 0x0c, 0x84, 0xad, 0x85, - 0xf5, 0x85, 0xfe, 0x3f, 0x94, 0xd6, 0x64, 0x8d, 0x13, 0x84, 0xd8, 0x16, 0x83, 0x66, 0x53, 0xcf, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x97, 0xef, 0x5b, 0x0e, 0xe3, 0x02, 0x00, 0x00, + // 275 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xb1, 0x4a, 0xf4, 0x40, + 0x14, 0x85, 0x33, 0x7f, 0xb1, 0x3f, 0x0e, 0xe8, 0x62, 0x6c, 0x64, 0xd5, 0x51, 0xb2, 0x8d, 0x28, + 0xcc, 0x40, 0x6c, 0xad, 0x14, 0xb1, 0x95, 0xb5, 0xb3, 0x59, 0x66, 0xb3, 0xd7, 0x30, 0x68, 0xe6, + 0x66, 0xe7, 0x26, 0x01, 0x4b, 0x7d, 0x02, 0xc1, 0x97, 0xb2, 0x5c, 0xb0, 0xb1, 0x94, 0xc4, 0x07, + 0x91, 0xc9, 0x68, 0x21, 0x2c, 0xb6, 0xe7, 0x7e, 0xe7, 0xdc, 0xc3, 0xe1, 0xfb, 0x19, 0x52, 0x81, + 0xa4, 0x66, 0x9a, 0x40, 0x59, 0x9c, 0x83, 0x6a, 0x52, 0xb5, 0xa8, 0xc1, 0x3d, 0xc8, 0xd2, 0x61, + 0x85, 0xf1, 0x56, 0x00, 0xa4, 0x07, 0xa4, 0x07, 0x64, 0x93, 0x8e, 0x76, 0x73, 0xc4, 0xfc, 0x1e, + 0x94, 0x2e, 0x8d, 0xd2, 0xd6, 0x62, 0xa5, 0x2b, 0x83, 0x96, 0x82, 0x25, 0x19, 0xf2, 0xf5, 0x73, + 0xb4, 0xb7, 0x26, 0x9f, 0xc0, 0xa2, 0x06, 0xaa, 0x92, 0x53, 0xbe, 0xf1, 0x23, 0x50, 0x89, 0x96, + 0x20, 0x3e, 0xe2, 0x9b, 0x85, 0xb1, 0xa6, 0xa8, 0x8b, 0x69, 0xae, 0x69, 0x5a, 0x3a, 0x93, 0xc1, + 0x36, 0x3b, 0x60, 0x87, 0x6b, 0x93, 0xe1, 0xf7, 0xe1, 0x52, 0xd3, 0x95, 0x97, 0xd3, 0x47, 0xc6, + 0xff, 0x5f, 0x83, 0x6b, 0x4c, 0x06, 0x71, 0xc3, 0x07, 0x21, 0x29, 0x4e, 0xe4, 0x8a, 0x62, 0xf2, + 0xd7, 0xdf, 0xd1, 0xf8, 0x4f, 0x26, 0x54, 0x49, 0xc6, 0x4f, 0x6f, 0x9f, 0x2f, 0xff, 0xf6, 0xe2, + 0x1d, 0xb5, 0x6a, 0x8a, 0xac, 0x87, 0xcf, 0x2e, 0x5e, 0x5b, 0xc1, 0x96, 0xad, 0x60, 0x1f, 0xad, + 0x60, 0xcf, 0x9d, 0x88, 0x96, 0x9d, 0x88, 0xde, 0x3b, 0x11, 0xdd, 0x1c, 0x07, 0x17, 0xcd, 0xef, + 0xa4, 0x41, 0x45, 0xe0, 0x1a, 0x70, 0xde, 0xe8, 0xa7, 0xc9, 0x5d, 0x99, 0xf5, 0x49, 0x14, 0xea, + 0xcf, 0x06, 0xfd, 0x40, 0x27, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xb3, 0x6b, 0x93, 0x76, + 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -275,8 +153,6 @@ const _ = grpc.SupportPackageIsVersion4 type ServiceClient interface { // Config queries for the operator configuration. Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error) - // Status queries for the node status. - Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) } type serviceClient struct { @@ -296,21 +172,10 @@ func (c *serviceClient) Config(ctx context.Context, in *ConfigRequest, opts ...g return out, nil } -func (c *serviceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { - out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/cosmos.base.node.v2.Service/Status", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // ServiceServer is the server API for Service service. type ServiceServer interface { // Config queries for the operator configuration. Config(context.Context, *ConfigRequest) (*ConfigResponse, error) - // Status queries for the node status. - Status(context.Context, *StatusRequest) (*StatusResponse, error) } // UnimplementedServiceServer can be embedded to have forward compatible implementations. @@ -320,9 +185,6 @@ type UnimplementedServiceServer struct { func (*UnimplementedServiceServer) Config(ctx context.Context, req *ConfigRequest) (*ConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Config not implemented") } -func (*UnimplementedServiceServer) Status(ctx context.Context, req *StatusRequest) (*StatusResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Status not implemented") -} func RegisterServiceServer(s grpc1.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) @@ -346,24 +208,6 @@ func _Service_Config_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } -func _Service_Status_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StatusRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ServiceServer).Status(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/cosmos.base.node.v2.Service/Status", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ServiceServer).Status(ctx, req.(*StatusRequest)) - } - return interceptor(ctx, in, info, handler) -} - var Service_serviceDesc = _Service_serviceDesc var _Service_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.base.node.v2.Service", @@ -373,10 +217,6 @@ var _Service_serviceDesc = grpc.ServiceDesc{ MethodName: "Config", Handler: _Service_Config_Handler, }, - { - MethodName: "Status", - Handler: _Service_Status_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/base/node/v2/query.proto", @@ -435,81 +275,6 @@ func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorHash) > 0 { - i -= len(m.ValidatorHash) - copy(dAtA[i:], m.ValidatorHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorHash))) - i-- - dAtA[i] = 0x22 - } - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintQuery(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x1a - } - if m.Timestamp != nil { - n1, err1 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(*m.Timestamp, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintQuery(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x12 - } - if m.Height != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -543,39 +308,6 @@ func (m *ConfigResponse) Size() (n int) { return n } -func (m *StatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *StatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovQuery(uint64(m.Height)) - } - if m.Timestamp != nil { - l = github_com_cosmos_gogoproto_types.SizeOfStdTime(*m.Timestamp) - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ValidatorHash) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -714,229 +446,6 @@ func (m *ConfigResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *StatusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *StatusResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Timestamp == nil { - m.Timestamp = new(time.Time) - } - if err := github_com_cosmos_gogoproto_types.StdTimeUnmarshal(m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorHash = append(m.ValidatorHash[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorHash == nil { - m.ValidatorHash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/server/v2/api/grpc/nodeservice/query.pb.gw.go b/server/v2/api/grpc/nodeservice/query.pb.gw.go index e6c9e4d772c4..b301d29dccfe 100644 --- a/server/v2/api/grpc/nodeservice/query.pb.gw.go +++ b/server/v2/api/grpc/nodeservice/query.pb.gw.go @@ -51,24 +51,6 @@ func local_request_Service_Config_0(ctx context.Context, marshaler runtime.Marsh } -func request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, client ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StatusRequest - var metadata runtime.ServerMetadata - - msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Service_Status_0(ctx context.Context, marshaler runtime.Marshaler, server ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq StatusRequest - var metadata runtime.ServerMetadata - - msg, err := server.Status(ctx, &protoReq) - return msg, metadata, err - -} - // RegisterServiceHandlerServer registers the http handlers for service Service to "mux". // UnaryRPC :call ServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -98,29 +80,6 @@ func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, se }) - mux.Handle("GET", pattern_Service_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Service_Status_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } @@ -182,37 +141,13 @@ func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl }) - mux.Handle("GET", pattern_Service_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Service_Status_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Service_Status_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - return nil } var ( pattern_Service_Config_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v2", "config"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Service_Status_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "base", "node", "v2", "status"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( forward_Service_Config_0 = runtime.ForwardResponseMessage - - forward_Service_Status_0 = runtime.ForwardResponseMessage ) diff --git a/server/v2/api/grpc/nodeservice/service.go b/server/v2/api/grpc/nodeservice/service.go index b2df2221254f..51f84d36142f 100644 --- a/server/v2/api/grpc/nodeservice/service.go +++ b/server/v2/api/grpc/nodeservice/service.go @@ -2,7 +2,6 @@ package nodeservice import ( context "context" - fmt "fmt" "cosmossdk.io/core/server" ) @@ -28,16 +27,3 @@ func (s queryServer) Config(ctx context.Context, _ *ConfigRequest) (*ConfigRespo MinimumGasPrice: minGasPricesStr, }, nil } - -func (s queryServer) Status(ctx context.Context, _ *StatusRequest) (*StatusResponse, error) { - // note, environment nor execution context isn't available in the context - - // return &StatusResponse{ - // Height: uint64(headerInfo.Height), - // Timestamp: &headerInfo.Time, - // AppHash: headerInfo.AppHash, - // ValidatorHash: headerInfo.Hash, - // }, nil - - return &StatusResponse{}, fmt.Errorf("not implemented") -} diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index c40696871b85..9aa06515de33 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -40,7 +40,8 @@ type Server[T transaction.Tx] struct { config *Config cfgOptions []CfgOption - grpcSrv *grpc.Server + grpcSrv *grpc.Server + extraGRPCHandlers []func(*grpc.Server) error } // New creates a new grpc server. @@ -49,13 +50,14 @@ func New[T transaction.Tx]( interfaceRegistry server.InterfaceRegistry, queryHandlers map[string]appmodulev2.Handler, queryable func(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error), - extraGRPCHandlers []func(*grpc.Server) error, cfg server.ConfigMap, - cfgOptions ...CfgOption, + opts ...OptionFunc[T], ) (*Server[T], error) { - srv := &Server[T]{ - cfgOptions: cfgOptions, + srv := &Server[T]{} + for _, opt := range opts { + opt(srv) } + serverCfg := srv.Config().(*Config) if len(cfg) > 0 { if err := serverv2.UnmarshalSubConfig(cfg, srv.Name(), &serverCfg); err != nil { @@ -81,7 +83,7 @@ func New[T transaction.Tx]( // register extra handlers on the grpc server var err error - for _, fn := range extraGRPCHandlers { + for _, fn := range srv.extraGRPCHandlers { err = errors.Join(err, fn(grpcSrv)) } if err != nil { @@ -95,6 +97,22 @@ func New[T transaction.Tx]( return srv, nil } +type OptionFunc[T transaction.Tx] func(*Server[T]) + +// WithCfgOptions allows to overwrite the default server configuration. +func WithCfgOptions[T transaction.Tx](cfgOptions ...CfgOption) OptionFunc[T] { + return func(srv *Server[T]) { + srv.cfgOptions = cfgOptions + } +} + +// WithExtraGRPCHandlers allows to register extra handlers on the grpc server. +func WithExtraGRPCHandlers[T transaction.Tx](handlers ...func(*grpc.Server) error) OptionFunc[T] { + return func(srv *Server[T]) { + srv.extraGRPCHandlers = handlers + } +} + // NewWithConfigOptions creates a new GRPC server with the provided config options. // It is *not* a fully functional server (since it has been created without dependencies) // The returned server should only be used to get and set configuration. diff --git a/server/v2/server_test.go b/server/v2/server_test.go index 883b98758a99..04531ec35226 100644 --- a/server/v2/server_test.go +++ b/server/v2/server_test.go @@ -53,7 +53,7 @@ func TestServer(t *testing.T) { logger := log.NewLogger(os.Stdout) ctx := serverv2.SetServerContext(context.Background(), v, logger) - grpcServer, err := grpc.New[transaction.Tx](logger, &mockInterfaceRegistry{}, map[string]appmodulev2.Handler{}, nil, nil, cfg) + grpcServer, err := grpc.New[transaction.Tx](logger, &mockInterfaceRegistry{}, map[string]appmodulev2.Handler{}, nil, cfg) require.NoError(t, err) storeServer, err := store.New[transaction.Tx](&mockStore{}, cfg) diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 95338cb2c2a2..382c5675155d 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -46,7 +46,6 @@ require ( cosmossdk.io/x/accounts/defaults/base v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/lockup v0.0.0-00010101000000-000000000000 cosmossdk.io/x/accounts/defaults/multisig v0.0.0-00010101000000-000000000000 - google.golang.org/grpc v1.68.0 ) require ( @@ -239,6 +238,7 @@ require ( google.golang.org/genproto v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/grpc v1.68.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/simapp/v2/simdv2/cmd/commands.go b/simapp/v2/simdv2/cmd/commands.go index 8f900333e989..64c91f85c12a 100644 --- a/simapp/v2/simdv2/cmd/commands.go +++ b/simapp/v2/simdv2/cmd/commands.go @@ -5,7 +5,6 @@ import ( "io" "github.com/spf13/cobra" - "google.golang.org/grpc" "cosmossdk.io/client/v2/offchain" coreserver "cosmossdk.io/core/server" @@ -128,13 +127,13 @@ func InitRootCmd[T transaction.Tx]( simApp.InterfaceRegistry(), simApp.QueryHandlers(), simApp.Query, - []func(*grpc.Server) error{ + deps.GlobalConfig, + grpcserver.WithExtraGRPCHandlers[T]( deps.ConsensusServer.Consensus.GRPCServiceRegistrar( deps.ClientContext, deps.GlobalConfig, ), - }, - deps.GlobalConfig, + ), ) if err != nil { return nil, err