Skip to content

Commit

Permalink
Remove log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon committed May 1, 2024
1 parent 7f7bc1e commit 079a3ea
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,12 @@ func (k *Keeper) RecvPacketCheckNonRedundant(goCtx context.Context, msg *channel
// Lookup module by channel capability
module, capability, err := k.ChannelKeeper.LookupModuleByChannel(ctx, msg.Packet.DestinationPort, msg.Packet.DestinationChannel)
if err != nil {
ctx.Logger().Error("receive packet failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "could not retrieve module from port-id"))
return false, errorsmod.Wrap(err, "could not retrieve module from port-id")
}

// Retrieve callbacks from router
_, ok := k.PortKeeper.Route(module)
if !ok {
ctx.Logger().Error("receive packet failed", "port-id", msg.Packet.SourcePort, "error", errorsmod.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module))
return false, errorsmod.Wrapf(porttypes.ErrInvalidRoute, "route not found to module: %s", module)
}

Expand All @@ -552,18 +550,15 @@ func (k *Keeper) RecvPacketCheckNonRedundant(goCtx context.Context, msg *channel
// If the packet was already received, perform a no-op
// Use a cached context to prevent accidental state changes
cacheCtx, writeFn := ctx.CacheContext()
// TODO: Update RecvPacket to skip cryptographic checks on Recheck.
// TODO: Update RecvPacket to skip MT inclusion checks on Recheck.
err = k.ChannelKeeper.RecvPacket(cacheCtx, capability, msg.Packet, msg.ProofCommitment, msg.ProofHeight)

switch err {
case nil:
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 true, nil
default:
ctx.Logger().Error("receive packet failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", errorsmod.Wrap(err, "receive packet verification failed"))
return false, errorsmod.Wrap(err, "receive packet verification failed")
}
return false, nil
Expand Down

0 comments on commit 079a3ea

Please sign in to comment.