Skip to content

Commit e2c7030

Browse files
Merge pull request #172 from notional-labs/release/v0.45.12-luna
Release/v0.45.12 luna
2 parents c08a6bf + 29a31b2 commit e2c7030

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3543
-7023
lines changed

.github/workflows/tag.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,22 @@ jobs:
2424
args: release --rm-dist --release-notes ./RELEASE_NOTES.md
2525
env:
2626
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
release-success:
29+
needs: release
30+
if: ${{ success() }}
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Notify Slack on success
34+
uses: rtCamp/action-slack-notify@v2.2.0
35+
env:
36+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
37+
SLACK_CHANNEL: cosmos-sdk
38+
SLACK_USERNAME: Cosmos SDK Release Bot
39+
SLACK_ICON: https://avatars.githubusercontent.com/t/5997665?size=64
40+
SLACK_COLOR: good
41+
SLACK_TITLE: "Cosmos SDK ${{ github.ref_name }} is tagged :tada:"
42+
SLACK_MESSAGE: "@channel :point_right: https://github.com/cosmos/cosmos-sdk/releases/tag/${{ github.ref_name }}"
43+
SLACK_FOOTER: ""
44+
SLACK_LINK_NAMES: true
45+
MSG_MINIMAL: true

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,49 @@ Ref: https://keepachangelog.com/en/1.0.0/
3737

3838
## [Unreleased]
3939

