Skip to content

Commit

Permalink
Merge pull request from GHSA-3qp7-gj37-g9rx
Browse files Browse the repository at this point in the history
Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com>
Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
Co-authored-by: emidev98 <49301655+emidev98@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Marko Baricevic <markobaricevic3778@gmail.com>

Co-authored-by: likhita-809 <78951027+likhita-809@users.noreply.github.com>
Co-authored-by: Sai Kumar <17549398+gsk967@users.noreply.github.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
Co-authored-by: emidev98 <49301655+emidev98@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Marko Baricevic <markobaricevic3778@gmail.com>
  • Loading branch information
8 people committed Oct 20, 2022
1 parent 8667eba commit facd40d
Show file tree
Hide file tree
Showing 51 changed files with 6,606 additions and 633 deletions.
61 changes: 41 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,38 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v0.46.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.3) - 2022-10-16

ATTENTION:

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.

Users *must* add a replace directive in their go.mod for the new `ics23` package in the SDK:

```go
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v8.0.0

This comment has been minimized.

Copy link
@joe-bowman

joe-bowman Oct 28, 2022

Contributor

This should be v0.8.0, no?

This comment has been minimized.

Copy link
@julienrbrt

julienrbrt Oct 28, 2022

Author Member

Correct. This is fixed in the branch already, but not on main. Good catch.

```

### Features

