Skip to content

Commit

Permalink
fix: Suppressing scary SDK error on redundant packets
Browse files Browse the repository at this point in the history
  • Loading branch information
joeabbey committed Jun 16, 2023
1 parent de95076 commit 6bdc5cc
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 6bdc5cc

Please sign in to comment.