40+
## v0.45.12 - 2023-01-23
41+
42+
### Improvements
43+
44+
* [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general.
45+
* (store) [#11646](https://github.com/cosmos/cosmos-sdk/pull/11646) Add store name in tracekv-emitted store traces
46+
* (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24) and use Informal Systems fork.
47+
48+
### API Breaking Changes
49+
50+
* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs:
51+
* Add method `ListenCommit` to `ABCIListener`
52+
* Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore`
53+
* Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces
54+
* Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`)
55+
* Add three new options to file streaming service constructor.
56+
* Modify `ABCIListener` such that any error from any method will always halt the app via `panic`
57+
58+
### Bug Fixes
59+
60+
* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time.
61+
* (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache.
62+
63+
## v0.45.11 - 2022-11-09
64+
65+
### Improvements
66+
67+
* [#13896](https://github.com/cosmos/cosmos-sdk/pull/13896) Queries on pruned height returns error instead of empty values.
68+
* (deps) Bump Tendermint version to [v0.34.23](https://github.com/tendermint/tendermint/releases/tag/v0.34.23).
69+
* (deps) Bump IAVL version to [v0.19.4](https://github.com/cosmos/iavl/releases/tag/v0.19.4).
70+
71+
### Bug Fixes
72+
73+
* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) Fix `--dry-run` flag not working when using tx command.
74+
75+
### CLI Breaking Changes
76+
77+
* [#13656](https://github.com/cosmos/cosmos-sdk/pull/13660) Rename `server.FlagIAVLFastNode` to `server.FlagDisableIAVLFastNode` for clarity.
78+
79+
### API Breaking Changes
80+
81+
* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) The `GetFromFields` function now takes `Context` as an argument and removes `genOnly`.
82+
4083
## v0.45.10 - 2022-10-24
4184

4285
### Features

RELEASE_NOTES.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
# Cosmos SDK v0.45.10 Release Notes
1+
# Cosmos SDK v0.45.12 Release Notes
22

3-
This release introduces a number of bug fixes, features and improvements.
3+
This release introduces a number of bug fixes and improvements. Notably with an update to State Streaming APIs.
4+
5+
Moreover, this release contains a store fix. The changes have been tested against the Cosmos Hub and Juno mainnet with no issues. However, there is a low probability of an edge case happening. Hence, it is recommended to do a **coordinated upgrade** to avoid any issues.
46

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

7-
**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.45.9...v0.45.10
9+
**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.45.11...v0.45.12
10+
11+
**NOTE:** The changes mentioned in `v0.45.9` are **no longer required**. The following replace directive can be removed from the chains.
12+
13+
```go
14+
# Can be deleted from go.mod
15+
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
16+
```
17+
18+
Instead, `github.com/confio/ics23/go` must be **bumped to `v0.9.0`**.

baseapp/abci.go

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
182182

183183
// call the hooks with the BeginBlock messages
184184
for _, streamingListener := range app.abciListeners {
185-
if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil {
186-
app.logger.Error("BeginBlock listening hook failed", "height", req.Header.Height, "err", err)
185+
goCtx := sdk.WrapSDKContext(app.deliverState.ctx)
186+
if err := streamingListener.ListenBeginBlock(goCtx, req, res); err != nil {
187+
panic(fmt.Errorf("BeginBlock listening hook failed, height: %d, err: %w", req.Header.Height, err))
187188
}
188189
}
189190

@@ -209,8 +210,9 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
209210

210211
// call the streaming service hooks with the EndBlock messages
211212
for _, streamingListener := range app.abciListeners {
212-
if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil {
213-
app.logger.Error("EndBlock listening hook failed", "height", req.Height, "err", err)
213+
goCtx := sdk.WrapSDKContext(app.deliverState.ctx)
214+
if err := streamingListener.ListenEndBlock(goCtx, req, res); err != nil {
215+
panic(fmt.Errorf("EndBlock listening hook failed, height: %d, err: %w", req.Height, err))
214216
}
215217
}
216218

@@ -263,8 +265,9 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv
263265

264266
defer func() {
265267
for _, streamingListener := range app.abciListeners {
266-
if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil {
267-
app.logger.Error("DeliverTx listening hook failed", "err", err)
268+
goCtx := sdk.WrapSDKContext(app.deliverState.ctx)
269+
if err := streamingListener.ListenDeliverTx(goCtx, req, res); err != nil {
270+
panic(fmt.Errorf("DeliverTx listening hook failed: %w", err))
268271
}
269272
}
270273
}()
@@ -301,7 +304,7 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv
301304
// defined in config, Commit will execute a deferred function call to check
302305
// against that height and gracefully halt if it matches the latest committed
303306
// height.
304-
func (app *BaseApp) Commit() (res abci.ResponseCommit) {
307+
func (app *BaseApp) Commit() abci.ResponseCommit {
305308
defer telemetry.MeasureSince(time.Now(), "abci", "commit")
306309

307310
header := app.deliverState.ctx.BlockHeader()
@@ -312,6 +315,20 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {
312315
// MultiStore (app.cms) so when Commit() is called is persists those values.
313316
app.deliverState.ms.Write()
314317
commitID := app.cms.Commit()
318+
319+
res := abci.ResponseCommit{
320+
Data: commitID.Hash,
321+
RetainHeight: retainHeight,
322+
}
323+
324+
// call the hooks with the Commit message
325+
for _, streamingListener := range app.abciListeners {
326+
goCtx := sdk.WrapSDKContext(app.deliverState.ctx)
327+
if err := streamingListener.ListenCommit(goCtx, res); err != nil {
328+
panic(fmt.Errorf("Commit listening hook failed, height: %d, err: %w", header.Height, err))
329+
}
330+
}
331+
315332
app.logger.Info("commit synced", "commit", fmt.Sprintf("%X", commitID))
316333

317334
// Reset the Check state to the latest committed.
@@ -345,10 +362,7 @@ func (app *BaseApp) Commit() (res abci.ResponseCommit) {
345362
go app.snapshot(header.Height)
346363
}
347364

348-
return abci.ResponseCommit{
349-
Data: commitID.Hash,
350-
RetainHeight: retainHeight,
351-
}
365+
return res
352366
}
353367

354368
// halt attempts to gracefully shutdown the node via SIGINT and SIGTERM falling

baseapp/baseapp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func TestLoadVersionPruning(t *testing.T) {
108108

109109
for _, v := range []int64{1, 2, 4} {
110110
_, err = app.cms.CacheMultiStoreWithVersion(v)
111-
require.NoError(t, err)
111+
require.Error(t, err)
112112
}
113113

114114
for _, v := range []int64{3, 5, 6, 7} {

baseapp/streaming.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
package baseapp
22

33
import (
4+
"context"
45
"io"
56
"sync"
67

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

910
store "github.com/cosmos/cosmos-sdk/store/types"
10-
"github.com/cosmos/cosmos-sdk/types"
1111
)
1212

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

2327
// StreamingService interface for registering WriteListeners with the BaseApp and updating the service with the ABCI messages using the hooks

client/cmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err
235235

236236
if clientCtx.From == "" || flagSet.Changed(flags.FlagFrom) {
237237
from, _ := flagSet.GetString(flags.FlagFrom)
238-
fromAddr, fromName, keyType, err := GetFromFields(clientCtx.Keyring, from, clientCtx.GenerateOnly)
238+
fromAddr, fromName, keyType, err := GetFromFields(clientCtx, clientCtx.Keyring, from)
239239
if err != nil {
240240
return clientCtx, err
241241
}

client/context.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,19 @@ func (ctx Context) printOutput(out []byte) error {
333333
// GetFromFields returns a from account address, account name and keyring type, given either
334334
// an address or key name. If genOnly is true, only a valid Bech32 cosmos
335335
// address is returned.
336-
func GetFromFields(kr keyring.Keyring, from string, genOnly bool) (sdk.AccAddress, string, keyring.KeyType, error) {
336+
func GetFromFields(clientCtx Context, kr keyring.Keyring, from string) (sdk.AccAddress, string, keyring.KeyType, error) {
337337
if from == "" {
338338
return nil, "", 0, nil
339339
}
340340

341-
if genOnly {
342-
addr, err := sdk.AccAddressFromBech32(from)
341+
addr, err := sdk.AccAddressFromBech32(from)
342+
switch {
343+
case clientCtx.Simulate:
344+
if err != nil {
345+
return nil, "", 0, errors.Wrap(err, "a valid bech32 address must be provided in simulation mode")
346+
}
347+
return addr, "", 0, nil
348+
case clientCtx.GenerateOnly:
343349
if err != nil {
344350
return nil, "", 0, errors.Wrap(err, "must provide a valid Bech32 address in generate-only mode")
345351
}
@@ -348,7 +354,7 @@ func GetFromFields(kr keyring.Keyring, from string, genOnly bool) (sdk.AccAddres
348354
}
349355

350356
var info keyring.Info
351-
if addr, err := sdk.AccAddressFromBech32(from); err == nil {
357+
if err == nil {
352358
info, err = kr.KeyByAddress(addr)
353359
if err != nil {
354360
return nil, "", 0, err
@@ -365,7 +371,7 @@ func GetFromFields(kr keyring.Keyring, from string, genOnly bool) (sdk.AccAddres
365371

366372
// NewKeyringFromBackend gets a Keyring object from a backend
367373
func NewKeyringFromBackend(ctx Context, backend string) (keyring.Keyring, error) {
368-
if ctx.GenerateOnly || ctx.Simulate {
374+
if ctx.Simulate {
369375
return keyring.New(sdk.KeyringServiceName(), keyring.BackendMemory, ctx.KeyringDir, ctx.Input, ctx.KeyringOptions...)
370376
}
371377

0 commit comments

Comments
 (0)