-
Notifications
You must be signed in to change notification settings - Fork 596
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
Consolidate channel upgrade message responses #3910
Comments
adding discussion label back, missed to talk about it in previous eng. call (see #4022 (comment)) |
Use |
Hm, this currently exists in both I guess these were added during the refactor. Will probably close after a revisit to re-check I'm not missing something. |
Yea, I think the response result can only be success in the other upgrade handlers as a failure indicates a successful tx but a failed handshake step. If we find it useful to return information about the upgrade in the resposne, I'd recommend changing the result type to string and using enums which can be updated in post release to make the other handshake steps more useful:
var (
SUCCESS_UPGRADE_INIT = "SUCCESS_UPGRADE_INIT"
SUCCESS_UPGRADE_FLUSHING = "SUCCESS_UPGRADE_FLUSHING"
SUCCESS_UPGRADE_FLUSHCOMPLETE = "SUCCESS_UPGRADE_FLUSHCOMPLETE"
SUCCESS_UPGRADE_COMPLETE = "SUCCESS_UPGRADE_COMPLETE"
FAILURE_UPGRADE_CANCELLED = " FAILURE_UPGRADE_CANCELLED"
FAILURE_COUNTERPARTY_OUT_OF_SYNC = "FAILURE_COUNTERPARTY_OUT_OF_SYNC"
) I propose a string so that we aren't tied to a specific struct. That way we can just leave the success/failure as is but update to more descriptive responses if we so choose. Just a proposal though This is similar to what I was ethereum do with one of their api's. They have a response status which is a string and then various string response values (valid, invalid, syncing) |
The result type is only non-success in TRY, ACK, CONFIRM. We can remove from timeout if we want to be conservative. I would be in favour of that (and appears to be what we previously agreed by stating it for ack and confirm). @DimitrisJim want to remove it from the timeout msg? |
Should we remove the channel id from try as well? https://github.com/cosmos/ibc-go/blob/04-channel-upgrades/proto/ibc/core/channel/v1/tx.proto#L324C1-L325C43 |
I'd be in favor of overhauling the resp type to allow for more context. It is currently used in previous handlers which would also require updating (recv, ack, timeout, timeoutonclose as far as I could tell). Opening PR now for dropping resp from timeout and channel from try resp. |
I'm calling this issue closed. I've opened a new issue for the idea I put out, but I don't think it's worth making any last minute changes for. If more descriptive result values are ever requested we can use the deprecate/new field approach |
Summary
Currently, we make use of a ResultType to indicate if a response was successful or failure as a way of making sure an error receipt is written to state and to inform the relayers that an upgrade should be cancelled.
However some other message responses don't have this field such as MsgChannelUpgradeInitResponse and MsgChannelUpgradeCancelResponse.
While they do not require the result to work, it may be a good idea to make the API consistent across all messages.
The text was updated successfully, but these errors were encountered: