Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring in v0.46.7 updates. #402

Merged
merged 49 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7f88c60
docs: add ApplicationQueryService release notes (#13587)
robert-zaremba Oct 21, 2022
f538e09
feat(cli): add module-account cli cmd and grpc get api (backport #136…
mergify[bot] Oct 24, 2022
afdf06a
fix(x/auth): allow multiple = signs in `GetTxsEvent` (backport #12474…
mergify[bot] Oct 24, 2022
ec09eae
fix: app-hash mismatch if upgrade migration commit is interrupted (ba…
mergify[bot] Oct 25, 2022
a653798
feat(cli): Add iavl-disable-fastnode cmd flag with proper description…
mergify[bot] Oct 26, 2022
4eed46e
build(deps): Bump github.com/cosmos/iavl from 0.19.3 to 0.19.4 (#13680)
julienrbrt Oct 28, 2022
9d7028d
feat: emit cached context events (backport #13063) (#13702)
mergify[bot] Oct 31, 2022
eb1e3eb
chore: prepare 0.46.4 changelog (#13716)
julienrbrt Nov 1, 2022
68ee142
ci: notify for 0.46.x releases (#13719)
julienrbrt Nov 1, 2022
c7a9435
docs: fix algolia on 0.46 (#13730)
julienrbrt Nov 2, 2022
ba49bff
ci: modifying docs in 0.46 should not redeploy docs (#13732)
julienrbrt Nov 2, 2022
e4ae994
fix: propagate msg events correctly in x/gov (backport #13728) (#13748)
mergify[bot] Nov 3, 2022
2899dcf
refactor: add error log when iavl set failed (backport #13803) (#13804)
mergify[bot] Nov 9, 2022
0d1ed1a
chore: bump tendermint to `0.34.23` (#13814)
julienrbrt Nov 9, 2022
2bd2cf1
fix: propagate events in x/group through sdk.Results (backport #13808…
mergify[bot] Nov 9, 2022
3a809e2
docs: update algolia index (#13823)
julienrbrt Nov 10, 2022
62443b8
fix: bank store migration (backport #13821) (#13829)
mergify[bot] Nov 10, 2022
68e54fa
feat(types): set custom GasConfig on Context for GasKVStore (backport…
mergify[bot] Nov 11, 2022
2114ec4
chore: prepare 0.46.5 release (#13816)
julienrbrt Nov 14, 2022
2d515e0
fix: Allow underscores in EventRegex (backport #13861) (#13864)
mergify[bot] Nov 15, 2022
0b81939
fix(group): add group members weight checks (backport #13869) (#13880)
mergify[bot] Nov 16, 2022
6b633ef
fix(group)!: Fix group min execution period (backport #13876) (#13885)
mergify[bot] Nov 16, 2022
29cf4bc
feat(bank): Add helper for v0.46 denom migration (#13891)
amaury1093 Nov 16, 2022
e5fef13
chore: impove 0.46.5 release notes (#13898)
julienrbrt Nov 17, 2022
c80177e
refactor: State Streaming Docs + Explicit Config Support (backport #1…
mergify[bot] Nov 17, 2022
b88f086
chore: remove typo (#13914) (#13917)
mergify[bot] Nov 18, 2022
2f55513
fix: correctly propagate msg errors in gov (backport #13918) (#13928)
mergify[bot] Nov 18, 2022
8cce748
feat(bank): enable 0.46.5 bank migration fix through migrator keeper …
robert-zaremba Nov 18, 2022
8339276
chore: bump tendermint to 0.34.24 (#13972)
julienrbrt Nov 22, 2022
9765823
chore: add group and gov/v1 in swagger (backport #13984) (#13996)
mergify[bot] Nov 23, 2022
7bb7fa9
fix(baseapp): fix snapshot interval bug (backport #14049) (#14053)
mergify[bot] Nov 29, 2022
c1f4ca1
refactor: use viper unmarshal in `config.GetConfig` function (backpor…
mergify[bot] Nov 30, 2022
72699f7
fix(group)!: Don't re-tally proposals after VP end (backport #14071) …
mergify[bot] Nov 30, 2022
85d6f66
fix: do not shadow clientCtx in start.go (backport #14086) (#14101)
mergify[bot] Nov 30, 2022
6e5e302
chore: Test for Server Config Read #14125 (#14127)
mergify[bot] Dec 1, 2022
ff27cd3
fix: remove duplicate ante events (backport #13983) (#14142)
mergify[bot] Dec 3, 2022
a627446
feat: support alternative query multistore (backport #13529) (#14169)
mergify[bot] Dec 6, 2022
cc06bce
fix: state listener observe writes at wrong time (backport #13516) (#…
mergify[bot] Dec 6, 2022
45d2f08
refactor: provide a helper for baseapp options (backport #14175) (#14…
mergify[bot] Dec 6, 2022
463f4e4
feat: add --grpc client option (backport #14051) (#14192)
mergify[bot] Dec 7, 2022
eb6d0ef
refactor: cleanup store/streaming/constructor.go (backport #14044) (#…
mergify[bot] Dec 9, 2022
fcfa361
chore: audit store/streaming/file/service.go (backport #14234) (#14241)
mergify[bot] Dec 10, 2022
79ac73d
fix: fix grpc flag conflict (backport #14244) (#14248)
mergify[bot] Dec 10, 2022
4153b12
chore: prepare 0.46.7 release (#14103)
julienrbrt Dec 13, 2022
f71df80
fix(gov): Fix v3 votes migrations (backport #14214) (#14277)
mergify[bot] Dec 13, 2022
54bcb8b
Merge tag 'v0.46.7' into prov/dwedul/v0.46.7-to-our-0.46.x
SpicyLemon Dec 13, 2022
65ee327
Add changelog entry for bringing in v0.46.7 changes.
SpicyLemon Dec 13, 2022
cb3382f
Fix the changelog. The merge duplicated several SDK sections.
SpicyLemon Dec 13, 2022
17b0ad1
Fix the TestFileStreamingService.
SpicyLemon Dec 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased

* nothing
### Improvements

* Bring in Cosmos-SDK [v0.46.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.7) changes [#402](https://github.com/provenance-io/cosmos-sdk/pull/402).

---

Expand Down Expand Up @@ -197,18 +199,52 @@ It also contains the Provenance Blockchain customizations that were part of [v0.

# Cosmos-SDK releases

## [v0.46.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.7) - 2022-12-13

### Features

* (client) [#14051](https://github.com/cosmos/cosmos-sdk/pull/14051) Add `--grpc` client option.

### Improvements

* (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.
* [#13781](https://github.com/cosmos/cosmos-sdk/pull/13781) Remove `client/keys.KeysCdc`.
* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go.

### State Machine Breaking

* (x/gov) [#14214](https://github.com/cosmos/cosmos-sdk/pull/14214) Fix gov v0.46 migration to v1 votes.
* Also provide a helper function `govv046.Migrate_V0466_To_V0467` for migrating a chain already on v0.46 with versions <=v0.46.6 to the latest v0.46.7 correct state.
* (x/group) [#14071](https://github.com/cosmos/cosmos-sdk/pull/14071) Don't re-tally proposal after voting period end if they have been marked as ACCEPTED or REJECTED.

### API Breaking Changes

* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs:
* Add method `ListenCommit` to `ABCIListener`
* Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore`
* Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces
* Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`)
* Add three new options to file streaming service constructor.
* Modify `ABCIListener` such that any error from any method will always halt the app via `panic`
* (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service.

### Bug Fixes

* (baseapp) [#13983](https://github.com/cosmos/cosmos-sdk/pull/13983) Don't emit duplicate ante-handler events when a post-handler is defined.
* (baseapp) [#14049](https://github.com/cosmos/cosmos-sdk/pull/14049) Fix state sync when interval is zero.
* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time.

## [v0.46.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.6) - 2022-11-18

### Improvements

* (config) [#13894](https://github.com/cosmos/cosmos-sdk/pull/13894) Support state streaming configuration in `app.toml` template and default configuration.

## Bug Fixes
### Bug Fixes

* (x/gov) [#13918](https://github.com/cosmos/cosmos-sdk/pull/13918) Fix propagation of message errors when executing a proposal.

---

## [v0.46.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.5) - 2022-11-17

### Features
Expand Down Expand Up @@ -237,8 +273,6 @@ It also contains the Provenance Blockchain customizations that were part of [v0.
* (store) [#13803](https://github.com/cosmos/cosmos-sdk/pull/13803) Add an error log if IAVL set operation failed.
* [#13861](https://github.com/cosmos/cosmos-sdk/pull/13861) Allow `_` characters in tx event queries, i.e. `GetTxsEvent`.

---

## [v0.46.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.4) - 2022-11-01

### Features
Expand All @@ -262,8 +296,6 @@ It also contains the Provenance Blockchain customizations that were part of [v0.

* (context) [#13063](https://github.com/cosmos/cosmos-sdk/pull/13063) Update `Context#CacheContext` to automatically emit all events on the parent context's `EventManager`.

---

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

ATTENTION:
Expand Down
36 changes: 26 additions & 10 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
// call the hooks with the BeginBlock messages
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("BeginBlock listening hook failed", "height", req.Header.Height, "err", err)
panic(fmt.Errorf("BeginBlock listening hook failed, height: %d, err: %w", req.Header.Height, err))
}
}

Expand All @@ -216,7 +216,7 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
// call the streaming service hooks with the EndBlock messages
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("EndBlock listening hook failed", "height", req.Height, "err", err)
panic(fmt.Errorf("EndBlock listening hook failed, height: %d, err: %w", req.Height, err))
}
}

Expand Down Expand Up @@ -270,7 +270,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv
defer func() {
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil {
app.logger.Error("DeliverTx listening hook failed", "err", err)
panic(fmt.Errorf("DeliverTx listening hook failed: %w", err))
}
}
}()
Expand Down Expand Up @@ -304,7 +304,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv
// defined in config, Commit will execute a deferred function call to check
// against that height and gracefully halt if it matches the latest committed
// height.
func (app *BaseApp) Commit() (res abci.ResponseCommit) {
func (app *BaseApp) Commit() abci.ResponseCommit {
header := app.deliverState.ctx.BlockHeader()
retainHeight := app.GetBlockRetentionHeight(header.Height)

Expand All @@ -313,6 +313,19 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {
// MultiStore (app.cms) so when Commit() is called is persists those values.
app.deliverState.ms.Write()
commitID := app.cms.Commit()

res := abci.ResponseCommit{
Data: commitID.Hash,
RetainHeight: retainHeight,
}

// call the hooks with the Commit message
for _, streamingListener := range app.abciListeners {
if err := streamingListener.ListenCommit(app.deliverState.ctx, res); err != nil {
panic(fmt.Errorf("Commit listening hook failed, height: %d, err: %w", header.Height, err))
}
}

app.logger.Info("commit synced", "commit", fmt.Sprintf("%X", commitID))

// Reset the Check state to the latest committed.
Expand Down Expand Up @@ -344,10 +357,7 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {

go app.snapshotManager.SnapshotIfApplicable(header.Height)

return abci.ResponseCommit{
Data: commitID.Hash,
RetainHeight: retainHeight,
}
return res
}

// halt attempts to gracefully shutdown the node via SIGINT and SIGTERM falling
Expand Down Expand Up @@ -599,7 +609,13 @@ func (app *BaseApp) createQueryContext(height int64, prove bool) (sdk.Context, e
return sdk.Context{}, err
}

lastBlockHeight := app.LastBlockHeight()
// use custom query multistore if provided
qms := app.qms
if qms == nil {
qms = sdk.MultiStore(app.cms)
}

lastBlockHeight := qms.LatestVersion()
if height > lastBlockHeight {
return sdk.Context{},
sdkerrors.Wrap(
Expand All @@ -621,7 +637,7 @@ func (app *BaseApp) createQueryContext(height int64, prove bool) (sdk.Context, e
)
}

cacheMS, err := app.cms.CacheMultiStoreWithVersion(height)
cacheMS, err := qms.CacheMultiStoreWithVersion(height)
if err != nil {
return sdk.Context{},
sdkerrors.Wrapf(
Expand Down
8 changes: 7 additions & 1 deletion baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ type BaseApp struct { // nolint: maligned
type appStore struct {
db dbm.DB // common DB backend
cms sdk.CommitMultiStore // Main (uncached) state
qms sdk.MultiStore // Optional alternative state provider for query service
storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader()

// an inter-block write-through cache provided to the context during deliverState
Expand Down Expand Up @@ -725,7 +726,12 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re
//
// Note: If the postHandler fails, we also revert the runMsgs state.
if app.postHandler != nil {
newCtx, err := app.postHandler(runMsgCtx, tx, mode == runTxModeSimulate)
// The runMsgCtx context currently contains events emitted by the ante handler.
// We clear this to correctly order events without duplicates.
// Note that the state is still preserved.
postCtx := runMsgCtx.WithEventManager(sdk.NewEventManager())

newCtx, err := app.postHandler(postCtx, tx, mode == runTxModeSimulate)
SpicyLemon marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return gInfo, nil, nil, priority, ctx, err
}
Expand Down
12 changes: 11 additions & 1 deletion baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (app *BaseApp) SetSnapshot(snapshotStore *snapshots.Store, opts snapshottyp
if app.sealed {
panic("SetSnapshot() on sealed BaseApp")
}
if snapshotStore == nil || opts.Interval == snapshottypes.SnapshotIntervalOff {
if snapshotStore == nil {
app.snapshotManager = nil
return
}
Expand All @@ -245,6 +245,16 @@ func (app *BaseApp) SetStreamingService(s StreamingService) {
app.abciListeners = append(app.abciListeners, s)
}

// SetQueryMultiStore set a alternative MultiStore implementation to support grpc query service.
//
// Ref: https://github.com/cosmos/cosmos-sdk/issues/13317
func (app *BaseApp) SetQueryMultiStore(ms sdk.MultiStore) {
if app.sealed {
panic("SetQueryMultiStore() on sealed BaseApp")
}
app.qms = ms
}

// SetFeeHandler sets the FeeHandler which if set will change the behavior of fee handling
func (app *BaseApp) SetFeeHandler(feeHandler sdk.FeeHandler) {
if app.sealed {
Expand Down
14 changes: 9 additions & 5 deletions baseapp/streaming.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
package baseapp

import (
"context"
"io"
"sync"

abci "github.com/tendermint/tendermint/abci/types"

store "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/types"
)

// ABCIListener interface used to hook into the ABCI message processing of the BaseApp
// ABCIListener interface used to hook into the ABCI message processing of the BaseApp.
// the error results are propagated to consensus state machine,
// if you don't want to affect consensus, handle the errors internally and always return `nil` in these APIs.
type ABCIListener interface {
// ListenBeginBlock updates the streaming service with the latest BeginBlock messages
ListenBeginBlock(ctx types.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error
ListenBeginBlock(ctx context.Context, req abci.RequestBeginBlock, res abci.ResponseBeginBlock) error
// ListenEndBlock updates the steaming service with the latest EndBlock messages
ListenEndBlock(ctx types.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error
ListenEndBlock(ctx context.Context, req abci.RequestEndBlock, res abci.ResponseEndBlock) error
// ListenDeliverTx updates the steaming service with the latest DeliverTx messages
ListenDeliverTx(ctx types.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error
ListenDeliverTx(ctx context.Context, req abci.RequestDeliverTx, res abci.ResponseDeliverTx) error
// ListenCommit updates the steaming service with the latest Commit event
ListenCommit(ctx context.Context, res abci.ResponseCommit) error
}

// StreamingService interface for registering WriteListeners with the BaseApp and updating the service with the ABCI messages using the hooks
Expand Down
26 changes: 26 additions & 0 deletions client/cmd.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package client

import (
"crypto/tls"
"fmt"
"strings"

"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/tendermint/tendermint/libs/cli"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand Down Expand Up @@ -147,6 +151,28 @@ func ReadPersistentCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Cont
}
}

if clientCtx.GRPCClient == nil || flagSet.Changed(flags.FlagGRPC) {
grpcURI, _ := flagSet.GetString(flags.FlagGRPC)
if grpcURI != "" {
var dialOpts []grpc.DialOption

useInsecure, _ := flagSet.GetBool(flags.FlagGRPCInsecure)
if useInsecure {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} else {
dialOpts = append(dialOpts, grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
MinVersion: tls.VersionTLS12,
})))
}

grpcClient, err := grpc.Dial(grpcURI, dialOpts...)
if err != nil {
return Context{}, err
}
clientCtx = clientCtx.WithGRPCClient(grpcClient)
}
}

return clientCtx, nil
}

Expand Down
36 changes: 35 additions & 1 deletion client/docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@
}
}
},
{
"url": "./tmp-swagger-gen/cosmos/gov/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "GovV1Params",
"Proposal": "GovV1Proposal",
"Proposals": "GovV1Proposal",
"Vote": "GovV1Vote",
"Votes": "GovV1Votes",
"Deposit": "GovV1Deposit",
"Deposits": "GovV1Deposit",
"TallyResult": "GovV1TallyResult"
}
}
},
{
"url": "./tmp-swagger-gen/cosmos/mint/v1beta1/query.swagger.json",
"operationIds": {
Expand Down Expand Up @@ -116,6 +131,25 @@
"Params": "FeegrantParams"
}
}
},
{
"url": "./tmp-swagger-gen/cosmos/nft/v1beta1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "NftParams",
"Balance": "NftBalance"
}
}
},
SpicyLemon marked this conversation as resolved.
Show resolved Hide resolved
{
"url": "./tmp-swagger-gen/cosmos/group/v1/query.swagger.json",
"operationIds": {
"rename": {
"Params": "GroupParams",
"Proposal": "GroupProposal",
"TallyResult": "GroupTallyResult"
}
}
}
]
}
}
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

Loading