Skip to content

Commit

Permalink
Merge pull request from GHSA-j496-crgh-34mx
Browse files Browse the repository at this point in the history
Co-authored-by: srdtrk <srdtrk@hotmail.com>
  • Loading branch information
DimitrisJim and srdtrk authored Apr 5, 2024
1 parent 43a97eb commit 278fa89
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
Expand Up @@ -3,6 +3,7 @@ go 1.19
module github.com/cosmos/ibc-go/v5

retract (
[v5.3.1, v5.3.2] // contains ASA-2024-007 vulnerability
v5.3.0 // contains huckleberry vulnerability
v5.2.0 // contains huckleberry vulnerability
[v5.0.0, v5.1.1] // depends on SDK version < v0.46.7
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 @@ -476,17 +476,17 @@ 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 {
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 @@ -542,6 +542,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 @@ -551,11 +556,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 278fa89

Please sign in to comment.