Skip to content

Commit

Permalink
chore: remove redundant calls to emit events in cached context. (#7648)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Dec 16, 2024
1 parent a8ee548 commit a64877f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
2 changes: 0 additions & 2 deletions modules/core/04-channel/v2/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ func (k *Keeper) Acknowledgement(ctx context.Context, msg *types.MsgAcknowledgem
case nil:
writeFn()
case types.ErrNoOpMsg:
// no-ops do not need event emission as they will be ignored
sdkCtx.Logger().Debug("no-op on redundant relay", "source-channel", msg.Packet.SourceChannel)
return &types.MsgAcknowledgementResponse{Result: types.NOOP}, nil
default:
Expand Down Expand Up @@ -251,7 +250,6 @@ func (k *Keeper) Timeout(ctx context.Context, timeout *types.MsgTimeout) (*types
case nil:
writeFn()
case types.ErrNoOpMsg:
// no-ops do not need event emission as they will be ignored
sdkCtx.Logger().Debug("no-op on redundant relay", "source-channel", timeout.Packet.SourceChannel)
return &types.MsgTimeoutResponse{Result: types.NOOP}, nil
default:
Expand Down
5 changes: 0 additions & 5 deletions modules/core/04-channel/v2/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ func (k *Keeper) recvPacket(
// on unordered channels. Packet receipts must not be pruned, unless it has been marked stale
// by the increase of the recvStartSequence.
if k.HasPacketReceipt(ctx, packet.DestinationChannel, packet.Sequence) {
emitRecvPacketEvents(ctx, packet)
// This error indicates that the packet has already been relayed. Core IBC will
// treat this error as a no-op in order to prevent an entire relay transaction
// from failing and consuming unnecessary fees.
Expand Down Expand Up @@ -221,9 +220,6 @@ func (k *Keeper) acknowledgePacket(ctx context.Context, packet types.Packet, ack

commitment := k.GetPacketCommitment(ctx, packet.SourceChannel, packet.Sequence)
if len(commitment) == 0 {
// TODO: signal noop in events?
emitAcknowledgePacketEvents(ctx, packet)

// This error indicates that the acknowledgement has already been relayed
// or there is a misconfigured relayer attempting to prove an acknowledgement
// for a packet never sent. Core IBC will treat this error as a no-op in order to
Expand Down Expand Up @@ -300,7 +296,6 @@ func (k *Keeper) timeoutPacket(
// check that the commitment has not been cleared and that it matches the packet sent by relayer
commitment := k.GetPacketCommitment(ctx, packet.SourceChannel, packet.Sequence)
if len(commitment) == 0 {
emitTimeoutPacketEvents(ctx, packet)
// This error indicates that the timeout has already been relayed
// or there is a misconfigured relayer attempting to prove a timeout
// for a packet never sent. Core IBC will treat this error as a no-op in order to
Expand Down

0 comments on commit a64877f

Please sign in to comment.