Skip to content

Commit

Permalink
Merge branch 'main' into fix/race
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 authored Jan 2, 2025
2 parents b785413 + d39d0bc commit a054374
Show file tree
Hide file tree
Showing 48 changed files with 316 additions and 1,969 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ v without deliberation
* [ ] Audit x/bank/v2
* [ ] Audit x/circuit
* [ ] Audit x/consensus
* [ ] Audit x/crisis
* [ ] Audit x/distribution
* [ ] Audit x/evidence
* [ ] Audit x/epochs
Expand Down
2 changes: 0 additions & 2 deletions .github/pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
- x/circuit/**/*
"C:x/consensus":
- x/consensus/**/*
"C:x/crisis":
- x/crisis/**/*
"C:x/distribution":
- x/distribution/**/*
"C:x/evidence":
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/pr-reminder.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.22"
check-latest: false
cache: true
cache-dependency-path: depinject/go.sum
Expand Down Expand Up @@ -312,7 +312,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: errors/go.sum
Expand Down Expand Up @@ -343,7 +343,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: math/go.sum
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Bug Fixes


* (baseapp) [#22692](https://github.com/cosmos/cosmos-sdk/pull/22692) Add mutex locks for `state` and make `lastCommitInfo` atomic to prevent race conditions between `Commit` and `CreateQueryContext`.
* (query) [23002](https://github.com/cosmos/cosmos-sdk/pull/23002) Fix collection filtered pagination.


### API Breaking Changes

Expand Down
6 changes: 3 additions & 3 deletions client/grpc/reflection/reflection.pb.go

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

2 changes: 1 addition & 1 deletion client/v2/internal/testpb/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ service Msg {
}

message MsgRequest {
// u32 is an uint32
// u32 is a uint32
uint32 u32 = 1;
uint64 u64 = 2;
string str = 3;
Expand Down
4 changes: 2 additions & 2 deletions client/v2/tx/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@ func txParamsFromFlagSet(flags *pflag.FlagSet, keybase keyring2.Keyring, ac addr

fees, _ := flags.GetString(FlagFees)
feePayer, _ := flags.GetString(FlagFeePayer)
feeGrater, _ := flags.GetString(FlagFeeGranter)
feeGranter, _ := flags.GetString(FlagFeeGranter)

unordered, _ := flags.GetBool(FlagUnordered)

gasConfig, err := NewGasConfig(gasValue, gasAdjustment, gasPrices)
if err != nil {
return params, err
}
feeConfig, err := NewFeeConfig(fees, feePayer, feeGrater)
feeConfig, err := NewFeeConfig(fees, feePayer, feeGranter)
if err != nil {
return params, err
}
Expand Down
2 changes: 1 addition & 1 deletion collections/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ type BaseAccount struct {
```

First of all, when we save our accounts in state we map them using a primary key `sdk.AccAddress`.
If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddres, authtypes.BaseAccount]`.
If it were to be a `collections.Map` it would be `collections.Map[sdk.AccAddress, authtypes.BaseAccount]`.

Then we also want to be able to get an account not only by its `sdk.AccAddress`, but also by its `AccountNumber`.

Expand Down
2 changes: 1 addition & 1 deletion core/server/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Server Defines types and interfaces which are shared between Consensus, Appmanager and Stf
// Server Defines types and interfaces which are shared between Consensus, App Manager and Stf
// This package is not meant to be used directly by modules instead if an advanced user would like
// to create a custom server or replace a component in the server they will need to use the app package.
package server
2 changes: 1 addition & 1 deletion crypto/keyring/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// Language is a language to create the BIP 39 mnemonic in.
// Currently, only english is supported though.
// Currently, only English is supported though.
// Find a list of all supported languages in the BIP 39 spec (word lists).
type Language int

Expand Down
2 changes: 1 addition & 1 deletion depinject/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/depinject

go 1.21
go 1.22

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5
Expand Down
2 changes: 1 addition & 1 deletion errors/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module cosmossdk.io/errors/v2

// NOTE: this go.mod should have zero dependencies.

go 1.20
go 1.22
3 changes: 0 additions & 3 deletions log/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func BenchmarkLoggers(b *testing.B) {
// so that real write time is negligible.
b.Run("zerolog", func(b *testing.B) {
for _, bc := range benchCases {
bc := bc
b.Run(bc.name, func(b *testing.B) {
zl := zerolog.New(io.Discard)
logger := log.NewCustomLogger(zl)
Expand All @@ -99,7 +98,6 @@ func BenchmarkLoggers(b *testing.B) {
// also useful as a reference for how expensive zerolog is.
b.Run("specialized nop logger", func(b *testing.B) {
for _, bc := range nopCases {
bc := bc
b.Run(bc.name, func(b *testing.B) {
logger := log.NewNopLogger()

Expand All @@ -115,7 +113,6 @@ func BenchmarkLoggers(b *testing.B) {
// so we offer the specialized version in the exported API.
b.Run("zerolog nop logger", func(b *testing.B) {
for _, bc := range nopCases {
bc := bc
b.Run(bc.name, func(b *testing.B) {
logger := log.NewCustomLogger(zerolog.Nop())

Expand Down
2 changes: 1 addition & 1 deletion log/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/log

go 1.21
go 1.22

require (
github.com/bytedance/sonic v1.12.6
Expand Down
2 changes: 1 addition & 1 deletion math/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/math

go 1.20
go 1.22

require (
github.com/cockroachdb/apd/v3 v3.2.1
Expand Down
4 changes: 4 additions & 0 deletions math/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand All @@ -29,6 +31,7 @@ golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5 h1:SbSDUWW1PAO24TNpLdeheoYPd7kllICcLU52x6eD4kQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240709173604-40e1e62336c5/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY=
google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA=
Expand All @@ -37,6 +40,7 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw=
Expand Down
1 change: 0 additions & 1 deletion math/legacy_dec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ func TestFormatDecNonDigits(t *testing.T) {
}

for _, value := range badCases {
value := value
t.Run(value, func(t *testing.T) {
s, err := math.FormatDec(value)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion runtime/v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (m *MM[T]) TxValidators() func(ctx context.Context, tx T) error {
// As an app developer, if you wish to skip running InitGenesis for your new
// module "foo", you need to manually pass a `fromVM` argument to this function
// foo's module version set to its latest ConsensusVersion. That way, the diff
// between the function's `fromVM` and `udpatedVM` will be empty, hence not
// between the function's `fromVM` and `updatedVM` will be empty, hence not
// running anything for foo.
//
// Example:
Expand Down
4 changes: 2 additions & 2 deletions scripts/build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ MOCKS_DIR = $(CURDIR)/tests/mocks
HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git
DOCKER := $(shell which docker)
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
COSMOS_BUILD_OPTIONS := v2
COSMOS_BUILD_OPTIONS += ' v2'

rocksdb_version=v9.6.1
rocksdb_version=v9.7.3

ifeq ($(findstring .,$(VERSION)),)
VERSION := 0.0.0
Expand Down
10 changes: 9 additions & 1 deletion server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,20 @@ func (c *consensus[T]) maybeHandleExternalServices(ctx context.Context, req *abc
if strings.HasPrefix(req.Path, "/cosmos.tx.v1beta1.Service") {
rpcClient, _ := client.NewClientFromNode(c.cfg.AppTomlConfig.Address)

txConfig := authtx.NewTxConfig(
c.appCodecs.AppCodec,
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().AddressCodec(),
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().ValidatorAddressCodec(),
authtx.DefaultSignModes,
)

// init simple client context
clientCtx := client.Context{}.
WithLegacyAmino(c.appCodecs.LegacyAmino.(*codec.LegacyAmino)).
WithCodec(c.appCodecs.AppCodec).
WithNodeURI(c.cfg.AppTomlConfig.Address).
WithClient(rpcClient)
WithClient(rpcClient).
WithTxConfig(txConfig)

txService := txServer[T]{
clientCtx: clientCtx,
Expand Down
2 changes: 1 addition & 1 deletion server/v2/stf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ type (
)
```

THe wrappGasMeter is used in order to consume gas. Application developers can seamlsessly replace the gas meter with their own implementation in order to customize consumption of gas.
THe wrapGasMeter is used in order to consume gas. Application developers can seamlsessly replace the gas meter with their own implementation in order to customize consumption of gas.
2 changes: 1 addition & 1 deletion store/snapshots/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const (
snapshotMaxItemSize = int(64e6) // SDK has no key/value size limit, so we set an arbitrary limit
)

var ErrOptsZeroSnapshotInterval = errors.New("snaphot-interval must not be 0")
var ErrOptsZeroSnapshotInterval = errors.New("snapshot-interval must not be 0")

// NewManager creates a new manager.
func NewManager(store *Store, opts types.SnapshotOptions, multistore types.Snapshotter, extensions map[string]types.ExtensionSnapshotter, logger storetypes.Logger) *Manager {
Expand Down
Loading

0 comments on commit a054374

Please sign in to comment.