* [#13435](https://github.com/cosmos/cosmos-sdk/pull/13435) Extend error context when a simulation fails.
* (grpc) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) Implement a new gRPC query, `/cosmos/base/node/v1beta1/config`, which provides operator configuration.
* (cli) [#13147](https://github.com/cosmos/cosmos-sdk/pull/13147) Add the `--append` flag to the `sign-batch` CLI cmd to combine the messages and sign those txs which are created with `--generate-only`.
* (cli) [#13454](https://github.com/cosmos/cosmos-sdk/pull/13454) `sign-batch` CLI can now read multiple transaction files.

### Improvements

* (auth) [#13460](https://github.com/cosmos/cosmos-sdk/pull/13460) The `q auth address-by-id` CLI command has been renamed to `q auth address-by-acc-num` to be more explicit. However, the old `address-by-id` version is still kept as an alias, for backwards compatibility.
* [#13433](https://github.com/cosmos/cosmos-sdk/pull/13433) Remove dead code in cacheMergeIterator `Domain()`.

### Bug Fixes

* Implement dragonberry security patch.
* For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md)
* (store) [#13459](https://github.com/cosmos/cosmos-sdk/pull/13459) Don't let state listener observe the uncommitted writes.
* [#12548](https://github.com/cosmos/cosmos-sdk/pull/12548) Prevent signing from wrong key while using multisig.

### API Breaking Changes

Expand Down Expand Up @@ -162,7 +183,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (rosetta) [\#11590](https://github.com/cosmos/cosmos-sdk/pull/11590) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test.
* (types) [\#11959](https://github.com/cosmos/cosmos-sdk/pull/11959) Added `sdk.Coins.Find` helper method to find a coin by denom.
* (upgrade) [#12603](https://github.com/cosmos/cosmos-sdk/pull/12603) feat: Move AppModule.BeginBlock and AppModule.EndBlock to extension interfaces
* (telemetry) [#12405](https://github.com/cosmos/cosmos-sdk/pull/12405) Add _query_ calls metric to telemetry.
* (telemetry) [#12405](https://github.com/cosmos/cosmos-sdk/pull/12405) Add *query* calls metric to telemetry.
* (cli) [#12028](https://github.com/cosmos/cosmos-sdk/pull/12028) Add the `tendermint key-migrate` to perform Tendermint v0.35 DB key migration.
* (query) [#12253](https://github.com/cosmos/cosmos-sdk/pull/12253) Add `GenericFilteredPaginate` to the `query` package to improve UX.

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

### State Machine Breaking

* (baseapp) [\#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) Add a `postHandler` to baseapp. This `postHandler` is like antehandler, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`
* (baseapp) [\#11985](https://github.com/cosmos/cosmos-sdk/pull/11985) Add a `postHandler` to baseapp. This `postHandler` is like antehandler, but is run *after* the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`
* (x/gov) [#11998](https://github.com/cosmos/cosmos-sdk/pull/11998) Tweak the `x/gov` `ModuleAccountInvariant` invariant to ensure deposits are `<=` total module account balance instead of strictly equal.
* (x/upgrade) [\#11800](https://github.com/cosmos/cosmos-sdk/pull/11800) Fix `GetLastCompleteUpgrade` to properly return the latest upgrade.
* [\#10564](https://github.com/cosmos/cosmos-sdk/pull/10564) Fix bug when updating allowance inside AllowedMsgAllowance
Expand Down Expand Up @@ -654,7 +675,7 @@ empty coins slice before it is used to create `banktype.MsgSend`.

### Improvements

* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution.
* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures *all* events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution.
* (x/upgrade) [\#10532](https://github.com/cosmos/cosmos-sdk/pull/10532) Add `keeper.DumpUpgradeInfoWithInfoToDisk` to include `Plan.Info` in the upgrade-info file.
* (store) [\#10544](https://github.com/cosmos/cosmos-sdk/pull/10544) Use the new IAVL iterator structure which significantly improves iterator performance.

Expand Down Expand Up @@ -1736,7 +1757,7 @@ by the new key store:
* `file`: use encrypted file-based store.
* `kwallet`: use [KDE Wallet](https://utils.kde.org/projects/kwalletmanager/) service.
* `pass`: use the [pass](https://www.passwordstore.org/) command line password manager.
* `test`: use password-less key store. _For testing purposes only. Use it at your own risk._
* `test`: use password-less key store. *For testing purposes only. Use it at your own risk.*
* (keys) [\#5097](https://github.com/cosmos/cosmos-sdk/pull/5097) New `keys migrate` command to assist users migrate their keys
to the new keyring.
* (keys) [\#5366](https://github.com/cosmos/cosmos-sdk/pull/5366) `keys list` now accepts a `--list-names` option to list key names only, whilst the `keys delete`
Expand Down Expand Up @@ -3243,7 +3264,7 @@ BUG FIXES

## 0.25.0

_October 24th, 2018_.
*October 24th, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3491,7 +3512,7 @@ BUG FIXES

## 0.24.2

_August 22nd, 2018_.
*August 22nd, 2018*.

BUG FIXES

Expand All @@ -3500,7 +3521,7 @@ BUG FIXES

## 0.24.1

_August 21st, 2018_.
*August 21st, 2018*.

BUG FIXES

Expand All @@ -3509,7 +3530,7 @@ BUG FIXES

## 0.24.0

_August 13th, 2018_.
*August 13th, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3625,7 +3646,7 @@ BUG FIXES

## 0.23.1

_July 27th, 2018_.
*July 27th, 2018*.

BUG FIXES

Expand All @@ -3635,7 +3656,7 @@ BUG FIXES

## 0.23.0

_July 25th, 2018_.
*July 25th, 2018*.

BREAKING CHANGES

Expand All @@ -3658,7 +3679,7 @@ BUG FIXES

## 0.22.0

_July 16th, 2018_.
*July 16th, 2018*.

BREAKING CHANGES

Expand All @@ -3677,7 +3698,7 @@ BUG FIXES

## 0.21.1

_July 14th, 2018_.
*July 14th, 2018*.

BUG FIXES

Expand All @@ -3686,7 +3707,7 @@ BUG FIXES

## 0.21.0

_July 13th, 2018_.
*July 13th, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3717,7 +3738,7 @@ BUG FIXES

## 0.20.0

_July 10th, 2018_.
*July 10th, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3861,7 +3882,7 @@ BUG FIXES

## 0.19.0

_June 13, 2018_.
*June 13, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3901,7 +3922,7 @@ FEATURES

## 0.18.0

_June 9, 2018_.
*June 9, 2018*.

BREAKING CHANGES

Expand Down Expand Up @@ -3968,26 +3989,26 @@ BUG FIXES

## 0.17.5

_June 5, 2018_.
*June 5, 2018*.

Update to Tendermint v0.19.9 (Fix evidence reactor, mempool deadlock, WAL panic,
memory leak)

## 0.17.4

_May 31, 2018_.
*May 31, 2018*.

Update to Tendermint v0.19.7 (WAL fixes and more)

## 0.17.3

_May 29, 2018_.
*May 29, 2018*.

Update to Tendermint v0.19.6 (fix fast-sync halt)

## 0.17.2

_May 20, 2018_.
*May 20, 2018*.

Update to Tendermint v0.19.5 (reduce WAL use, bound the mempool and some rpcs, improve logging)

Expand Down
20 changes: 16 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Cosmos SDK v0.46.2 Release Notes
# Cosmos SDK v0.46.3 Release Notes

This release introduces a number of bug fixes, features and improvements.
This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).
Please upgrade ASAP.

Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes.
Next to this, we have also included a few minor bugfixes.

**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.1...v0.46.2
Chains must add the following to their go.mod for the application:

```go
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v8.0.0
```

Bumping the SDK version should be smooth, however, feel free to tag core devs to review your upgrading PR:

* **CET**: @tac0turtle, @okwme, @AdityaSripal, @colin-axner, @julienrbrt
* **EST**: @ebuchman, @alexanderbez, @aaronc
* **PST**: @jtremback, @nicolaslara, @czarcas7ic, @p0mvn
* **CDT**: @ValarDragon, @zmanian
64 changes: 17 additions & 47 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package baseapp

import (
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"os"
Expand Down Expand Up @@ -130,24 +131,6 @@ func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo {
}
}

// FilterPeerByAddrPort filters peers by address/port.
func (app *BaseApp) FilterPeerByAddrPort(info string) abci.ResponseQuery {
if app.addrPeerFilter != nil {
return app.addrPeerFilter(info)
}

return abci.ResponseQuery{}
}

// FilterPeerByID filters peers by node ID.
func (app *BaseApp) FilterPeerByID(info string) abci.ResponseQuery {
if app.idPeerFilter != nil {
return app.idPeerFilter(info)
}

return abci.ResponseQuery{}
}

// BeginBlock implements the ABCI application interface.
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
if app.cms.TracingEnabled() {
Expand Down Expand Up @@ -760,6 +743,22 @@ func handleQueryApp(app *BaseApp, path []string, req abci.RequestQuery) abci.Res
Value: []byte(app.version),
}

case "snapshots":
var responseValue []byte

response := app.ListSnapshots(abci.RequestListSnapshots{})

responseValue, err := json.Marshal(response)
if err != nil {
return sdkerrors.QueryResult(sdkerrors.Wrap(err, fmt.Sprintf("failed to marshal list snapshots response %v", response)), app.trace)
}

return abci.ResponseQuery{
Codespace: sdkerrors.RootCodespace,
Height: req.Height,
Value: responseValue,
}

default:
return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown query: %s", path), app.trace)
}
Expand Down Expand Up @@ -795,35 +794,6 @@ func handleQueryStore(app *BaseApp, path []string, req abci.RequestQuery) abci.R
return resp
}

func handleQueryP2P(app *BaseApp, path []string) abci.ResponseQuery {
// "/p2p" prefix for p2p queries
if len(path) < 4 {
return sdkerrors.QueryResult(
sdkerrors.Wrap(
sdkerrors.ErrUnknownRequest, "path should be p2p filter <addr|id> <parameter>",
), app.trace)
}

var resp abci.ResponseQuery

cmd, typ, arg := path[1], path[2], path[3]
switch cmd {
case "filter":
switch typ {
case "addr":
resp = app.FilterPeerByAddrPort(arg)

case "id":
resp = app.FilterPeerByID(arg)
}

default:
resp = sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "expected second parameter to be 'filter'"), app.trace)
}

return resp
}

func handleQueryCustom(app *BaseApp, path []string, req abci.RequestQuery) abci.ResponseQuery {
// path[0] should be "custom" because "/custom" prefix is required for keeper
// queries.
Expand Down
39 changes: 39 additions & 0 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package baseapp

import (
"encoding/json"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -12,6 +13,7 @@ import (
"github.com/cosmos/cosmos-sdk/snapshots"
snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func TestGetBlockRentionHeight(t *testing.T) {
Expand Down Expand Up @@ -164,3 +166,40 @@ func TestBaseAppCreateQueryContext(t *testing.T) {
})
}
}

type paramStore struct {
db *dbm.MemDB
}

func (ps *paramStore) Set(_ sdk.Context, key []byte, value interface{}) {
bz, err := json.Marshal(value)
if err != nil {
panic(err)
}

ps.db.Set(key, bz)
}

func (ps *paramStore) Has(_ sdk.Context, key []byte) bool {
ok, err := ps.db.Has(key)
if err != nil {
panic(err)
}

return ok
}

func (ps *paramStore) Get(_ sdk.Context, key []byte, ptr interface{}) {
bz, err := ps.db.Get(key)
if err != nil {
panic(err)
}

if len(bz) == 0 {
return
}

if err := json.Unmarshal(bz, ptr); err != nil {
panic(err)
}
}

0 comments on commit facd40d

Please sign in to comment.