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

upgrade: v0.47.10 #539

Merged
merged 34 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dc47405
fix(client/tx): simulate with correct pk (backport #18472) (#18503)
mergify[bot] Nov 17, 2023
d9c494d
feat(server): cmd flag to disable colored logs (backport #18478) (#18…
mergify[bot] Nov 19, 2023
c533e72
build(deps): Bump github.com/cometbft/cometbft from 0.37.2 to 0.37.3 …
dependabot[bot] Nov 20, 2023
c76618a
Revert "build(deps): Bump github.com/cometbft/cometbft from 0.37.2 to…
julienrbrt Nov 20, 2023
7f4bed7
fix(server): properly parse multiple gas config (backport #18537) (#1…
mergify[bot] Nov 22, 2023
cda8a00
build(deps): Bump github.com/cometbft/cometbft from 0.37.2 to 0.37.4 …
dependabot[bot] Nov 27, 2023
15113db
feat(x/gov): better gov genesis validation (backport #18707) (#18712)
mergify[bot] Dec 13, 2023
77a637d
docs: add ante precision (backport #18709) (#18730)
mergify[bot] Dec 13, 2023
0e76ac4
fix(x/auth): remove misleading gas wanted value from tx simulation fa…
mergify[bot] Dec 19, 2023
ee33192
docs: add index page for learn section (backport #18777) (#18779)
mergify[bot] Dec 19, 2023
52b8bcc
docs: fix for links (backport #18816) (#18819)
mergify[bot] Dec 19, 2023
6be7871
fix(baseapp): Reset GasMeter before deliverTX v0.47.x backport (#18826)
Eric-Warehime Dec 20, 2023
be58a66
chore: prepare v0.47.7 (#18765)
julienrbrt Dec 20, 2023
3f1b1b3
feat(client): add `WithFromName` to tx factory (backport #18852) (#18…
mergify[bot] Dec 21, 2023
ce1a7be
perf: Speedup coins.Sort() when coins is of length 1 (backport #18875…
mergify[bot] Dec 23, 2023
fc75bbc
perf: Speedup DecCoin.Sort() when coins is of length 1 (backport #188…
mergify[bot] Dec 26, 2023
4bc771b
fix(server): consensus failure while restart node with wrong `chainId…
atheeshp Jan 3, 2024
4f04d45
test: add NodeURI for clientCtx (backport #18930) (#18988)
mergify[bot] Jan 9, 2024
8e93520
chore: clean-up buf workspace (backport #18993) (#18998)
mergify[bot] Jan 10, 2024
1295fd0
build(deps): Bump cosmossdk.io/log from 1.2.1 to 1.3.0 (#19024)
dependabot[bot] Jan 11, 2024
dd769c9
build(deps): Bump cosmossdk.io/errors from 1.0.0 to 1.0.1 (#19025)
dependabot[bot] Jan 11, 2024
343c6ad
fix: allow empty public keys when setting signatures (backport #19106…
mergify[bot] Jan 19, 2024
cc64d53
chore: prepare v0.47.8 (#19162)
julienrbrt Jan 22, 2024
affd5bd
docs: fix typo in 06-grpc_rest.md (backport #19192) (#19194)
mergify[bot] Jan 23, 2024
6e02068
fix: skip same-sender non-sequential sequence and then add others txs…
mergify[bot] Jan 29, 2024
8b254a1
test(baseapp): Refactor tx selector tests + better comments (backpor…
mergify[bot] Feb 3, 2024
8f23b4d
build(deps): Bump cosmossdk.io/log from 1.3.0 to 1.3.1 (#19359)
dependabot[bot] Feb 6, 2024
b501f5e
chore: prepare v0.47.9 (#19451)
julienrbrt Feb 18, 2024
3faa145
build(deps): Bump github.com/cosmos/cosmos-proto from 1.0.0-beta.2 to…
dependabot[bot] Feb 19, 2024
5c55b30
Merge pull request from GHSA-4j93-fm92-rp4m
julienrbrt Feb 19, 2024
28d2fcc
build(deps): Bump cosmossdk.io/math from 1.2.0 to 1.3.0 (#19564)
dependabot[bot] Feb 26, 2024
a685e50
fix: use proper `db_backend` type when reading chain-id (#19573)
k-yang Feb 27, 2024
1e7f3bf
Merge pull request from GHSA-86h5-xcpx-cfqc
catShaark Feb 27, 2024
24f2e72
logs: print proposal if error
javiersuweijie Mar 21, 2024
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
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,47 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v0.47.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.10) - 2024-02-27

### Bug Fixes

* (x/staking) Fix a possible bypass of delagator slashing: [GHSA-86h5-xcpx-cfqc](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-86h5-xcpx-cfqc)
* (server) [#19573](https://github.com/cosmos/cosmos-sdk/pull/19573) Use proper `db_backend` type when reading chain-id

## [v0.47.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.9) - 2024-02-19

### Bug Fixes

* (x/auth/vesting) [GHSA-4j93-fm92-rp4m](#bug-fixes) Add `BlockedAddr` check in `CreatePeriodicVestingAccount`.
* (baseapp) [#19177](https://github.com/cosmos/cosmos-sdk/pull/19177) Fix baseapp `DefaultProposalHandler` same-sender non-sequential sequence.

## [v0.47.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.8) - 2024-01-22

### Improvements

* (client/tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory.
* (types) [#18875](https://github.com/cosmos/cosmos-sdk/pull/18875) Speedup coins.Sort() if len(coins) <= 1.
* (types) [#18888](https://github.com/cosmos/cosmos-sdk/pull/18888) Speedup DecCoin.Sort() if len(coins) <= 1
* (testutil) [#18930](https://github.com/cosmos/cosmos-sdk/pull/18930) Add NodeURI for clientCtx.

### Bug Fixes

* [#19106](https://github.com/cosmos/cosmos-sdk/pull/19106) Allow empty public keys when setting signatures. Public keys aren't needed for every transaction.
* (server) [#18920](https://github.com/cosmos/cosmos-sdk/pull/18920) Fixes consensus failure while restart node with wrong `chainId` in genesis.

## [v0.47.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.7) - 2023-12-20

### Improvements

* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation.
* (server) [#18478](https://github.com/cosmos/cosmos-sdk/pull/18478) Add command flag to disable colored logs.

### Bug Fixes

* (baseapp) [#18609](https://github.com/cosmos/cosmos-sdk/issues/18609) Fixed accounting in the block gas meter after BeginBlock and before DeliverTx, ensuring transaction processing always starts with the expected zeroed out block gas meter.
* (server) [#18537](https://github.com/cosmos/cosmos-sdk/pull/18537) Fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter.
* (client/tx) [#18472](https://github.com/cosmos/cosmos-sdk/pull/18472) Utilizes the correct Pubkey when simulating a transaction.

## [v0.47.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.6) - 2023-11-14

### Features
Expand Down
21 changes: 12 additions & 9 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Cosmos SDK v0.47.6 Release Notes
# Cosmos SDK v0.47.10 Release Notes

💬 [**Release Discussion**](https://github.com/orgs/cosmos/discussions/categories/announcements)
💬 [**Release Discussion**](https://github.com/orgs/cosmos/discussions/6)

## 🚀 Highlights

v0.50 is there, the v0.47.x line is now supported for bug fixes only, as per our release policy.
Start integrating with [Cosmos SDK Eden (v0.50)](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.1) and enjoy and the new features and performance improvements.
This early monthly patch release fixes [GHSA-86h5-xcpx-cfqc](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-86h5-xcpx-cfqc).

For this 6th patch release of the `v0.47.x` line, some of the notable changes include:
We recommended to upgrade to this patch release as soon as possible.
When upgrading from <= v0.47.9, please ensure that 2/3 of the validator power upgrade to v0.47.10.

* The gRPC and API server are both started in standalone mode (CometBFT out of process)
* Fix the default prepare proposal handler to better match CometBFT ABCI specification
Curious? Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.47.10/CHANGELOG.md) for an exhaustive list of changes or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.47.9...v0.47.10) from last release.

Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.47.5/CHANGELOG.md) for an exhaustive list of changes or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/v0.47.5...v0.47.6) from last release.
Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md) when migrating from `v0.47.x` to `v0.50.x`.

Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md) when migrating from `v0.47.x` to `v0.50.1`.
## Maintenance Policy

v0.50 has been released which means the v0.47.x line is now supported for bug fixes only, as per our release policy. Earlier versions are not maintained.

Start integrating with [Cosmos SDK Eden (v0.50)](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.5) and enjoy and the new features and performance improvements.
6 changes: 3 additions & 3 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ module cosmossdk.io/api
go 1.19

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-proto v1.0.0-beta.4
github.com/cosmos/gogoproto v1.4.10
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
google.golang.org/protobuf v1.32.0
)

require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 // indirect
golang.org/x/net v0.9.0 // indirect
golang.org/x/sys v0.7.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8=
github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0=
github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU=
github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co=
github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoKuI=
github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201 h1:BEABXpNXLEz0WxtA+6CQIz2xkg80e+1zrhWyMcq8VzE=
golang.org/x/exp v0.0.0-20230131160201-f062dba9d201/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
Expand All @@ -23,5 +23,5 @@ google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag=
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
4 changes: 4 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@
}
}

// Reset the gas meter so that the AnteHandlers aren't required to
gasMeter = app.getBlockGasMeter(app.deliverState.ctx)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter)

return res
}

Expand Down
64 changes: 62 additions & 2 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package baseapp

import (
"encoding/json"
"fmt"

"github.com/cockroachdb/errors"
abci "github.com/cometbft/cometbft/abci/types"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/mempool"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
)

type (
Expand Down Expand Up @@ -93,8 +97,40 @@
}

iterator := h.mempool.Select(ctx, req.Txs)
selectedTxsSignersSeqs := make(map[string]uint64)
var selectedTxsNums int
for iterator != nil {
memTx := iterator.Tx()
sigs, err := memTx.(signing.SigVerifiableTx).GetSignaturesV2()
if err != nil {
panic(fmt.Errorf("failed to get signatures: %w", err))
}

// If the signers aren't in selectedTxsSignersSeqs then we haven't seen them before
// so we add them and continue given that we don't need to check the sequence.
shouldAdd := true
txSignersSeqs := make(map[string]uint64)
for _, sig := range sigs {
signer := sdk.AccAddress(sig.PubKey.Address()).String()
seq, ok := selectedTxsSignersSeqs[signer]
if !ok {
txSignersSeqs[signer] = sig.Sequence
continue
}

// If we have seen this signer before in this block, we must make
// sure that the current sequence is seq+1; otherwise is invalid
// and we skip it.
if seq+1 != sig.Sequence {
shouldAdd = false
break
}
txSignersSeqs[signer] = sig.Sequence
}
if !shouldAdd {
iterator = iterator.Next()
continue
}

// NOTE: Since transaction verification was already executed in CheckTx,
// which calls mempool.Insert, in theory everything in the pool should be
Expand All @@ -111,6 +147,23 @@
if stop {
break
}

txsLen := len(h.txSelector.SelectedTxs())
for sender, seq := range txSignersSeqs {
// If txsLen != selectedTxsNums is true, it means that we've
// added a new tx to the selected txs, so we need to update
// the sequence of the sender.
if txsLen != selectedTxsNums {
selectedTxsSignersSeqs[sender] = seq
} else if _, ok := selectedTxsSignersSeqs[sender]; !ok {
// The transaction hasn't been added but it passed the
// verification, so we know that the sequence is correct.
// So we set this sender's sequence to seq-1, in order
// to avoid unnecessary calls to PrepareProposalVerifyTx.
selectedTxsSignersSeqs[sender] = seq - 1
}
}
Comment on lines +152 to +165

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
selectedTxsNums = txsLen
}

iterator = iterator.Next()
Expand Down Expand Up @@ -147,10 +200,13 @@
maxBlockGas = b.MaxGas
}

for _, txBytes := range req.Txs {
for i, txBytes := range req.Txs {
tx, err := h.txVerifier.ProcessProposalVerifyTx(txBytes)
if err != nil {
ctx.Logger().Error("proposal failed on ProcessProposalVerifyTx", "error", err)
proposal, err := json.Marshal(req)
if err == nil {
ctx.Logger().Error("proposal failed on ProcessProposalVerifyTx", "error", err, "proposal", string(proposal), "tx_index", i)
}
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}
}

Expand All @@ -161,6 +217,10 @@
}

if totalTxGas > uint64(maxBlockGas) {
proposal, err := json.Marshal(req)
if err == nil {
ctx.Logger().Error("proposal failed on ProcessProposalVerifyTx", "error", err, "proposal", string(proposal), "tx_index", i)
}
ctx.Logger().Error("proposal failed on totalTxGas > maxBlockGas", "totalTxGas", totalTxGas, "maxBlockGas", maxBlockGas)
return abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}
}
Expand Down
Loading
Loading