cosmos-sdk/proto/ibc/lightclients/tendermint/v1/tendermint.proto

112 lines
5.6 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package ibc.lightclients.tendermint.v1;
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/light-clients/07-tendermint/types";
import "tendermint/types/validator.proto";
import "tendermint/types/types.proto";
import "confio/proofs.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "ibc/core/client/v1/client.proto";
import "ibc/core/commitment/v1/commitment.proto";
import "gogoproto/gogo.proto";
// ClientState from Tendermint tracks the current validator set, latest height,
// and a possible frozen height.
message ClientState {
option (gogoproto.goproto_getters) = false;
string chain_id = 1;
Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""];
// duration of the period since the LastestTimestamp during which the
// submitted headers are valid for upgrade
google.protobuf.Duration trusting_period = 3
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""];
// duration of the staking unbonding period
google.protobuf.Duration unbonding_period = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "yaml:\"unbonding_period\""
];
// defines how much new (untrusted) header's Time can drift into the future.
google.protobuf.Duration max_clock_drift = 5
[(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""];
// Block height when the client was frozen due to a misbehaviour
ibc.core.client.v1.Height frozen_height = 6
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""];
// Latest height the client was updated to
ibc.core.client.v1.Height latest_height = 7
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""];
// Proof specifications used in verifying counterparty state
repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""];
Implement ADR 026 (#7029) * Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd * 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto 2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen' 3) Add Expired() function * Fix tests * 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus 2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus * Cosmetic changes * Fix tests * Add Unfreeze function * Add new ClientUpdateProposal type * Add minor fixes * Add NewClientUpdateProposalHandler unit tests * Fix proto-lint-docker * Delete x/ibc/07-tendermint/tendermint_test.go * Follow convention to put signer last in msg function signature * 1) Add GetLatestTimestamp function to ClientStatus interface 2) Change Expired() signature to Expired(now time.Time) * 1) Add override flag to UpdateClient function 2) Fix tests * Refactor HandleClientUpdateProposal * 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods 2) Move ClientUpdateProposal message to from ibc.proto to client.proto 3) Refactoring code 4) Add override flag to UpdateClient method 5) Fix tests * 1) Uncomment tests and clean up code 2) Add basic validation of the header (ValidateBasic) when the override flag is true * Cosmetic changes * Add TODO comments * Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding * Fix proto comments * Fix override logic * undo gettimestamp for solo machine and localhost * add update after proposal func, some major refactoring in progress, various issues addressed * fix tendermint proposal update handling * run make proto-gen * remove timestamp from tendemint client * fix build issue for tm types * apply various review comments * add tests for 02-client functionality * self review fixes * typo * update tests slightly * update tendermint proposal handling tests * Update x/ibc/02-client/keeper/proposal.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * apply most of @fedekunze and some of @AdityaSripal suggestions * convert test to bools * update docs and increase code cov * fix build * fix typo, remove omitempty * add switch * apply @fedekunze latest suggestions * fix lint * Update x/ibc/02-client/keeper/proposal_test.go Co-authored-by: Christopher Goes <cwgoes@pluranimity.org> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Colin Axner <colinaxner@berkeley.edu> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-04 13:59:22 -07:00
// Path at which next upgraded client will be committed.
// Each element corresponds to the key for a single CommitmentProof in the chained proof.
// NOTE: ClientState must stored under `{upgradePath}/{upgradeHeight}/clientState`
// ConsensusState must be stored under `{upgradepath}/{upgradeHeight}/consensusState`
// For SDK chains using the default upgrade module, upgrade_path should be []string{"upgrade", "upgradedIBCState"}`
repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""];
Implement ADR 026 (#7029) * Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd * 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto 2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen' 3) Add Expired() function * Fix tests * 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus 2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus * Cosmetic changes * Fix tests * Add Unfreeze function * Add new ClientUpdateProposal type * Add minor fixes * Add NewClientUpdateProposalHandler unit tests * Fix proto-lint-docker * Delete x/ibc/07-tendermint/tendermint_test.go * Follow convention to put signer last in msg function signature * 1) Add GetLatestTimestamp function to ClientStatus interface 2) Change Expired() signature to Expired(now time.Time) * 1) Add override flag to UpdateClient function 2) Fix tests * Refactor HandleClientUpdateProposal * 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods 2) Move ClientUpdateProposal message to from ibc.proto to client.proto 3) Refactoring code 4) Add override flag to UpdateClient method 5) Fix tests * 1) Uncomment tests and clean up code 2) Add basic validation of the header (ValidateBasic) when the override flag is true * Cosmetic changes * Add TODO comments * Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding * Fix proto comments * Fix override logic * undo gettimestamp for solo machine and localhost * add update after proposal func, some major refactoring in progress, various issues addressed * fix tendermint proposal update handling * run make proto-gen * remove timestamp from tendemint client * fix build issue for tm types * apply various review comments * add tests for 02-client functionality * self review fixes * typo * update tests slightly * update tendermint proposal handling tests * Update x/ibc/02-client/keeper/proposal.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * apply most of @fedekunze and some of @AdityaSripal suggestions * convert test to bools * update docs and increase code cov * fix build * fix typo, remove omitempty * add switch * apply @fedekunze latest suggestions * fix lint * Update x/ibc/02-client/keeper/proposal_test.go Co-authored-by: Christopher Goes <cwgoes@pluranimity.org> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Colin Axner <colinaxner@berkeley.edu> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-04 13:59:22 -07:00
// This flag, when set to true, will allow governance to recover a client
// which has expired
bool allow_update_after_expiry = 10 [(gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""];
Implement ADR 026 (#7029) * Add allow_governance_override_after_expiry flag to tendermint NewCreateClientCmd * 1) Add LatestTimestamp to ClientState struct by adding a new attribute latest_timestamp to the message ClientState in proto/ibc/tendermint/tendermint.proto 2) Autogenerate x/ibc/07-tendermint/types/tendermint.pb.go by running 'make proto-gen'. Strangely, as a side effect x/distribution/types/genesis.pb.go, x/evidence/types/genesis.pb.go were also modified by the command 'make proto-gen' 3) Add Expired() function * Fix tests * 1) Add allow_governance_override_after_expiry flag to tendemint clientStatus 2) Add allow_governance_override_after_misbehaviour flag to tendermint ClientStatus * Cosmetic changes * Fix tests * Add Unfreeze function * Add new ClientUpdateProposal type * Add minor fixes * Add NewClientUpdateProposalHandler unit tests * Fix proto-lint-docker * Delete x/ibc/07-tendermint/tendermint_test.go * Follow convention to put signer last in msg function signature * 1) Add GetLatestTimestamp function to ClientStatus interface 2) Change Expired() signature to Expired(now time.Time) * 1) Add override flag to UpdateClient function 2) Fix tests * Refactor HandleClientUpdateProposal * 1) Extend exported Header interface with MarshalBinaryBare and UnmarshalBinaryBare methods 2) Move ClientUpdateProposal message to from ibc.proto to client.proto 3) Refactoring code 4) Add override flag to UpdateClient method 5) Fix tests * 1) Uncomment tests and clean up code 2) Add basic validation of the header (ValidateBasic) when the override flag is true * Cosmetic changes * Add TODO comments * Fix header MarshalBinaryBare, UnmarshalBinaryBare by using protobuf encoding/decoding * Fix proto comments * Fix override logic * undo gettimestamp for solo machine and localhost * add update after proposal func, some major refactoring in progress, various issues addressed * fix tendermint proposal update handling * run make proto-gen * remove timestamp from tendemint client * fix build issue for tm types * apply various review comments * add tests for 02-client functionality * self review fixes * typo * update tests slightly * update tendermint proposal handling tests * Update x/ibc/02-client/keeper/proposal.go Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * Update x/ibc/07-tendermint/types/proposal_handle.go Co-authored-by: Aditya <adityasripal@gmail.com> * apply most of @fedekunze and some of @AdityaSripal suggestions * convert test to bools * update docs and increase code cov * fix build * fix typo, remove omitempty * add switch * apply @fedekunze latest suggestions * fix lint * Update x/ibc/02-client/keeper/proposal_test.go Co-authored-by: Christopher Goes <cwgoes@pluranimity.org> Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: Colin Axner <colinaxner@berkeley.edu> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: Aditya <adityasripal@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-09-04 13:59:22 -07:00
// This flag, when set to true, will allow governance to unfreeze a client
// whose chain has experienced a misbehaviour event
bool allow_update_after_misbehaviour = 11 [(gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""];
}
// ConsensusState defines the consensus state from Tendermint.
message ConsensusState {
option (gogoproto.goproto_getters) = false;
// timestamp that corresponds to the block height in which the ConsensusState
// was stored.
google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
// commitment root (i.e app hash)
ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false];
bytes next_validators_hash = 3 [
(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes",
(gogoproto.moretags) = "yaml:\"next_validators_hash\""
];
}
// Misbehaviour is a wrapper over two conflicting Headers
// that implements Misbehaviour interface expected by ICS-02
message Misbehaviour {
option (gogoproto.goproto_getters) = false;
string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""];
Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""];
Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""];
}
// Header defines the Tendermint client consensus Header.
// It encapsulates all the information necessary to update from a trusted
// Tendermint ConsensusState. The inclusion of TrustedHeight and
// TrustedValidators allows this update to process correctly, so long as the
// ConsensusState for the TrustedHeight exists, this removes race conditions
// among relayers The SignedHeader and ValidatorSet are the new untrusted update
// fields for the client. The TrustedHeight is the height of a stored
// ConsensusState on the client that will be used to verify the new untrusted
// header. The Trusted ConsensusState must be within the unbonding period of
// current time in order to correctly verify, and the TrustedValidators must
// hash to TrustedConsensusState.NextValidatorsHash since that is the last
// trusted validator set at the TrustedHeight.
message Header {
.tendermint.types.SignedHeader signed_header = 1
[(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""];
.tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""];
ibc.core.client.v1.Height trusted_height = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""];
.tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""];
}
// Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values.
message Fraction {
uint64 numerator = 1;
uint64 denominator = 2;
}