Skip to content

Commit

Permalink
Merge pull request from GHSA-j496-crgh-34mx
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Apr 5, 2024
1 parent 373fc7f commit e78b3a2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
go 1.19

retract (
[v7.2.0, v7.3.2] // contains ASA-2024-007 vulnerability
v7.1.0 // contains ledger transaction signing bug
v7.0.1 // contains ledger transaction signing bug
v7.0.0 // contains huckleberry vulnerability
Expand Down
20 changes: 10 additions & 10 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,18 +528,18 @@ func (k Keeper) Timeout(goCtx context.Context, msg *channeltypes.MsgTimeout) (*c
return nil, sdkerrors.Wrap(err, "timeout packet verification failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

// Perform application logic callback
err = cbs.OnTimeoutPacket(ctx, msg.Packet, relayer)
if err != nil {
ctx.Logger().Error("timeout failed", "port-id", msg.Packet.SourcePort, "channel-id", msg.Packet.SourceChannel, "error", sdkerrors.Wrap(err, "timeout packet callback failed"))
return nil, sdkerrors.Wrap(err, "timeout packet callback failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

defer func() {
telemetry.IncrCounterWithLabels(
[]string{"ibc", "timeout", "packet"},
Expand Down Expand Up @@ -601,6 +601,11 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo
return nil, sdkerrors.Wrap(err, "timeout on close packet verification failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

// Perform application logic callback
//
// NOTE: MsgTimeout and MsgTimeoutOnClose use the same "OnTimeoutPacket"
Expand All @@ -611,11 +616,6 @@ func (k Keeper) TimeoutOnClose(goCtx context.Context, msg *channeltypes.MsgTimeo
return nil, sdkerrors.Wrap(err, "timeout packet callback failed")
}

// Delete packet commitment
if err = k.ChannelKeeper.TimeoutExecuted(ctx, cap, msg.Packet); err != nil {
return nil, err
}

defer func() {
telemetry.IncrCounterWithLabels(
[]string{"ibc", "timeout", "packet"},
Expand Down

0 comments on commit e78b3a2

Please sign in to comment.