Skip to main content
logo

upgrade

The upgrade module is responsible for handling and coordinating software upgrades. It accomplishes this by providing a BeginBlocker hook that prevents the blockchain state machine from proceeding once a pre-defined upgrade block height has been reached.

For more information, visit https://docs.cosmos.network/main/modules/upgrade/

Message Types

Msg defines the upgrade Msg service.

tx.proto
Copy

_11
service Msg {
_11
// SoftwareUpgrade is a governance operation for initiating a software upgrade.
_11
//
_11
// Since: cosmos-sdk 0.46
_11
rpc SoftwareUpgrade(MsgSoftwareUpgrade) returns (MsgSoftwareUpgradeResponse);
_11
// CancelUpgrade is a governance operation for cancelling a previously
_11
// approvid software upgrade.
_11
//
_11
// Since: cosmos-sdk 0.46
_11
rpc CancelUpgrade(MsgCancelUpgrade) returns (MsgCancelUpgradeResponse);
_11
}

MsgSoftwareUpgrade

MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type.

Since: cosmos-sdk 0.46

tx.proto
Copy

_9
message MsgSoftwareUpgrade {
_9
option (cosmos.msg.v1.signer) = "authority";
_9
_9
// authority is the address of the governance account.
_9
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_9
_9
// plan is the upgrade plan.
_9
Plan plan = 2 [(gogoproto.nullable) = false];
_9
}

MsgSoftwareUpgradeResponse

MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type.

Since: cosmos-sdk 0.46

tx.proto
Copy

_1
message MsgSoftwareUpgradeResponse {}

MsgCancelUpgrade

MsgCancelUpgrade is the Msg/CancelUpgrade request type. Since: cosmos-sdk 0.46

tx.proto
Copy

_6
message MsgCancelUpgrade {
_6
option (cosmos.msg.v1.signer) = "authority";
_6
_6
// authority is the address of the governance account.
_6
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_6
}

MsgCancelUpgradeResponse

MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type.

Since: cosmos-sdk 0.46

tx.proto
Copy

_1
message MsgCancelUpgradeResponse {}

Queries

Query defines the gRPC upgrade querier service.

query.proto
Copy

_34
service Query {
_34
// CurrentPlan queries the current upgrade plan.
_34
rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) {
_34
option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan";
_34
}
_34
_34
// AppliedPlan queries a previously applied upgrade plan by its name.
_34
rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) {
_34
option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}";
_34
}
_34
_34
// UpgradedConsensusState queries the consensus state that will serve
_34
// as a trusted kernel for the next version of this chain. It will only be
_34
// stored at the last height of this chain.
_34
// UpgradedConsensusState RPC not supported with legacy querier
_34
// This rpc is deprecated now that IBC has its own replacement
_34
// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54)
_34
rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) {
_34
option deprecated = true;
_34
option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}";
_34
}
_34
_34
// ModuleVersions queries the list of module versions from state.
_34
//
_34
// Since: cosmos-sdk 0.43
_34
rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) {
_34
option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions";
_34
}
_34
_34
// Returns the account with authority to conduct upgrades
_34
rpc Authority(QueryAuthorityRequest) returns (QueryAuthorityResponse) {
_34
option (google.api.http).get = "/cosmos/upgrade/v1beta1/authority";
_34
}
_34
}

QueryCurrentPlanRequest

QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC method.

query.proto
Copy

_1
message QueryCurrentPlanRequest {}

QueryCurrentPlanResponse

QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC method.

query.proto
Copy

_4
message QueryCurrentPlanResponse {
_4
// plan is the current upgrade plan.
_4
Plan plan = 1;
_4
}

QueryAppliedPlanRequest

QueryAppliedPlanRequest is the request type for the Query/AppliedPlan RPC method.

query.proto
Copy

_4
message QueryAppliedPlanRequest {
_4
// name is the name of the applied plan to query for.
_4
string name = 1;
_4
}

QueryAppliedPlanResponse

QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC method.

query.proto
Copy

_4
message QueryAppliedPlanResponse {
_4
// height is the block height at which the plan was applied.
_4
int64 height = 1;
_4
}

QueryUpgradedConsensusStateRequest

QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState RPC method.

query.proto
Copy

_7
message QueryUpgradedConsensusStateRequest {
_7
option deprecated = true;
_7
_7
// last height of the current chain must be sent in request
_7
// as this is the height under which next consensus state is stored
_7
int64 last_height = 1;
_7
}

QueryUpgradedConsensusStateResponse

QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState RPC method.

query.proto
Copy

_7
message QueryUpgradedConsensusStateResponse {
_7
option deprecated = true;
_7
reserved 1;
_7
_7
// Since: cosmos-sdk 0.43
_7
bytes upgraded_consensus_state = 2;
_7
}

QueryModuleVersionsRequest

QueryModuleVersionsRequest is the request type for the Query/ModuleVersions RPC method.

Since: cosmos-sdk 0.43

query.proto
Copy

_6
message QueryModuleVersionsRequest {
_6
// module_name is a field to query a specific module
_6
// consensus version from state. Leaving this empty will
_6
// fetch the full list of module versions from state
_6
string module_name = 1;
_6
}

QueryModuleVersionsResponse

QueryModuleVersionsResponse is the response type for the Query/ModuleVersions RPC method.

Since: cosmos-sdk 0.43

query.proto
Copy

_4
message QueryModuleVersionsResponse {
_4
// module_versions is a list of module names with their consensus versions.
_4
repeated ModuleVersion module_versions = 1;
_4
}

QueryAuthorityRequest

QueryAuthorityRequest is the request type for Query/Authority.

Since: cosmos-sdk 0.46

query.proto
Copy

_1
message QueryAuthorityRequest {}

QueryAuthorityResponse

QueryAuthorityResponse is the response type for Query/Authority.

Since: cosmos-sdk 0.46

query.proto
Copy

_3
message QueryAuthorityResponse {
_3
string address = 1;
_3
}