Skip to content

Commit

Permalink
chores: update to v0.42.6 (cosmos#95)
Browse files Browse the repository at this point in the history
* CLI: `query ibc-transfer escrow-address` (cosmos#9383)

* Fix the liveliness test Docker error (cosmos#9396) (cosmos#9402)

(cherry picked from commit 44a4138)

Co-authored-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>

* docs: fix broken interfaces links (backport cosmos#9448) (cosmos#9478)

* fix interfaces links (cosmos#9448)

Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
(cherry picked from commit 37fc37d)

# Conflicts:
#	docs/building-modules/messages-and-queries.md
#	docs/building-modules/module-interfaces.md
#	docs/building-modules/module-manager.md
#	docs/building-modules/query-services.md

* resolve merge conflicts

* revert rename codec

Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>

* backport: fix ibc genesis export bug (cosmos#9401)

* correctly set next identifier sequence in genesis export for clients/connections/channels

* add changelog

* fix linting (cosmos#9531)

* fix: testnet cli command update genesis supply (backport cosmos#9497) (cosmos#9513)

* fix: testnet cli command update genesis supply (cosmos#9497)

<!--
The default pull request template is for types feat, fix, or refactor.
For other templates, add one of the following parameters to the url:
- template=docs.md
- template=other.md
-->

## Description

closes: cosmos#9372

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

### This PR makes the `testnet` command update the bank genesis supply.

When using the `testnet` cli command, it creates nodes and balances, but does **not** update the supply. When using this in conjunction with `add-genesis-account` which **does** update the supply, it creates an invalid genesis file. This PR updates the testnet command to properly set the supply.

* feat: add header hash to `Context` (backport cosmos#9390) (cosmos#9395)

* feat: add header hash to `Context` (cosmos#9390)

* baseapp, types: add header hash to

* changelog

(cherry picked from commit 151d6c5)

# Conflicts:
#	CHANGELOG.md

* Fix conflicts

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>

* fix: x/gov deposits querier (Initial Deposit) (backport cosmos#9288) (cosmos#9453)

* fix: x/gov deposits querier (Initial Deposit) (cosmos#9288)

* copied from old PR

* fix errors

* add test

* Update x/gov/client/utils/query.go

Co-authored-by: Robert Zaremba <robert@zaremba.ch>

* fix tests

* fix failing test

* add test

* update test

* fix tests

* fix deposit query

* fix test

* update tests

* add more tests

* address lint error

* address lint error

* review changes

Co-authored-by: Robert Zaremba <robert@zaremba.ch>
(cherry picked from commit 66ee994)

# Conflicts:
#	CHANGELOG.md
#	x/gov/client/cli/query.go
#	x/gov/client/testutil/cli_test.go
#	x/gov/client/utils/query.go

* resolve conflicts

Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
Co-authored-by: aleem1314 <aleem@vitwit.com>

* feat: add `RefundGas` function to `GasMeter` (backport cosmos#9403) (cosmos#9444)

* feat: add `RefundGas` function to `GasMeter` (cosmos#9403)

* feat: add RefundGas function to GasMeter

* changelog

* add comment about use case

* Apply suggestions from code review

Co-authored-by: Alessio Treglia <alessio@tendermint.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
(cherry picked from commit 90edeb6)

# Conflicts:
#	CHANGELOG.md

* conflicts

* fix

* Update CHANGELOG.md

Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* fix: Bank module init genesis optimization (backport cosmos#9428) (cosmos#9440)

* fix: Bank module init genesis optimization (cosmos#9428)

* optimize the bank module genesis initialization

* remove k.setBalances & k.clearBalances and update changelog

* fix lint

Co-authored-by: Aaron Craelius <aaron@regen.network>
(cherry picked from commit 2ae7875)

# Conflicts:
#	CHANGELOG.md
#	x/bank/keeper/genesis.go
#	x/bank/keeper/send.go

* fix conflicts

* Update CHANGELOG.md

Co-authored-by: yys <sw.yunsuk@gmail.com>
Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>

* fix: update simapp to use correct default broadcast mode (backport cosmos#9408) (cosmos#9527)

* fix: update simapp to use correct default broadcast mode (cosmos#9408)

(cherry picked from commit 80330ec)

* Add changelog

Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>

* Backport: IBC query header/node-state fixes (cosmos#9385)

* fix ibc query header/node-state cmds

* changelog

Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>

* build(deps): tendermint version (backport cosmos#9541) (cosmos#9542)

* build(deps): tendermint version (cosmos#9541)

* bump tendermint version

* go mod tidy

(cherry picked from commit e4673ad)

* add changelog entry

* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>

* feat: add cosmos-sdk Version (backport cosmos#9429) (cosmos#9543)

* feat: add cosmos-sdk Version (cosmos#9429)

<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description

Add CosmosSDKVersion to nodeInfo.

closes: cosmos#9420

(cherry picked from commit 105ad99)

# Conflicts:
#	CHANGELOG.md
#	CONTRIBUTING.md
#	docs/core/proto-docs.md

* resolve conflicts

* resolve conflicts

Co-authored-by: Marko <marbar3778@yahoo.com>

* fix: set header hash every block (backport cosmos#9552) (cosmos#9555)

* fix: set header hash every block (cosmos#9552)

## Description

- Sets the header hash on every block (ref cosmos#9390). Previously was only set during initialization for `deliverState`.
- Closes cosmos#9514

<!-- Add a description of the changes that this PR introduces and the files that
are the most critical to review. -->

* chore: Update release notes and Changelog for 0.42.6 (cosmos#9544)

* Update release notes

* Clean up changelog

Co-authored-by: Ethan Buchman <ethan@coinculture.info>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Riccardo Montagnin <riccardo.montagnin@gmail.com>
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Amaury M <1293565+amaurym@users.noreply.github.com>
Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com>
Co-authored-by: aleem1314 <aleem@vitwit.com>
Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: yys <sw.yunsuk@gmail.com>
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
  • Loading branch information
15 people committed Jul 9, 2021
1 parent a59a3d4 commit 7d3a610
Show file tree
Hide file tree
Showing 120 changed files with 842 additions and 304 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ issues:
- text: "ST1016:"
linters:
- stylecheck
- text: "SA1019: codec.LegacyAmino is deprecated"
linters:
- staticcheck
max-issues-per-linter: 10000
max-same-issues: 10000

Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,33 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) - 2021-06-18

### Improvements

* [\#9428](https://github.com/cosmos/cosmos-sdk/pull/9428) Optimize bank InitGenesis. Added `k.initBalances`.
* [\#9429](https://github.com/cosmos/cosmos-sdk/pull/9429) Add `cosmos_sdk_version` to node_info
* [\#9541](https://github.com/cosmos/cosmos-sdk/pull/9541) Bump tendermint dependency to v0.34.11.

### Bug Fixes

* [\#9385](https://github.com/cosmos/cosmos-sdk/pull/9385) Fix IBC `query ibc client header` cli command. Support historical queries for query header/node-state commands.
* [\#9401](https://github.com/cosmos/cosmos-sdk/pull/9401) Fixes incorrect export of IBC identifier sequences. Previously, the next identifier sequence for clients/connections/channels was not set during genesis export. This resulted in the next identifiers being generated on the new chain to reuse old identifiers (the sequences began again from 0).
* [\#9408](https://github.com/cosmos/cosmos-sdk/pull/9408) Update simapp to use correct default broadcast mode.
* [\#9513](https://github.com/cosmos/cosmos-sdk/pull/9513) Fixes testnet CLI command. Testnet now updates the supply in genesis. Previously, when using add-genesis-account and testnet together, inconsistent genesis files would be produced, as only add-genesis-account was updating the supply.
* (x/gov) [\#8813](https://github.com/cosmos/cosmos-sdk/pull/8813) fix `GET /cosmos/gov/v1beta1/proposals/{proposal_id}/deposits` to include initial deposit

### Features

* [\#9383](https://github.com/cosmos/cosmos-sdk/pull/9383) New CLI command `query ibc-transfer escrow-address <port> <channel id>` to get the escrow address for a channel; can be used to then query balance of escrowed tokens
* (baseapp, types) [#\9390](https://github.com/cosmos/cosmos-sdk/pull/9390) Add current block header hash to `Context`
* (store) [\#9403](https://github.com/cosmos/cosmos-sdk/pull/9403) Add `RefundGas` function to `GasMeter` interface

## [v0.42.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.5) - 2021-05-18

### Bug Fixes

* [\#9514](https://github.com/cosmos/cosmos-sdk/issues/9514) Fix panic when retrieving the `BlockGasMeter` on `(Re)CheckTx` mode.
* [\#9235](https://github.com/cosmos/cosmos-sdk/pull/9235) CreateMembershipProof/CreateNonMembershipProof now returns an error
if input key is empty, or input data contains empty key.
* [\#9108](https://github.com/cosmos/cosmos-sdk/pull/9108) Fixed the bug with querying multisig account, which is not showing threshold and public_keys.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ All PRs require two Reviews before merge (except docs changes, or variable name-
If you open a PR on the Cosmos SDK, it is mandatory to update the relevant documentation in /docs.

- If your change relates to the core SDK (baseapp, store, ...), please update the `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders.
- If your changes relate to the core of the CLI or Light-client (not specifically to module's CLI/Rest), please modify the `docs/interfaces/` folder.
- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), please modify the `docs/run-node/` folder.
- If your changes relate to a module, please update the module's spec in `x/moduleName/docs/spec/`.

## Forking
Expand Down
29 changes: 13 additions & 16 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
# Cosmos SDK v0.42.5 "Stargate" Release Notes
# Cosmos SDK v0.42.6 "Stargate" Release Notes

This release includes various minor bugfixes and improvments, including:

- Fix support for building the Cosmos SDK on ARM architectures,
- Fix the `[appd] keys show/list` CLI subcommands for multisigs,
- Internal code performance improvment.
- x/bank's InitGenesis optimization, which should significantly decrease genesis initialization time,
- bump Tendermint to v0.34.11 to fix state sync issues,
- add `cosmos_sdk_version` to `node_info` to be able to query the SDK version used by a node,
- IBC bugfixes and improvements (see below for more info),
- new fields on `sdk.Context` (see below for more info).

It also introduces one new feature: adding the `[appd] config` subcommand back to the SDK.
See the [Cosmos SDK v0.42.6 milestone](https://github.com/cosmos/cosmos-sdk/milestone/45?closed=1) on our issue tracker for the exhaustive list of all changes.

See the [Cosmos SDK v0.42.5 milestone](https://github.com/cosmos/cosmos-sdk/milestone/44?closed=1) on our issue tracker for the exhaustive list of all changes.
### IBC Bugfixes and Improvements

### The `config` Subcommand
The `[appd] query ibc client header` is fixed and allows querying by height for the header and node-state command. This allows easier venerability of which IBC tokens belong to which chains. IBC's ExportGenesis now exports all fields, including previously missing `NextClientSequence`, `NextConnectionSequence` and `NextChannelSequence`. A new subcommand `[appd] query ibc-transfer escrow-address` has been added to get the escrow address for a channel; it can be used to then query balance of escrowed tokens.

One new feature introduced in the Stargate series was the merging of the two CLI binaries `[appd]` and `[appcli]` into one single application binary. In this process, the `[appcli] config` subcommand, which was used to save client-side configuration into a TOML file, was removed.
### New Fields on `sdk.Context`

Due to [popular demand](https://github.com/cosmos/cosmos-sdk/issues/8529), we have introduced this feature back to the SDK, under the `[appd] config` subcommand. The functionality is as follows:
Two fields have been added on `sdk.Context`:

- `[appd] config`: Output all client-side configuration.
- `[appd] config [config-name]`: Get the given configuration (e.g. `keyring-backend` or `node-id`).
- `[appd] config [config-name] [config-value]`: Set and persist the given configuration with the new value.

All configurations are persisted to the filesystem, under the path `$APP_HOME/config/client.toml`. For the list of all possible client-side configurations, please have a look at this `client.toml` file, as it is heavily commented.

Environment variables binding to client-side configuration also works. For example, the command `KEYRING_BACKEND=os [appd] tx bank send ...` will bind ENV variable to the `keyring-backend` config. The order or precedence for config is: `flags > env vars > client.toml file`.
- `ctx.HeaderHash` adds the current block header hash obtained during abci.RequestBeginBlock to the Context,
- `ctx.GasMeter().RefundGas(<amount>, <description>)` adds support for refunding gas directly to the gas meter.
14 changes: 13 additions & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,19 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
gasMeter = sdk.NewInfiniteGasMeter()
}

app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter)
// NOTE: header hash is not set in NewContext, so we manually set it here

app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(gasMeter).
WithHeaderHash(req.Hash)

// we also set block gas meter to checkState in case the application needs to
// verify gas consumption during (Re)CheckTx
if app.checkState != nil {
app.checkState.ctx = app.checkState.ctx.
WithBlockGasMeter(gasMeter).
WithHeaderHash(req.Hash)
}

if app.beginBlocker != nil {
res = app.beginBlocker(app.deliverState.ctx, req)
Expand Down
6 changes: 5 additions & 1 deletion baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,11 @@ func TestCheckTx(t *testing.T) {

// If a block is committed, CheckTx state should be reset.
header := tmproto.Header{Height: 1}
app.BeginBlock(abci.RequestBeginBlock{Header: header})
app.BeginBlock(abci.RequestBeginBlock{Header: header, Hash: []byte("hash")})

require.NotNil(t, app.checkState.ctx.BlockGasMeter(), "block gas meter should have been set to checkState")
require.NotEmpty(t, app.checkState.ctx.HeaderHash())

app.EndBlock(abci.RequestEndBlock{})
app.Commit()

Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/init.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package statik

//This just for fixing the error in importing empty github.com/cosmos/cosmos-sdk/client/docs/statik
// This just for fixing the error in importing empty github.com/cosmos/cosmos-sdk/client/docs/statik
Loading

0 comments on commit 7d3a610

Please sign in to comment.