From e33884f79ab575c14d25e51d95ffd3ec4713110f Mon Sep 17 00:00:00 2001 From: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Date: Thu, 9 May 2024 13:27:39 +0200 Subject: [PATCH] fix: allow tx decoding to fail in GetBlockWithTxs (#20323) --- x/auth/CHANGELOG.md | 1 + x/auth/tx/service.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/x/auth/CHANGELOG.md b/x/auth/CHANGELOG.md index 2892a63d7982..6fe1a31ff4c5 100644 --- a/x/auth/CHANGELOG.md +++ b/x/auth/CHANGELOG.md @@ -63,3 +63,4 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19148](https://github.com/cosmos/cosmos-sdk/pull/19148) Checks the consumed gas for verifying a multisig pubKey signature during simulation. * [#19239](https://github.com/cosmos/cosmos-sdk/pull/19239) Sets from flag in multi-sign command to avoid no key name provided error. * [#19099](https://github.com/cosmos/cosmos-sdk/pull/19099) `verifyIsOnCurve` now checks if we are simulating to avoid malformed public key error. +* [#20323](https://github.com/cosmos/cosmos-sdk/pull/20323) Ignore undecodable txs in GetBlocksWithTxs. \ No newline at end of file diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index 700495073f14..e84d96b24521 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -186,13 +186,13 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith if req.Pagination != nil && req.Pagination.Reverse { for i, count := offset, uint64(0); i > 0 && count != limit; i, count = i-1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } } else { for i, count := offset, uint64(0); i < blockTxsLn && count != limit; i, count = i+1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } }