Skip to content

Commit

Permalink
add comment explaining stack
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Sep 27, 2024
1 parent 4672c4b commit 30f6557
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,18 @@ func overrideWasmVariables() {
wasmtypes.MaxProposalWasmSize = wasmtypes.MaxWasmSize
}

// WireICS20PreWasmKeeper Create the IBC Transfer Stack from bottom to top:
// * SendPacket. Originates from the transferKeeper and goes up the stack:
// transferKeeper.SendPacket -> ibc_rate_limit.SendPacket -> ibc_hooks.SendPacket -> channel.SendPacket
// * RecvPacket, message that originates from core IBC and goes down to app, the flow is the other way
// channel.RecvPacket -> ibc_hooks.OnRecvPacket -> ibc_rate_limit.OnRecvPacket -> gmp.OnRecvPacket -> pfm.OnRecvPacket -> transfer.OnRecvPacket
//
// Note that the forward middleware is only integrated on the "receive" direction. It can be safely skipped when sending.
// Note also that the forward middleware is called "router", but we are using the name "pfm" (packet forward middleware) for clarity
// This may later be renamed upstream: https://github.com/ibc-apps/middleware/packet-forward-middleware/issues/10
//
// After this, the wasm keeper is required to be set on both
// app.Ics20WasmHooks AND app.RateLimitingICS4Wrapper
func (app *App) WireICS20PreWasmKeeper(
appCodec codec.Codec,
) {
Expand All @@ -1658,7 +1670,7 @@ func (app *App) WireICS20PreWasmKeeper(
app.Ics20WasmHooks = &wasmHooks
app.HooksICS4Wrapper = ibchooks.NewICS4Middleware(
app.IBCKeeper.ChannelKeeper,
app.PFMKeeper,
app.IBCKeeper.ChannelKeeper,
&wasmHooks,
)

Expand Down

0 comments on commit 30f6557

Please sign in to comment.