Skip to content

Commit

Permalink
add logging for noop messages (#4465)
Browse files Browse the repository at this point in the history
  • Loading branch information
charleenfei authored Aug 28, 2023
1 parent d5e55b7 commit c849a78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*c
writeFn()
case channeltypes.ErrNoOpMsg:
// no-ops do not need event emission as they will be ignored
ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
return &channeltypes.MsgTimeoutResponse{Result: channeltypes.NOOP}, nil
default:
ctx.Logger().Error("timeout failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout packet verification failed"))
Expand Down Expand Up @@ -594,6 +595,7 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo
writeFn()
case channeltypes.ErrNoOpMsg:
// no-ops do not need event emission as they will be ignored
ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
return &channeltypes.MsgTimeoutOnCloseResponse{Result: channeltypes.NOOP}, nil
default:
ctx.Logger().Error("timeout on close failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "timeout on close packet verification failed"))
Expand Down Expand Up @@ -668,6 +670,7 @@ func (k Keeper) Acknowledgement(goCtx context.Context, msg *channeltypes.MsgAckn
writeFn()
case channeltypes.ErrNoOpMsg:
// no-ops do not need event emission as they will be ignored
ctx.Logger().Debug("no-op on redundant relay", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel)
return &channeltypes.MsgAcknowledgementResponse{Result: channeltypes.NOOP}, nil
default:
ctx.Logger().Error("acknowledgement failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "acknowledge packet verification failed"))
Expand Down

0 comments on commit c849a78

Please sign in to comment.