Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out Message events before calling submessage response #448

Closed
alpe opened this issue Mar 10, 2021 · 5 comments · Fixed by #581
Closed

Filter out Message events before calling submessage response #448

alpe opened this issue Mar 10, 2021 · 5 comments · Fixed by #581
Labels
enhancement New feature or request events
Milestone

Comments

@alpe
Copy link
Contributor

alpe commented Mar 10, 2021

Follow up from #441 (comment)

@alpe alpe added the enhancement New feature or request label Mar 10, 2021
@alpe alpe added this to the v0.17.0 milestone Mar 10, 2021
@ethanfrey
Copy link
Member

I actually depend on the message event from submessage being present in the reply: https://github.com/CosmWasm/cosmwasm/blob/main/contracts/ibc-reflect/src/contract.rs#L39-L94

I didn't know a more reliable way to get the contract address from a newly created contract

@alpe
Copy link
Contributor Author

alpe commented May 7, 2021

The Instantiate method returns the address but it is in a protobuf type: https://github.com/CosmWasm/wasmd/blob/v0.16.0/x/wasm/keeper/msg_server.go#L72

@ethanfrey
Copy link
Member

Let's find a good solution to the ibc-reflect contract before changing this in wasmd.

@ethanfrey
Copy link
Member

I have seen TerraSwap parses the InstantiateMsg data field. I can also hand-write a parser that doesn't involve prost/protobuf library. We should add something like this to cosmwasm-std as a utility.

@ethanfrey
Copy link
Member

I think we also need a larger discussion about Events. There are 2 usages of Events now - for reply and to return to clients. Do we need the same rules for both of them?

Also, many of our rules are to work around the fact that Tendermint would flatten them, so all wasm type events get merged into one (appending the attributes) rather than as separate events. This is fixed on master (targetted for Tendermint 0.35, which is likely Cosmos SDK 0.44).

So, I would like to remove workarounds inspired by the poor Tendermint behavior in the API we expose to contracts, which should be stable. That is - reply message body. I would like to choose a design for reply that works great for contracts. We can then filter/mangle the events we return to the client if it needs to be different. That said, I would not filter out any info inside the keeper for reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request events
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants