From c9bc630e377501600f265443e63cfdb302a3eca2 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Fri, 10 May 2024 14:03:37 +0200 Subject: [PATCH 01/10] fix: correctly assign `execModeSimulate` to context for `simulateTx` (#20342) (cherry picked from commit 8144a23835e8edbb39191410e7a60120d9dd1183) --- baseapp/baseapp.go | 1 + 1 file changed, 1 insertion(+) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 9df56b692fb8..215056424fd0 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -675,6 +675,7 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context { if mode == execModeSimulate { ctx, _ = ctx.CacheContext() + ctx = ctx.WithExecMode(sdk.ExecMode(execModeSimulate)) } return ctx From cd80c48eb5c7fcc751edd07cb20fae4221cc9fa6 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 10 May 2024 14:10:08 +0200 Subject: [PATCH 02/10] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e280ccadb73..7b4ead37c3e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (baseapp) [#20346](https://github.com/cosmos/cosmos-sdk/pull/20346) Correctly assign `execModeSimulate` to context for `simulateTx`. * (baseapp) [#20144](https://github.com/cosmos/cosmos-sdk/pull/20144) Remove txs from mempool when antehandler fails in recheck. * (baseapp) [#20107](https://github.com/cosmos/cosmos-sdk/pull/20107) Avoid header height overwrite block height. * (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. From 3cc4a84212ebb76ef72b3078233f5b52d717da7c Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 10 May 2024 15:10:36 +0200 Subject: [PATCH 03/10] linting --- baseapp/abci_utils.go | 2 +- baseapp/baseapp.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 4cfadbbdca5a..db58a1b3eb35 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "slices" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -13,6 +12,7 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" + "slices" "cosmossdk.io/core/comet" diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 215056424fd0..210583228b91 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -720,7 +720,7 @@ func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error { return nil } -func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) { +func (app *BaseApp) beginBlock(_ *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) { var ( resp sdk.BeginBlock err error @@ -785,7 +785,7 @@ func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult { // endBlock is an application-defined function that is called after transactions // have been processed in FinalizeBlock. -func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { +func (app *BaseApp) endBlock(_ context.Context) (sdk.EndBlock, error) { var endblock sdk.EndBlock if app.endBlocker != nil { From a2d054e16479578dc498e929d99bf2b5c13a5704 Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 10 May 2024 15:12:43 +0200 Subject: [PATCH 04/10] linting --- baseapp/abci_utils.go | 1 - 1 file changed, 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index db58a1b3eb35..fae71edd5289 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" From 68c18080a29974ee4816202ab2c368149eab671d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Wed, 15 May 2024 12:35:01 +0200 Subject: [PATCH 05/10] linting --- baseapp/abci_utils.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index fae71edd5289..4cfadbbdca5a 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,6 +4,8 @@ import ( "bytes" "context" "fmt" + "slices" + "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" @@ -11,7 +13,6 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" - "slices" "cosmossdk.io/core/comet" From 6140dfd516e098c1ab932757d70b40955cab927d Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 15 May 2024 17:53:18 +0700 Subject: [PATCH 06/10] lint --- baseapp/abci_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index fae71edd5289..7938ff5c42b2 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" cryptoenc "github.com/cometbft/cometbft/crypto/encoding" @@ -11,7 +12,6 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" - "slices" "cosmossdk.io/core/comet" From f977b965950a94a8e7e320a314d04c5865a3f456 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Wed, 15 May 2024 17:59:17 +0700 Subject: [PATCH 07/10] more lint --- baseapp/abci_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index db58a1b3eb35..4cfadbbdca5a 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "slices" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -12,7 +13,6 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" - "slices" "cosmossdk.io/core/comet" From 638c2265e7956ab5d3662db0f328b311cb51cd12 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Thu, 16 May 2024 14:04:56 +0700 Subject: [PATCH 08/10] try lint fix --- baseapp/abci_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 4cfadbbdca5a..db58a1b3eb35 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "fmt" - "slices" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -13,6 +12,7 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" + "slices" "cosmossdk.io/core/comet" From bac40fae1a5716d3c67d292acd15b323a9857392 Mon Sep 17 00:00:00 2001 From: sontrinh16 Date: Thu, 16 May 2024 14:32:31 +0700 Subject: [PATCH 09/10] revert --- baseapp/abci_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index db58a1b3eb35..4cfadbbdca5a 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + "slices" "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -12,7 +13,6 @@ import ( cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" "github.com/cosmos/gogoproto/proto" - "slices" "cosmossdk.io/core/comet" From 6f090c5cb9f13eb688860b88374bf7531eae677f Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Fri, 17 May 2024 13:33:59 +0200 Subject: [PATCH 10/10] nolint --- baseapp/abci_utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 4cfadbbdca5a..38672821dfcc 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "fmt" - "slices" + "slices" //nolint: gci // ignore this line for this linter "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -12,7 +12,7 @@ import ( cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" - "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/gogoproto/proto" //nolint: gci // ignore this line for this linter "cosmossdk.io/core/comet"