-
Notifications
You must be signed in to change notification settings - Fork 335
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
Reply
should contain the original payload from the triggering SubMsg
#1909
Comments
Agreed. I think there should be a generic data field (maybe with a better name) that allows any custom data to be communicated from the origin of the submessage to the reply.
Can't you have a Map from submessage ID -> Context to achieve that? |
In my particular case I’m already using the submsg id to represent the variant of the original calling message. I think perhaps the best way to solve this problem is the sub message id should just be changed to sub msg data sort of like you were suggesting. I see no reason to keep both fields around. |
The advantage of having an I think such a feature can avoid a lot of
flows for cases in which you only need temporary data to be copied from original execution to the reply call. |
Backwards compatibility is the strongest point for keeping it around I think! But yes having a data field would absolutely be incredibly useful. |
I think at this point it's just a matter of giving the field the right name. What about memo ;) Is type |
Yeah I think Binary is the correct choice given that it's already a standard.I actually prefer |
The issue with "data" is that we have |
Then I would go with |
I think we can go with |
Is 1 KiB per
We could leave it up to deserialization gas alone but it probably helps contract devs to know how much data they can assume to work. |
1KiB seems a touch small to me. I think there would be many valid use cases that would exceed that. What are the limits on other messages? Do execute messages have a limit for example? As a user I would probably expect never to run into a limit here. What abuse do imagine is possible if we we're to increase this limit to something like 10KiB? As long as the callers are still required to pay gas, I don't see the upside in creating a small message size limit. |
There is a global read limit on the entire contract output (unparsed) of 64 MiB. This is then further limited by the JSON deserializer gas cost in wasmvm which should kick in much earlier (deault is 1 gas/byte). Now I'm not conviced if a limit is desirable at all. I was thinking that predictable behaviour on all systems is better than whatever gas meter allows, which can change over time. But I also don't see how a very large field could harm the system. |
I think we can just add a generous limit of 128 KiB and leave everything else to the gas meter. This is the same max amount you can write in a database entry with CosmWasm. This should avoid resource abuse attempts that might disrupt the block execution. |
Could you check the PR in #2008? |
Motivation
We want to send a ReplyAlways SubMsg. If and only if that message fails, we want to send a different message with the same context.
The first message has the payload
ExecuteMsg::TryThis{ important_context: Context }
.If and only if that message fails, then we want to retry with an alternative
ExecuteMsg::TryThisInstead{ same_context: Context }
.Currently there is no way to accomplish this as far as I can tell. If
TryThis
fails, then the context in which it was called is no longer around in the reply. We could try a hack and store the context to storage before we send either message, but that only works if we are sending one instance ofTryThis
+ maybeTryThisInstead
. If we are sending multiple instances then that isn't possible.The text was updated successfully, but these errors were encountered: