Skip to content

Commit

Permalink
Merge pull request from GHSA-3v7p-4x7p-4rx7
Browse files Browse the repository at this point in the history
Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
  • Loading branch information
damiannolan and crodriguezvega authored May 25, 2023
1 parent cddd215 commit 08962a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ go 1.19

module github.com/cosmos/ibc-go/v4

retract [v4.0.0, v4.1.0] // depends on SDK version without dragonberry fix
retract (
[v4.0.0, v4.1.0] // depends on SDK version without dragonberry fix
v4.1.1 // contains huckleberry vulnerability
v4.2.0 // contains huckleberry vulnerability
v4.3.0 // contains huckleberry vulnerability
v4.4.0 // contains huckleberry vulnerability
)

require (
github.com/armon/go-metrics v0.4.1
Expand Down
5 changes: 2 additions & 3 deletions modules/core/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,11 @@ func (k Keeper) RecvPacket(goCtx context.Context, msg *channeltypes.MsgRecvPacke
// Cache context so that we may discard state changes from callback if the acknowledgement is unsuccessful.
cacheCtx, writeFn = ctx.CacheContext()
ack := cbs.OnRecvPacket(cacheCtx, msg.Packet, relayer)
// NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context.
// Events from callback are emitted regardless of acknowledgement success
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events())
if ack == nil || ack.Success() {
// write application state changes for asynchronous and successful acknowledgements
writeFn()
// NOTE: The context returned by CacheContext() refers to a new EventManager, so it needs to explicitly set events to the original context.
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events())
}

// Set packet acknowledgement only if the acknowledgement is not nil.
Expand Down

0 comments on commit 08962a0

Please sign in to comment.