From cc9a354a5be4a83b2b2cfcfe7da5d0283d7d98be Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Thu, 22 Jun 2023 12:57:18 -0700 Subject: [PATCH] moved shiz --- .../ccv/consumer/v1/consumer.proto | 60 --------- .../ccv/consumer/v1/genesis.proto | 36 ------ .../ccv/provider/v1/genesis.proto | 4 +- .../ccv/v1/shared_consumer.proto | 118 ++++++++++++++++++ 4 files changed, 121 insertions(+), 97 deletions(-) create mode 100644 proto/interchain_security/ccv/v1/shared_consumer.proto diff --git a/proto/interchain_security/ccv/consumer/v1/consumer.proto b/proto/interchain_security/ccv/consumer/v1/consumer.proto index 2f08aefd56..6ede514efe 100644 --- a/proto/interchain_security/ccv/consumer/v1/consumer.proto +++ b/proto/interchain_security/ccv/consumer/v1/consumer.proto @@ -11,66 +11,6 @@ import "cosmos_proto/cosmos.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -// Params defines the parameters for CCV consumer module. -// -// Note this type is referenced in both the consumer and provider CCV modules, -// and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -message Params { - // TODO: Remove enabled flag and find a better way to setup integration tests - // See: https://github.com/cosmos/interchain-security/issues/339 - bool enabled = 1; - - /////////////////////// - // Distribution Params - // Number of blocks between ibc-token-transfers from the consumer chain to - // the provider chain. Note that at this transmission event a fraction of - // the accumulated tokens are divided and sent consumer redistribution - // address. - int64 blocks_per_distribution_transmission = 2; - - // Channel, and provider-chain receiving address to send distribution token - // transfers over. These parameters is auto-set during the consumer <-> - // provider handshake procedure. - string distribution_transmission_channel = 3; - string provider_fee_pool_addr_str = 4; - // Sent CCV related IBC packets will timeout after this duration - google.protobuf.Duration ccv_timeout_period = 5 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - // Sent transfer related IBC packets will timeout after this duration - google.protobuf.Duration transfer_timeout_period = 6 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - // The fraction of tokens allocated to the consumer redistribution address - // during distribution events. The fraction is a string representing a - // decimal number. For example "0.75" would represent 75%. - string consumer_redistribution_fraction = 7; - - // The number of historical info entries to persist in store. - // This param is a part of the cosmos sdk staking module. In the case of - // a ccv enabled consumer chain, the ccv module acts as the staking module. - int64 historical_entries = 8; - - // Unbonding period for the consumer, - // which should be smaller than that of the provider in general. - google.protobuf.Duration unbonding_period = 9 - [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; - - // The threshold for the percentage of validators at the bottom of the set who - // can opt out of running the consumer chain without being punished. For - // example, a value of 0.05 means that the validators in the bottom 5% of the - // set can opt out - string soft_opt_out_threshold = 10; - - // Reward denoms. These are the denominations which are allowed to be sent to - // the provider as rewards. - repeated string reward_denoms = 11; - - // Provider-originated reward denoms. These are denoms coming from the - // provider which are allowed to be used as rewards. e.g. "uatom" - repeated string provider_reward_denoms = 12; -} - // LastTransmissionBlockHeight is the last time validator holding // pools were transmitted to the provider chain. // diff --git a/proto/interchain_security/ccv/consumer/v1/genesis.proto b/proto/interchain_security/ccv/consumer/v1/genesis.proto index 463fe63b53..7c9bb0d9e2 100644 --- a/proto/interchain_security/ccv/consumer/v1/genesis.proto +++ b/proto/interchain_security/ccv/consumer/v1/genesis.proto @@ -12,42 +12,6 @@ import "ibc/core/channel/v1/channel.proto"; import "google/protobuf/duration.proto"; import "gogoproto/gogo.proto"; -// GenesisState defines the CCV consumer chain genesis state -// -// Note this type is referenced in both the consumer and provider CCV modules, -// and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - string provider_client_id = 2; // empty for a new chain, filled in on restart. - string provider_channel_id = - 3; // empty for a new chain, filled in on restart. - bool new_chain = - 4; // true for new chain GenesisState, false for chain restart. - // ProviderClientState filled in on new chain, nil on restart. - ibc.lightclients.tendermint.v1.ClientState provider_client_state = 5; - // ProviderConsensusState filled in on new chain, nil on restart. - ibc.lightclients.tendermint.v1.ConsensusState provider_consensus_state = 6; - // MaturingPackets nil on new chain, filled in on restart. - repeated interchain_security.ccv.consumer.v1.MaturingVSCPacket - maturing_packets = 7 [ (gogoproto.nullable) = false ]; - // InitialValset filled in on new chain and on restart. - repeated .tendermint.abci.ValidatorUpdate initial_val_set = 8 - [ (gogoproto.nullable) = false ]; - // HeightToValsetUpdateId nil on new chain, filled in on restart. - repeated HeightToValsetUpdateID height_to_valset_update_id = 9 - [ (gogoproto.nullable) = false ]; - // OutstandingDowntimes nil on new chain, filled in on restart. - repeated OutstandingDowntime outstanding_downtime_slashing = 10 - [ (gogoproto.nullable) = false ]; - // PendingConsumerPackets nil on new chain, filled in on restart. - interchain_security.ccv.v1.ConsumerPacketDataList pending_consumer_packets = - 11 [ (gogoproto.nullable) = false ]; - // LastTransmissionBlockHeight nil on new chain, filled in on restart. - interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight - last_transmission_block_height = 12 [ (gogoproto.nullable) = false ]; - bool preCCV = 13; // flag indicating whether the consumer CCV module starts in - // pre-CCV state -} // HeightValsetUpdateID represents a mapping internal to the consumer CCV module // which links a block height to each recv valset update id. diff --git a/proto/interchain_security/ccv/provider/v1/genesis.proto b/proto/interchain_security/ccv/provider/v1/genesis.proto index e1f6ab2e1a..ff1d26e853 100644 --- a/proto/interchain_security/ccv/provider/v1/genesis.proto +++ b/proto/interchain_security/ccv/provider/v1/genesis.proto @@ -46,7 +46,9 @@ message GenesisState { [ (gogoproto.nullable) = false ]; } -// consumer chain +// The provider CCV module's knowledge of consumer state. +// +// Note this type is only used internally to the provider CCV module. message ConsumerState { // ChainID defines the chain ID for the consumer chain string chain_id = 1; diff --git a/proto/interchain_security/ccv/v1/shared_consumer.proto b/proto/interchain_security/ccv/v1/shared_consumer.proto new file mode 100644 index 0000000000..c11959a002 --- /dev/null +++ b/proto/interchain_security/ccv/v1/shared_consumer.proto @@ -0,0 +1,118 @@ +syntax = "proto3"; + +package interchain_security.ccv.v1; + +option go_package = "github.com/cosmos/interchain-security/v3/x/ccv/types"; + +import "interchain_security/ccv/consumer/v1/consumer.proto"; +import "tendermint/abci/types.proto"; +import "ibc/lightclients/tendermint/v1/tendermint.proto"; +import "ibc/core/channel/v1/channel.proto"; +import "google/protobuf/duration.proto"; +import "gogoproto/gogo.proto"; + +// +// Note any type defined in this file is referenced/persisted in both the consumer and provider CCV modules, +// but not sent over the wire. These schemas could change, only with careful consideration of effects! +// + +// TODO: rename to ConsumerParams (make issue) +// +// Params defines the parameters for CCV consumer module. +// +// Note this type is referenced in both the consumer and provider CCV modules, +// and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. +message Params { + // TODO: Remove enabled flag and find a better way to setup integration tests + // See: https://github.com/cosmos/interchain-security/issues/339 + bool enabled = 1; + + /////////////////////// + // Distribution Params + // Number of blocks between ibc-token-transfers from the consumer chain to + // the provider chain. Note that at this transmission event a fraction of + // the accumulated tokens are divided and sent consumer redistribution + // address. + int64 blocks_per_distribution_transmission = 2; + + // Channel, and provider-chain receiving address to send distribution token + // transfers over. These parameters is auto-set during the consumer <-> + // provider handshake procedure. + string distribution_transmission_channel = 3; + string provider_fee_pool_addr_str = 4; + // Sent CCV related IBC packets will timeout after this duration + google.protobuf.Duration ccv_timeout_period = 5 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // Sent transfer related IBC packets will timeout after this duration + google.protobuf.Duration transfer_timeout_period = 6 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // The fraction of tokens allocated to the consumer redistribution address + // during distribution events. The fraction is a string representing a + // decimal number. For example "0.75" would represent 75%. + string consumer_redistribution_fraction = 7; + + // The number of historical info entries to persist in store. + // This param is a part of the cosmos sdk staking module. In the case of + // a ccv enabled consumer chain, the ccv module acts as the staking module. + int64 historical_entries = 8; + + // Unbonding period for the consumer, + // which should be smaller than that of the provider in general. + google.protobuf.Duration unbonding_period = 9 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // The threshold for the percentage of validators at the bottom of the set who + // can opt out of running the consumer chain without being punished. For + // example, a value of 0.05 means that the validators in the bottom 5% of the + // set can opt out + string soft_opt_out_threshold = 10; + + // Reward denoms. These are the denominations which are allowed to be sent to + // the provider as rewards. + repeated string reward_denoms = 11; + + // Provider-originated reward denoms. These are denoms coming from the + // provider which are allowed to be used as rewards. e.g. "uatom" + repeated string provider_reward_denoms = 12; +} + +// TODO: rename to ConsumerGenesisState (make issue) +// +// GenesisState defines the CCV consumer chain genesis state. +// +// Note this type is referenced in both the consumer and provider CCV modules, +// and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + string provider_client_id = 2; // empty for a new chain, filled in on restart. + string provider_channel_id = + 3; // empty for a new chain, filled in on restart. + bool new_chain = + 4; // true for new chain GenesisState, false for chain restart. + // ProviderClientState filled in on new chain, nil on restart. + ibc.lightclients.tendermint.v1.ClientState provider_client_state = 5; + // ProviderConsensusState filled in on new chain, nil on restart. + ibc.lightclients.tendermint.v1.ConsensusState provider_consensus_state = 6; + // MaturingPackets nil on new chain, filled in on restart. + repeated interchain_security.ccv.consumer.v1.MaturingVSCPacket + maturing_packets = 7 [ (gogoproto.nullable) = false ]; + // InitialValset filled in on new chain and on restart. + repeated .tendermint.abci.ValidatorUpdate initial_val_set = 8 + [ (gogoproto.nullable) = false ]; + // HeightToValsetUpdateId nil on new chain, filled in on restart. + repeated HeightToValsetUpdateID height_to_valset_update_id = 9 + [ (gogoproto.nullable) = false ]; + // OutstandingDowntimes nil on new chain, filled in on restart. + repeated OutstandingDowntime outstanding_downtime_slashing = 10 + [ (gogoproto.nullable) = false ]; + // PendingConsumerPackets nil on new chain, filled in on restart. + interchain_security.ccv.v1.ConsumerPacketDataList pending_consumer_packets = + 11 [ (gogoproto.nullable) = false ]; + // LastTransmissionBlockHeight nil on new chain, filled in on restart. + interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight + last_transmission_block_height = 12 [ (gogoproto.nullable) = false ]; + bool preCCV = 13; // flag indicating whether the consumer CCV module starts in + // pre-CCV state +}