Skip to content

Commit

Permalink
fix: Suppressing scary SDK error on redundant packets (#1214)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Gouin <andrew@gouin.io>
  • Loading branch information
joeabbey and agouin committed Jul 22, 2023
1 parent 99020a1 commit 8828b43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions relayer/chains/cosmos/log.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package cosmos

import (
"errors"
"reflect"

"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
typestx "github.com/cosmos/cosmos-sdk/types/tx"
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
chantypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/cosmos/relayer/v2/relayer/provider"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand Down Expand Up @@ -52,6 +54,12 @@ func (cc *CosmosProvider) LogFailedTx(res *provider.RelayerTxResponse, err error
fields = append(fields, msgTypesField(msgs))

if err != nil {

if errors.Is(err, chantypes.ErrRedundantTx) {
cc.log.Debug("Redundant message(s)", fields...)
return
}

// Make a copy since we may continue to the warning
errorFields := append(fields, zap.Error(err))
cc.log.Error(
Expand Down

0 comments on commit 8828b43

Please sign in to comment.