Skip to content

Commit

Permalink
chore: upgrade to cosmos-sdk v0.46.16 (#357)
Browse files Browse the repository at this point in the history
* refactor: add MigrateHandler to allow reuse migrate genesis related function  (backport cosmos#17296) (cosmos#17301)

Co-authored-by: mmsqe <[email protected]>
Co-authored-by: Julien Robert <[email protected]>

* fix: resolve migration map in MigrateHandler (cosmos#17301) (cosmos#17302)

* feat(x/gov): Emit VoterAddr (backport cosmos#17354) (cosmos#17357)

Co-authored-by: Devon Bear <[email protected]>
Co-authored-by: Julien Robert <[email protected]>

* feat(x/gov): add MsgSubmitProposal SetMsgs method (backport cosmos#17387) (cosmos#17388)

Co-authored-by: Julien Robert <[email protected]>

* fix: use correct config key for db_backend (backport cosmos#17406) (cosmos#17412)

Co-authored-by: Julien Robert <[email protected]>

* chore: prepare v0.46.15 (cosmos#17408)

* fix(x/authz): GetAuthorizations (backport cosmos#17334) (cosmos#17527)

Co-authored-by: devon <[email protected]>
Co-authored-by: Julien Robert <[email protected]>

* docs: update x/group create-proposal to submit-proposal (backport cosmos#17544) (cosmos#17549)

Co-authored-by: Félix C. Morency <[email protected]>

* fix: typo in comment (backport cosmos#17635) (cosmos#17638)

Co-authored-by: Bryan White <[email protected]>
Co-authored-by: Marko <[email protected]>

* build(deps): bump cosmos/ledger-cosmos-go to v0.12.3 in v0.46 (backport cosmos#18105) (cosmos#18112)

Co-authored-by: Julien Robert <[email protected]>

* chore: prepare release notes v0.46.16 (cosmos#18118)

* fix(server): don't hardcode grpc address to localhost (backport cosmos#18254) (cosmos#18260)

Co-authored-by: Julien Robert <[email protected]>

* chore: update tag date v0.46.16 (cosmos#18385)

* revert: Go 1.19

* revert: c226e8b

* chore(deps): upgrade to v1.29.0-tm-v0.34.29

* chore: downgrade to grpc 1.54.0

to match the versions used in upstream

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: mmsqe <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
Co-authored-by: Devon Bear <[email protected]>
Co-authored-by: devon <[email protected]>
Co-authored-by: Félix C. Morency <[email protected]>
Co-authored-by: Bryan White <[email protected]>
Co-authored-by: Marko <[email protected]>
  • Loading branch information
9 people authored Nov 14, 2023
1 parent 76bcf5a commit e04d485
Show file tree
Hide file tree
Showing 13 changed files with 114 additions and 148 deletions.
30 changes: 21 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [Unreleased]
## [v0.46.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.16) - 2023-11-07

EOL notice. This is the last release of the `v0.46.x` line. Per this version, the v0.46.x line reached its end-of-life.

### Bug Fixes

* (server) [#18254](https://github.com/cosmos/cosmos-sdk/pull/18254) Don't hardcode gRPC address to localhost.

## [v0.46.15](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.14) - 2023-08-21

### Improvements

Expand All @@ -44,6 +52,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/genutil) [#17296](https://github.com/cosmos/cosmos-sdk/pull/17296) Add `MigrateHandler` to allow reuse migrate genesis related function.
* In v0.46, v0.47 this function is additive to the `genesis migrate` command. However in v0.50+, adding custom migrations to the `genesis migrate` command is directly possible.

### Bug Fixes

* (server) [#17181](https://github.com/cosmos/cosmos-sdk/pull/17181) Fix `db_backend` lookup fallback from `config.toml`.

## [v0.46.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.14) - 2023-07-17

### Features
Expand All @@ -64,7 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [v0.46.13](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.13) - 2023-06-08

### Features
### Features

* (snapshots) [#16060](https://github.com/cosmos/cosmos-sdk/pull/16060) Support saving and restoring snapshot locally.
* (baseapp) [#16290](https://github.com/cosmos/cosmos-sdk/pull/16290) Add circuit breaker setter in baseapp.
Expand Down Expand Up @@ -128,12 +140,12 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (deps) [#14846](https://github.com/cosmos/cosmos-sdk/pull/14846) Bump btcd.
* (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26).
* (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface.
* A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker
* A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker

```toml
# IAVLLazyLoading enable/disable the lazy loading of iavl store.
# Default is false.
iavl-lazy-loading = ""
iavl-lazy-loading = ""
```

### Bug Fixes
Expand Down Expand Up @@ -169,7 +181,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24).
* [#13651](https://github.com/cosmos/cosmos-sdk/pull/13651) Update `server/config/config.GetConfig` function.
* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go.
* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go.

### State Machine Breaking

Expand Down Expand Up @@ -259,7 +271,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

ATTENTION:

This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).
This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).

All users should upgrade immediately.

Expand Down Expand Up @@ -318,7 +330,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8
* (x/auth) [#13048](https://github.com/cosmos/cosmos-sdk/pull/13048) Add handling of AccountNumberStoreKeyPrefix to the simulation decoder.
* (simapp) [#13108](https://github.com/cosmos/cosmos-sdk/pull/13108) Call `SetIAVLCacheSize` with the configured value in simapp.
* [#13318](https://github.com/cosmos/cosmos-sdk/pull/13318) Keep the balance query endpoint compatible with legacy blocks.
* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage.
* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage.

### Bug Fixes

Expand Down Expand Up @@ -616,7 +628,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8
* (x/mint) [#12384](https://github.com/cosmos/cosmos-sdk/pull/12384) Ensure `GoalBonded` must be positive when performing `x/mint` parameter validation.
* (x/auth) [#12261](https://github.com/cosmos/cosmos-sdk/pull/12261) Deprecate pagination in GetTxsEventRequest/Response in favor of page and limit to align with tendermint `SignClient.TxSearch`
* (vesting) [#12190](https://github.com/cosmos/cosmos-sdk/pull/12190) Replace https://github.com/cosmos/cosmos-sdk/pull/12190 to use `NewBaseAccountWithAddress` in all vesting account message handlers.
* (linting) [#12135](https://github.com/cosmos/cosmos-sdk/pull/12135/) Fix variable naming issues per enabled linters. Run gofumpt to ensure easy reviews of ongoing linting work.
* (linting) [#12135](https://github.com/cosmos/cosmos-sdk/pull/12135/) Fix variable naming issues per enabled linters. Run gofumpt to ensure easy reviews of ongoing linting work.
* (linting) [#12132](https://github.com/cosmos/cosmos-sdk/pull/12132) Change sdk.Int to math.Int, run `gofumpt -w -l .`, and `golangci-lint run ./... --fix`
* (cli) [#12127](https://github.com/cosmos/cosmos-sdk/pull/12127) Fix the CLI not always taking into account `--fee-payer` and `--fee-granter` flags.
* (migrations) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Fix v0.45->v0.46 in-place store migrations.
Expand Down Expand Up @@ -651,7 +663,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8
* (x/feegrant) [\#10830](https://github.com/cosmos/cosmos-sdk/pull/10830) Expired allowances will be pruned from state.
* (x/authz,x/feegrant) [\#11214](https://github.com/cosmos/cosmos-sdk/pull/11214) Fix Amino JSON encoding of authz and feegrant Msgs to be consistent with other modules.
* (authz)[\#11060](https://github.com/cosmos/cosmos-sdk/pull/11060) Support grant with no expire time.
* (x/gov) [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) Bump gov to v1.
* (x/gov) [\#10868](https://github.com/cosmos/cosmos-sdk/pull/10868) Bump gov to v1.

### Deprecated

Expand Down
15 changes: 11 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cosmos SDK v0.46.14 Release Notes
# Cosmos SDK v0.46.16 Release Notes

This patch release introduces a few bug fixes and improvements to the v0.46.x line of the Cosmos SDK. Notably, an improvement to `<appd> prune` UX and improving the error handling when there is a snapshot creation failure.
This patch release introduces one dependency bump in the v0.46.x line of the Cosmos SDK.

Ensure you have the following replaces in the `go.mod` of your application:

Expand All @@ -11,6 +11,13 @@ replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.2
replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
```

Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes.
Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/v0.46.16/CHANGELOG.md) for an exhaustive list of changes.

**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.13...v0.46.14
**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.15...v0.46.16

## End-of-Life Notice

`v0.46.16` is the last release of the `v0.46.x` line. Per this version, the v0.46.x line reached its end-of-life.
The SDK team maintains the [latest two major versions of the SDK](https://github.com/cosmos/cosmos-sdk/blob/main/RELEASE_PROCESS.md#major-release-maintenance). This means no features, improvements or bug fixes will be backported to the `v0.46.x` line. Per our policy, the `v0.46.x` line will receive security patches only.

We encourage all chains to upgrade to Cosmos SDK Eden (`v0.50.0`), or the `v0.47.x` line.
2 changes: 1 addition & 1 deletion client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func ReadFromClientConfig(ctx client.Context) (client.Context, error) {
configFilePath := filepath.Join(configPath, "client.toml")
conf := defaultClientConfig()

// if config.toml file does not exist we create it and write default ClientConfig values into it.
// when client.toml does not exist create and init with default values
if _, err := os.Stat(configFilePath); os.IsNotExist(err) {
if err := ensureConfigPath(configPath); err != nil {
return ctx, fmt.Errorf("couldn't make client config: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion crypto/keyring/keyring.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ func SignWithLedger(k *Record, msg []byte) (sig []byte, pub types.PubKey, err er
return
}

sig, err = priv.SignLedgerAminoJSON(msg)
sig, err = priv.Sign(msg)
if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/ledger/ledger_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3
return pk, addr, err
}

func (mock LedgerSECP256K1Mock) SignSECP256K1(derivationPath []uint32, message []byte, p2 byte) ([]byte, error) {
func (mock LedgerSECP256K1Mock) SignSECP256K1(derivationPath []uint32, message []byte) ([]byte, error) {
path := hd.NewParams(derivationPath[0], derivationPath[1], derivationPath[2], derivationPath[3] != 0, derivationPath[4])
seed, err := bip39.NewSeedWithErrorChecking(testdata.TestMnemonic, "")
if err != nil {
Expand Down
30 changes: 6 additions & 24 deletions crypto/ledger/ledger_secp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ type (
// Returns a compressed pubkey and bech32 address (requires user confirmation)
GetAddressPubKeySECP256K1([]uint32, string) ([]byte, string, error)
// Signs a message (requires user confirmation)
// The last byte denotes the SIGN_MODE to be used by Ledger: 0 for
// LEGACY_AMINO_JSON, 1 for TEXTUAL. It corresponds to the P2 value
// in https://github.com/cosmos/ledger-cosmos/blob/main/docs/APDUSPEC.md
SignSECP256K1([]uint32, []byte, byte) ([]byte, error)
SignSECP256K1([]uint32, []byte) ([]byte, error)
}

// PrivKeyLedgerSecp256k1 implements PrivKey, calling the ledger nano we
Expand All @@ -54,7 +51,7 @@ type (
// This function is marked as unsafe as it will retrieve a pubkey without user verification.
// It can only be used to verify a pubkey but never to create new accounts/keys. In that case,
// please refer to NewPrivKeySecp256k1
func NewPrivKeySecp256k1Unsafe(path hd.BIP44Params) (types.LedgerPrivKeyAminoJSON, error) {
func NewPrivKeySecp256k1Unsafe(path hd.BIP44Params) (types.LedgerPrivKey, error) {
device, err := getDevice()
if err != nil {
return nil, err
Expand Down Expand Up @@ -91,28 +88,15 @@ func (pkl PrivKeyLedgerSecp256k1) PubKey() types.PubKey {
return pkl.CachedPubKey
}

// Sign returns a secp256k1 signature for the corresponding message using
// SIGN_MODE_TEXTUAL.
// Sign returns a secp256k1 signature for the corresponding message
func (pkl PrivKeyLedgerSecp256k1) Sign(message []byte) ([]byte, error) {
device, err := getDevice()
if err != nil {
return nil, err
}
defer warnIfErrors(device.Close)

return sign(device, pkl, message, 1)
}

// SignLedgerAminoJSON returns a secp256k1 signature for the corresponding message using
// SIGN_MODE_LEGACY_AMINO_JSON.
func (pkl PrivKeyLedgerSecp256k1) SignLedgerAminoJSON(message []byte) ([]byte, error) {
device, err := getDevice()
if err != nil {
return nil, err
}
defer warnIfErrors(device.Close)

return sign(device, pkl, message, 0)
return sign(device, pkl, message)
}

// ShowAddress triggers a ledger device to show the corresponding address.
Expand Down Expand Up @@ -244,15 +228,13 @@ func validateKey(device SECP256K1, pkl PrivKeyLedgerSecp256k1) error {
// Communication is checked on NewPrivKeyLedger and PrivKeyFromBytes, returning
// an error, so this should only trigger if the private key is held in memory
// for a while before use.
//
// Last byte P2 is 0 for LEGACY_AMINO_JSON, and 1 for TEXTUAL.
func sign(device SECP256K1, pkl PrivKeyLedgerSecp256k1, msg []byte, p2 byte) ([]byte, error) {
func sign(device SECP256K1, pkl PrivKeyLedgerSecp256k1, msg []byte) ([]byte, error) {
err := validateKey(device, pkl)
if err != nil {
return nil, err
}

sig, err := device.SignSECP256K1(pkl.Path.DerivationPath(), msg, p2)
sig, err := device.SignSECP256K1(pkl.Path.DerivationPath(), msg)
if err != nil {
return nil, err
}
Expand Down
11 changes: 0 additions & 11 deletions crypto/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ type LedgerPrivKey interface {
Type() string
}

// LedgerPrivKeyAminoJSON is a Ledger PrivKey type that supports signing with
// SIGN_MODE_LEGACY_AMINO_JSON. It is added as a non-breaking change, instead of directly
// on the LedgerPrivKey interface (whose Sign method will sign with TEXTUAL),
// and will be deprecated/removed once LEGACY_AMINO_JSON is removed.
type LedgerPrivKeyAminoJSON interface {
LedgerPrivKey
// SignLedgerAminoJSON signs a messages on the Ledger device using
// SIGN_MODE_LEGACY_AMINO_JSON.
SignLedgerAminoJSON(msg []byte) ([]byte, error)
}

// PrivKey defines a private key and extends proto.Message. For now, it extends
// LedgerPrivKey (see godoc for LedgerPrivKey). Ultimately, we should remove
// LedgerPrivKey and add its methods here directly.
Expand Down
42 changes: 19 additions & 23 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/iavl v0.19.6
github.com/cosmos/ledger-cosmos-go v0.13.2
github.com/cosmos/ledger-cosmos-go v0.12.4
github.com/gogo/gateway v1.1.0
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.6.0
Expand Down Expand Up @@ -51,29 +51,29 @@ require (
github.com/tendermint/tendermint v0.34.28
github.com/tendermint/tm-db v0.6.7
github.com/tidwall/btree v1.5.0
golang.org/x/crypto v0.14.0
golang.org/x/crypto v0.7.0
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0
google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13
google.golang.org/grpc v1.58.3
google.golang.org/protobuf v1.31.0
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
google.golang.org/grpc v1.54.0
google.golang.org/protobuf v1.30.0
pgregory.net/rapid v0.4.7
sigs.k8s.io/yaml v1.3.0
)

require (
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/storage v1.28.1 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/aws/aws-sdk-go v1.40.45 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/celestiaorg/nmt v0.19.0 // indirect
github.com/celestiaorg/nmt v0.20.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down Expand Up @@ -104,9 +104,8 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.4 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
Expand Down Expand Up @@ -160,17 +159,14 @@ require (
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.15.1 // indirect
go.opentelemetry.io/otel/sdk v1.15.1 // indirect
go.opentelemetry.io/otel/trace v1.15.1 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.7.0 // indirect
golang.org/x/term v0.7.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.128.0 // indirect
google.golang.org/api v0.110.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand All @@ -191,7 +187,7 @@ replace (
// replace broken goleveldb.
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
// use cometbft
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.26.2-tm-v0.34.28
github.com/tendermint/tendermint => github.com/celestiaorg/celestia-core v1.29.0-tm-v0.34.29
)

retract (
Expand Down
Loading

0 comments on commit e04d485

Please sign in to comment.