-
Notifications
You must be signed in to change notification settings - Fork 199
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
Submessages drop data #1323
Comments
Looks like you are right or at least it is what I can also understand from the documentation you've sent. I'll open an internal issue for us to be able to track this and fix it as soon as we can. |
No it's not blocking me. But, it's just led to confusion in during development because the behavior doesn't match the documentation. It's the second time I've ran into inconsistencies in submessage behavior compared to other chains, I tried bringing it up the last time I ran into an issue |
For sure, sorry missed it, will totally have this fixed as soon as possible |
It doesn't currently actually return the migration secret in the data but it technically should, and will after this issue is fixed: scrtlabs/SecretNetwork#1323 (comment)
Side note: the issue I brought up in that documentation pr is slightly different but related. When reply is called on success of an instantiate submessage |
Just tested it again in a different scenario with the same result: Localsecret logs where I create a submessage to instantiating a contract where I set data I want available in the reply function:
Localsecret logs after instantiating the contract. The contract sets no data:
Localsecret debug print where I log msg.reply.result
Basically, the data I set that in the first message that I wanted available in Reply isn't there. |
This seems like the issue to me:
It always just picks the first |
a hack to workaround scrtlabs/SecretNetwork#1323 Useful when you want to instantiate this contract and return data back to the calling contract that is available in the Reply
a hack to workaround scrtlabs/SecretNetwork#1323 the workaround: eqoty-labs/snip721-reference-impl@5ae22b4
a hack to workaround scrtlabs/SecretNetwork#1323 Useful when you want to instantiate this contract and return data back to the calling contract that is available in the Reply
Thanks for this! My concern right now is that existing contracts might rely on the faulty behavior already and in that case they'll stop functioning properly after we fix this. |
Yeah that's definitely a concern. Also, I haven't checked if other chains have this issue.. but I suspect they do as well since standard wasmd has the same implementation... unless as I mentioned other chains make sure to not add empty data arrays to |
Also another concern is that contracts might leak data they didn't mean to return to the user if their contract doesn't explicitly clear the data as the documentation says you should in the result of the last thing that a contract call returns |
I would not rely that much on the CosmWasm docs, as they had been recently deprecated. It would be amazing if you could test this behavior on a vanilla CosmWasm chain and see if it behaves differently. We forked their implementation, but had to modify behaviors a bit in order for it to play nice with our encryption protocol. |
a hack to workaround scrtlabs/SecretNetwork#1323 Useful when you want to instantiate this contract and return data back to the calling contract that is available in the Reply
I might be miss-understanding something. But, I think the behavior of returned data is different than the cosmwasm semantics specify they should behave here handling-the-reply:
Imagine the scenario where you execute a transaction on contract A that returns a response with a submessage for contract B and sets no data. Then the submessage gets executed in contract B and sets some data in its own response. Then finally back in contract A,
reply
is called and it reads and handles the data set by contract B, and returns a response which does not set any data of its own. Finally the transaction is completed and the caller gets the transaction result.According to the cosmwasm semantics in this scenario, from what I understand, the data set by contract B should be returned to the caller in the transaction result since it never gets overwritten by any subsequent responses.
But that is not what happens. The final result would just be data which is empty.
Tested on v1.5.1-patch.3
The text was updated successfully, but these errors were encountered: