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 <[email protected]>
  • Loading branch information
damiannolan and crodriguezvega committed May 25, 2023
1 parent d90d864 commit 74988e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ go 1.18

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

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

require (
github.com/armon/go-metrics v0.4.0
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 74988e7

Please sign in to comment.