Skip to content

Commit

Permalink
Merge branch 'release/v0.52.x' of github.com:cosmos/cosmos-sdk into k…
Browse files Browse the repository at this point in the history
…ocu/cdev
  • Loading branch information
kocubinski committed Jan 17, 2025
2 parents a82e11a + 536fe3f commit 9c5077f
Show file tree
Hide file tree
Showing 21 changed files with 342 additions and 194 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (x/auth/tx) [23144](https://github.com/cosmos/cosmos-sdk/pull/23144) Add missing CacheWithValue for ExtensionOptions.
* (x/auth/tx) [#23148](https://github.com/cosmos/cosmos-sdk/pull/23148) Avoid panic from intoAnyV2 when v1.PublicKey is optional.
* (server) [#23244](https://github.com/cosmos/cosmos-sdk/pull/23244) Allow align block header with skip check header in grpc server.
* (x/auth) [#23357](https://github.com/cosmos/cosmos-sdk/pull/23357) Fixes accessibility of the AddressStringToBytes HTTP binding and adds another binding to AddressBytesToString.

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion docs/build/building-apps/upgrades/0.52.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ plugins:

### Refactor Module Imports to cosmossdk.io/x/

All modules except auth have been split into their own go.mod and are imported via cosmossdk.io/x/<mod>.
All modules except auth have been split into their own go.mod and are imported via `cosmossdk.io/x/<mod>`.


* Replace import paths from github.com/cosmos/cosmos-sdk/x/{moduleName} to cosmossdk.io/x/{moduleName}.
Expand Down
4 changes: 2 additions & 2 deletions docs/build/building-modules/02-messages-and-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ https://github.com/cosmos/cosmos-sdk/blob/28fa3b8/x/bank/proto/cosmos/bank/v1bet

### `transaction.Msg` Interface

`transaction.Msg` is an alias of `proto.Message`.
`transaction.Msg` uses structural types to define the interface for a message.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/main/core/transaction/transaction.go#L8
https://github.com/cosmos/cosmos-sdk/blob/main/core/transaction/transaction.go#L4-L9
```

Signers from the `GetSigners()` call is automated via a protobuf annotation.
Expand Down
30 changes: 17 additions & 13 deletions proto/cosmos/auth/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,25 @@ service Query {
// AddressBytesToString converts Account Address bytes to string
rpc AddressBytesToString(AddressBytesToStringRequest) returns (AddressBytesToStringResponse) {
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.46";
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_bytes}";
}
option (google.api.http) = {
get: "/cosmos/auth/v1beta1/bech32/{address_bytes}";
additional_bindings:
[{get: "/cosmos/auth/v1beta1/bech32/decode/{address_bytes}"}]
};
}

// AddressStringToBytes converts Address string to bytes
rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) {
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.46";
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/{address_string}";
}
// AddressStringToBytes converts Address string to bytes
rpc AddressStringToBytes(AddressStringToBytesRequest) returns (AddressStringToBytesResponse) {
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.46";
option (google.api.http).get = "/cosmos/auth/v1beta1/bech32/encode/{address_string}";
}

// AccountInfo queries account info which is common to all account types.
rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) {
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.47";
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}";
}
// AccountInfo queries account info which is common to all account types.
rpc AccountInfo(QueryAccountInfoRequest) returns (QueryAccountInfoResponse) {
option (cosmos_proto.method_added_in) = "cosmos-sdk 0.47";
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/cosmos/auth/v1beta1/account_info/{address}";
}
}

// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
Expand Down
22 changes: 11 additions & 11 deletions server/v2/cometbft/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
abci "github.com/cometbft/cometbft/abci/types"
abciproto "github.com/cometbft/cometbft/api/cometbft/abci/v1"
v1 "github.com/cometbft/cometbft/api/cometbft/types/v1"
"github.com/cosmos/gogoproto/proto"
gogoproto "github.com/cosmos/gogoproto/proto"
gogotypes "github.com/cosmos/gogoproto/types"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -65,19 +64,19 @@ var (

func getQueryRouterBuilder[T any, PT interface {
*T
proto.Message
gogoproto.Message
},
U any, UT interface {
*U
proto.Message
gogoproto.Message
}](
t *testing.T,
handler func(ctx context.Context, msg PT) (UT, error),
) *stf.MsgRouterBuilder {
t.Helper()
queryRouterBuilder := stf.NewMsgRouterBuilder()
err := queryRouterBuilder.RegisterHandler(
proto.MessageName(PT(new(T))),
gogoproto.MessageName(PT(new(T))),
func(ctx context.Context, msg transaction.Msg) (msgResp transaction.Msg, err error) {
typedReq := msg.(PT)
typedResp, err := handler(ctx, typedReq)
Expand Down Expand Up @@ -107,7 +106,7 @@ func getMsgRouterBuilder[T any, PT interface {
t.Helper()
msgRouterBuilder := stf.NewMsgRouterBuilder()
err := msgRouterBuilder.RegisterHandler(
proto.MessageName(PT(new(T))),
gogoproto.MessageName(PT(new(T))),
func(ctx context.Context, msg transaction.Msg) (msgResp transaction.Msg, err error) {
typedReq := msg.(PT)
typedResp, err := handler(ctx, typedReq)
Expand Down Expand Up @@ -821,18 +820,19 @@ func setUpConsensus(t *testing.T, gasLimit uint64, mempool mempool.Mempool[mock.
return typedResp, nil
}

queryRouterBuilder.RegisterHandler(
proto.MessageName(&testdata.SayHelloRequest{}),
err := queryRouterBuilder.RegisterHandler(
gogoproto.MessageName(&testdata.SayHelloRequest{}),
helloFooHandler,
)
require.NoError(t, err)

queryHandler[proto.MessageName(&testdata.SayHelloRequest{})] = appmodulev2.Handler{
queryHandler[gogoproto.MessageName(&testdata.SayHelloRequest{})] = appmodulev2.Handler{
Func: helloFooHandler,
MakeMsg: func() transaction.Msg {
return reflect.New(gogoproto.MessageType(proto.MessageName(&testdata.SayHelloRequest{})).Elem()).Interface().(transaction.Msg)
return reflect.New(gogoproto.MessageType(gogoproto.MessageName(&testdata.SayHelloRequest{})).Elem()).Interface().(transaction.Msg)
},
MakeMsgResp: func() transaction.Msg {
return reflect.New(gogoproto.MessageType(proto.MessageName(&testdata.SayHelloResponse{})).Elem()).Interface().(transaction.Msg)
return reflect.New(gogoproto.MessageType(gogoproto.MessageName(&testdata.SayHelloResponse{})).Elem()).Interface().(transaction.Msg)
},
}

Expand Down Expand Up @@ -897,7 +897,7 @@ func setUpConsensus(t *testing.T, gasLimit uint64, mempool mempool.Mempool[mock.
TxCodec: mock.TxCodec{},
},
chainID: "test",
getProtoRegistry: sync.OnceValues(proto.MergedRegistry),
getProtoRegistry: sync.OnceValues(gogoproto.MergedRegistry),
queryHandlersMap: queryHandler,
addrPeerFilter: addrPeerFilter,
idPeerFilter: idPeerFilter,
Expand Down
8 changes: 4 additions & 4 deletions server/v2/cometbft/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.23.4
replace github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-rc.1

require (
cosmossdk.io/api v0.8.1 // main
cosmossdk.io/collections v1.0.0-rc.1 // main
cosmossdk.io/api v0.8.2
cosmossdk.io/collections v1.0.0
cosmossdk.io/core v1.0.0
cosmossdk.io/errors v1.0.1
cosmossdk.io/errors/v2 v2.0.0
Expand All @@ -30,8 +30,8 @@ require (
)

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1 // indirect
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.2-20241120201313-68e42a58b301.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.2-20240130113600-88ef6483f90f.1 // indirect
cosmossdk.io/core/testing v0.0.1 // indirect
cosmossdk.io/depinject v1.1.0 // indirect
cosmossdk.io/math v1.5.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions server/v2/cometbft/go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1 h1:ETkPUd9encx5SP6yuo0BR7DOnQHDbmU0RMzHsu2dkuQ=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1/go.mod h1:HulBNxlqJNXVcysFv/RxTEWz+khiJg8SOmfgC1ktVTM=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1 h1:X62BxjEhtx1/PWJPxg5BGahf1UXeFgM9dFfNpQ6kUPo=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1/go.mod h1:GB5hdNJd6cahKmHcLArJo5wnV9TeZGMSz7ysK4YLvag=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.2-20241120201313-68e42a58b301.1 h1:72N6FvGkvIAHJFuW6BFXCThbTS2qo/PlzQuw7wSjUi8=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.2-20241120201313-68e42a58b301.1/go.mod h1:UJ1nx2WHcWAvKiaem512kYlHektAZJ/eNU032Pdar70=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.2-20240130113600-88ef6483f90f.1 h1:LFgdGZ+BzNqHWsndyRvvFE1450BBZ2nFtyNEGZ9NOSg=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.2-20240130113600-88ef6483f90f.1/go.mod h1:cuOHNO5SRU1J25UoI8VvPyi8dq9BpZb4gKa01Umx57Y=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cosmossdk.io/api v0.8.1 h1:jQxx7CgUZDfgbPhPak41hW8TZzqfj06YxNI1WOulOo4=
cosmossdk.io/api v0.8.1/go.mod h1:8Q+Je1bFwsNTCMe6qigVDDyrNmFYa7ttvG96tN/oKGw=
cosmossdk.io/collections v1.0.0-rc.1 h1:Mzv0YKZJ6aloy4oSnMnyl8b6PtM2dTdDlzRR/079TyM=
cosmossdk.io/collections v1.0.0-rc.1/go.mod h1:nOgrEpyMFOWBy8QmSbq/T6Tgtm2IyOFvxDRWk+DI97k=
cosmossdk.io/api v0.8.2 h1:klzA1RODd9tTawJ2CbBd/34RV/cB9qtd9oJN6rcRqqg=
cosmossdk.io/api v0.8.2/go.mod h1:XJUwQrihIDjErzs3+jm1zO/9KRzKf4HMjRzXC+l+Cio=
cosmossdk.io/collections v1.0.0 h1:YCYIe/pIMtc1iLDD0OrVdfWCnIkpwdy7k9NSQpaR5mg=
cosmossdk.io/collections v1.0.0/go.mod h1:mFfLxnYT1fV+B3Lx9GLap1qxmffIPqQCND4xBExerps=
cosmossdk.io/core v1.0.0 h1:e7XBbISOytLBOXMVwpRPixThXqEkeLGlg8no/qpgS8U=
cosmossdk.io/core v1.0.0/go.mod h1:mKIp3RkoEmtqdEdFHxHwWAULRe+79gfdOvmArrLDbDc=
cosmossdk.io/core/testing v0.0.1 h1:gYCTaftcRrz+HoNXmK7r9KgbG1jgBJ8pNzm/Pa/erFQ=
Expand Down
3 changes: 1 addition & 2 deletions server/v2/cometbft/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
cryptoenc "github.com/cometbft/cometbft/crypto/encoding"
protoio "github.com/cosmos/gogoproto/io"
"github.com/cosmos/gogoproto/proto"
gogoproto "github.com/cosmos/gogoproto/proto"
gogoany "github.com/cosmos/gogoproto/types/any"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -516,7 +515,7 @@ func ValidateVoteExtensions[T transaction.Tx](
return nil
}

marshalDelimitedFn := func(msg proto.Message) ([]byte, error) {
marshalDelimitedFn := func(msg gogoproto.Message) ([]byte, error) {
var buf bytes.Buffer
if err := protoio.NewDelimitedWriter(&buf).WriteMsg(msg); err != nil {
return nil, err
Expand Down
18 changes: 9 additions & 9 deletions simapp/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/simapp
go 1.23.4

require (
cosmossdk.io/api v0.8.1 // main
cosmossdk.io/api v0.8.2 // main
cosmossdk.io/client/v2 v2.10.0-beta.1
cosmossdk.io/collections v1.0.0 // main
cosmossdk.io/core v1.0.0 // main
Expand Down Expand Up @@ -48,13 +48,13 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
google.golang.org/grpc v1.69.2
google.golang.org/grpc v1.69.4
google.golang.org/protobuf v1.36.2
)

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1 // indirect
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.2-20241120201313-68e42a58b301.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.2-20240130113600-88ef6483f90f.1 // indirect
cloud.google.com/go v0.115.0 // indirect
cloud.google.com/go/auth v0.5.1 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect
Expand Down Expand Up @@ -216,21 +216,21 @@ require (
go.opentelemetry.io/otel/trace v1.31.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/arch v0.12.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/term v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.27.0 // indirect
google.golang.org/api v0.185.0 // indirect
google.golang.org/genproto v0.0.0-20240617180043-68d350f18fd4 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
Expand Down
Loading

0 comments on commit 9c5077f

Please sign in to comment.