CosmWasm / cosmwasm

Framework for building smart contracts in Wasm for the Cosmos SDK

Home Page:https://www.cosmwasm.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No events are given to reply from other than wasm submsg

loloicci opened this issue · comments

The comment

/// with full Cosmos SDK events.
(SubMsgResponse is a field of Reply) says this contains all the SDK events.
However, x/wasm discards events from other than wasm submsg in https://github.com/CosmWasm/wasmd/blob/07c8beea006cd009e0c7b865fb32753f61221e1b/x/wasm/keeper/msg_dispatcher.go#L117 and this is passed to reply in https://github.com/CosmWasm/wasmd/blob/07c8beea006cd009e0c7b865fb32753f61221e1b/x/wasm/keeper/msg_dispatcher.go#L147.

Is it intentional? And if it is, I think the reason should be written in spec and cosmwasm's comment for SubMsgResponse.

Thank you for bringing this up. The filtering was added for good reason (which I do not know in detail at this point). We'll update the docs to highlight this. Moving to the cosmwasm repo.

Thank you @webmaster128 for your reply and for updating the docs! If you know who knows this well, could you give this question or tell this ISSUE to them?

This leads to the fact that we charge gas for the attributes but not the events here:
https://github.com/CosmWasm/wasmd/blob/09c49d81d38990d232080069b9804af35d68a1b0/x/wasm/keeper/gas_register.go#L200-L211

What are the reasons for this behavior? If we filter events, should we also filter out their attributes?