Add message and rpc handler to upgrade clients using v1 governance proposals #3673
Closed
5 tasks done
Labels
02-client
change: api breaking
Issues or PRs that break Go API (need to be release in a new major version)
Milestone
Part of #1282.
Point for discussion: in #1282 @colin-axner mentions that one benefit for us to move to governance v1 proposal issimplifying UpgradeProposal (currently wraps calls to x/upgrade), an IBC chain upgrade could simply be combined with a x/upgrade message
. I couldn't figure out a way to completely remove the dependency to the upgrade keeper, but I am open to discuss this to see if there's a way to do it. For now, the proposal here still uses the upgrade keeper in the same way as it is used currently inHandleUpgradeProposal
.Overview of changes:
Protobuf
MsgService
. Something like this:where
MsgScheduleIBCUpgrade
could look like this:and
MsgScheduleIBCUpgradeResponse
can be empty:02-client
ScheduleIBCUpgrade
to 02-client keeper with logic to store the upgraded client state. The signature of the function could look like this:ScheduleIBCUpgrade
, which could be in a few things similar toHandleUpgradeProposal
's implementation. For example:Comparing with the existing implementation of
HandleUpgradeProposal
, the pseudocode above still depends on the upgrade keeper to schedule and set the upgraded client. Removing completely the dependency seems difficult at the moment, even if a client upgrade governance v1 proposal could execute two messages, one being the message added in this issue and another one SDK'sMsgSoftwareUpgrade
. WithMsgSoftwareUpgrade
the SDK can take care of scheduling the upgrade (i.e. executing call to upgrade keeperScheduleUpgrade
), but it would not handle the call toSetUpgradedClient
, which we would still need to take care of ourselves. And sinceSetUpgradedClient
requires the plan height, then I am not sure if it is really worth it to require governance to execute two different messages... But I am looking forward to discussing alternatives to do things better here.sdk.Msg
interface forMsgScheduleIBCUpgrade
.Core
ScheduleIBCUpgrade
rpc handler in IBC coremsg_server.go
(modules/core/keeper/msg_server.go
). The signature of the handler could look like this:and the implementation could look like this:
&MsgScheduleIBCUpgrade{}
as input toRegisterImplementations
.CLI
NewCmdSubmitScheduleIBCUpgradeProposal
) in 02-client with flagschedule-ibc-upgrade
and parametersname
,height
andpath/to/upgraded_client_state.json
to construct aMsgScheduleIBCUpgrade
and include it in aMsgSubmitProposal
. Use v1beta1 legacyNewCmdSubmitUpgradeProposal
command and SDK'sNewCmdSubmitUpgradeProposal
as examples.Documentation
Break up the implementation in multiple PRs. One possible suggestion:
The text was updated successfully, but these errors were encountered: