Skip to content

Commit

Permalink
Merge pull request #303 from provenance-io/prov/dwedul/apply-46.3
Browse files Browse the repository at this point in the history
Bring in v0.46.3 changes (and fixes).
  • Loading branch information
SpicyLemon committed Oct 20, 2022
2 parents 6b06a3e + 8d89eb0 commit ac9ef18
Show file tree
Hide file tree
Showing 71 changed files with 7,833 additions and 1,337 deletions.
166 changes: 82 additions & 84 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ proto-lint:
proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.21/proto/tendermint
TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.22/proto/tendermint

TM_CRYPTO_TYPES = proto/tendermint/crypto
TM_ABCI_TYPES = proto/tendermint/abci
Expand Down
120 changes: 68 additions & 52 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,118 +1,126 @@
## [v0.46.2-pio-2](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.2-pio-2) - 2022-10-10
## [v0.46.3-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.1-pio-1) - 2022-10-20

### Improvements
Chains using this version must also apply the following replace line to their `go.mod`:

* Provide the logger to the store when creating a new BaseApp [#283](https://github.com/provenance-io/cosmos-sdk/pull/283).

### Full Commit History
```go
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
```

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2-pio-1...v0.46.2-pio-2
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2...v0.46.2-pio-2

---
### Improvements

## [v0.46.2-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.2-pio-1) - 2022-10-03
* Bring in Cosmos-SDK [v0.46.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.3) changes [#303](https://github.com/provenance-io/cosmos-sdk/pull/303).
* Updated the swagger files [#303](https://github.com/provenance-io/cosmos-sdk/pull/303).

### Improvements
### Bug Fixes

* Bring in Cosmos-SDK v0.46.2 changes. [#269](https://github.com/provenance-io/cosmos-sdk/pull/269)
* Patch the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702) [#303](https://github.com/provenance-io/cosmos-sdk/pull/303).

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1-pio-1...v0.46.2-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2...v0.46.2-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2-pio-2...v0.46.3-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.3...v0.46.3-pio-1

---

## [v0.46.1-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.1-pio-1) - 2022-09-30
## [v0.46.2-pio-2](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.2-pio-2) - 2022-10-10

### Improvements

* (baseapp) Add a optional function to baseapp to manipulate events [#1092](https://github.com/provenance-io/provenance/issues/1092)
* Provide the logger to the store when creating a new BaseApp [#283](https://github.com/provenance-io/cosmos-sdk/pull/283).

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1-pio-1-rc1...v0.46.1-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1...v0.46.1-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2-pio-1...v0.46.2-pio-2
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2...v0.46.2-pio-2

---

## [v0.46.1-pio-1-rc1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.1-pio-1-rc1) - 2022-09-19
## [v0.46.2-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.2-pio-1) - 2022-10-03

### Improvements

* Bring in Cosmos-SDK v0.46.1 changes. [#235](https://github.com/provenance-io/cosmos-sdk/pull/235)
* Bring in Cosmos-SDK v0.46.2 changes. [#269](https://github.com/provenance-io/cosmos-sdk/pull/269)

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0-pio-1-rc4...v0.46.1-pio-1-rc1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1...v0.46.1-pio-1-rc1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1-pio-1...v0.46.2-pio-1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2...v0.46.2-pio-1

---

## [v0.46.0-pio-1-rc4](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.0-pio-1-rc4) - 2022-08-23

### Improvements
## [v0.46.1-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.1-pio-1) - 2022-09-30

* Add support for event data injection into end block handlers (https://github.com/provenance-io/provenance/issues/626)
* Updated the swagger files. [#1017](https://github.com/provenance-io/provenance/issues/1017)
This release is based on Cosmos-SDK release [v0.46.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.1).
It also contains the Provenance Blockchain customizations that were part of [v0.45.9-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.45.9-pio-1) ([changes](https://github.com/provenance-io/cosmos-sdk/compare/v0.45.9...v0.45.9-pio-1)), but weren't included in v0.46.1.

### Full Commit History
### Features

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0-pio-1-rc3...v0.46.0-pio-1-rc4
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0...v0.46.0-pio-1-rc4
* (x/authz) [#807](https://github.com/provenance-io/provenance/issues/807) Create a CountAuthorization type.
* (baseapp) Add custom fee handler [#354](https://github.com/provenance-io/provenance/issues/354)
* (baseapp) Add a optional function to baseapp to manipulate events [#1092](https://github.com/provenance-io/provenance/issues/1092)
* (x/authz) Create the GetAuthorization to replace the previously removed GetCleanAuthorization. [#222](https://github.com/provenance-io/cosmos-sdk/pull/222)
* (baseapp) Create the IMsgServiceRouter interface and baseapp.SetMsgServiceRouter function [#223](https://github.com/provenance-io/cosmos-sdk/pull/223).

---
### Improvements

## [v0.46.0-pio-1-rc3](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.0-pio-1-rc3) - 2022-08-18
* Bring in Cosmos-SDK [v0.46.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.1) changes. [#235](https://github.com/provenance-io/cosmos-sdk/pull/235)
* Add support for event data injection into end block handlers (https://github.com/provenance-io/provenance/issues/626)
* (x/bank) [#208](https://github.com/provenance-io/cosmos-sdk/pull/208) Apply the SendEnabled fix.
* Updated the swagger files. [#1017](https://github.com/provenance-io/provenance/issues/1017)

### Bug Fixes

* (x/auth) Add the missing account number case to the sim state decoder. [#228](https://github.com/provenance-io/cosmos-sdk/pull/228)
* (x/auth) Handle missing account numbers during InitGenesis. [#228](https://github.com/provenance-io/cosmos-sdk/pull/228)
* (store/rootmulti) [#12487](https://github.com/cosmos/cosmos-sdk/pull/12487) Fix non-deterministic map iteration.

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0-pio-1-rc2...v0.46.0-pio-1-rc3
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0...v0.46.0-pio-1-rc3
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1...v0.46.1-pio-1

---

## [v0.46.0-pio-1-rc2](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.0-pio-1-rc2) - 2022-08-11
## [v0.46.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.3) - 2022-10-20

### Improvements
ATTENTION:

* (x/authz) Create the GetAuthorization to replace the previously removed GetCleanAuthorization. [#222](https://github.com/provenance-io/cosmos-sdk/pull/222)
* (baseapp) Create the IMsgServiceRouter interface and baseapp.SetMsgServiceRouter function [#223](https://github.com/provenance-io/cosmos-sdk/pull/223).
This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).

### Full Commit History
All users should upgrade immediately.

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0-pio-1-rc1...v0.46.0-pio-1-rc2
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0...v0.46.0-pio-1-rc2
Users *must* add a replace directive in their go.mod for the new `ics23` package in the SDK:

---

## [v0.46.0-pio-1-rc1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.46.0-pio-1-rc1) - 2022-08-04

This release is based on Cosmos-SDK release [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0).
It also contains the customizations that were included in [v0.45.5-pio-1](https://github.com/provenance-io/cosmos-sdk/releases/tag/v0.45.5-pio-1), but weren't included in v0.46.0.
```go
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
```

### Features

* (x/authz) [#807](https://github.com/provenance-io/provenance/issues/807) Create a CountAuthorization type.
* (baseapp) Add custom fee handler [#354](https://github.com/provenance-io/provenance/issues/354)
* [#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

* (x/bank) [#208](https://github.com/provenance-io/cosmos-sdk/pull/208) Apply the SendEnabled fix.
* [#13586](https://github.com/cosmos/cosmos-sdk/pull/13586) Bump Tendermint to `v0.34.22`.
* (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

* (store/rootmulti) [#12487](https://github.com/cosmos/cosmos-sdk/pull/12487) Fix non-deterministic map iteration.
* 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

* (server) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) The `Application` service now requires the `RegisterNodeService` method to be implemented.

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0...v0.46.0-pio-1-rc1
* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.2...v0.46.3

---

Expand Down Expand Up @@ -151,6 +159,10 @@ It also contains the customizations that were included in [v0.45.5-pio-1](https:
* (grpc) [#13417](https://github.com/cosmos/cosmos-sdk/pull/13417) fix grpc query panic that could crash the node (backport #13352).
* (grpc) [#13418](https://github.com/cosmos/cosmos-sdk/pull/13418) Add close for grpc only mode.

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.1...v0.46.2

---

## [v0.46.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.1) - 2022-08-24
Expand All @@ -172,6 +184,10 @@ It also contains the customizations that were included in [v0.45.5-pio-1](https:
* (x/group) [#12888](https://github.com/cosmos/cosmos-sdk/pull/12888) Fix event propagation to the current context of `x/group` message execution `[]sdk.Result`.
* (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration.

### Full Commit History

* https://github.com/provenance-io/cosmos-sdk/compare/v0.46.0...v0.46.1

---

## [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - 2022-07-26
Expand Down
8 changes: 8 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ Additionally, new packages have been introduced in order to further split the co
* `authz.NewMsgGrant` `expiration` is now a pointer. When `nil` is used, then no expiration will be set (grant won't expire).
* `authz.NewGrant` takes a new argument: block time, to correctly validate expire time.

### gRPC

A new gRPC service, `proto/cosmos/base/node/v1beta1/query.proto`, has been introduced
which exposes various operator configuration. App developers should be sure to
register the service with the gRPC-gateway service via
`nodeservice.RegisterGRPCGatewayRoutes` in their application construction, which
is typically found in `RegisterAPIRoutes`.

### Keyring

The keyring has been refactored in v0.46.
Expand Down
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 @@ -762,6 +745,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 @@ -797,35 +796,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)
}
}
Loading

0 comments on commit ac9ef18

Please sign in to comment.