From 8401de21d6033629643845ce1e77fdbc474fca27 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 25 Jun 2025 07:36:30 +0800 Subject: [PATCH 1/2] fix: mempool error causes state machine failure Solution: - mempool can be configured differently by different nodes, bringing mempool error into state machine can introduce consensus failure (app hash mismatch). --- CHANGELOG.md | 1 + baseapp/baseapp.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a3fcb4b28a..881dd4e4d5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/authz) [#24638](https://github.com/cosmos/cosmos-sdk/pull/24638) Fixed a minor bug where the grant key was cast as a string and dumped directly into the error message leading to an error string possibly containing invalid UTF-8. * (client, client/rpc, x/auth/tx) [#24551](https://github.com/cosmos/cosmos-sdk/pull/24551) Handle cancellation properly when supplying context to client methods. * (x/epochs) [#24770](https://github.com/cosmos/cosmos-sdk/pull/24770) Fix register of epoch hooks in `InvokeSetHooks`. +* (baseapp) [#]() Don't take mempool error as state machine execution failure. ### Deprecated diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index d13ba98b34c3..0396e4270731 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -888,8 +888,7 @@ func (app *BaseApp) runTx(mode sdk.ExecMode, txBytes []byte, tx sdk.Tx) (gInfo s case execModeFinalize: err = app.mempool.Remove(tx) if err != nil && !errors.Is(err, mempool.ErrTxNotFound) { - return gInfo, nil, anteEvents, - fmt.Errorf("failed to remove tx from mempool: %w", err) + app.logger.Error("failed to remove tx from mempool", "err", err) } } From 867b9670a508fef231bf24430f43c0ac37a0c9cc Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 25 Jun 2025 07:39:59 +0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 881dd4e4d5f8..2769c62f2d2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,7 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/authz) [#24638](https://github.com/cosmos/cosmos-sdk/pull/24638) Fixed a minor bug where the grant key was cast as a string and dumped directly into the error message leading to an error string possibly containing invalid UTF-8. * (client, client/rpc, x/auth/tx) [#24551](https://github.com/cosmos/cosmos-sdk/pull/24551) Handle cancellation properly when supplying context to client methods. * (x/epochs) [#24770](https://github.com/cosmos/cosmos-sdk/pull/24770) Fix register of epoch hooks in `InvokeSetHooks`. -* (baseapp) [#]() Don't take mempool error as state machine execution failure. +* (baseapp) [#24898](https://github.com/cosmos/cosmos-sdk/pull/24898) Don't take mempool error as state machine execution failure. ### Deprecated