ibc_proto/prost/
interchain_security.ccv.v1.rs

1// This file is @generated by prost-build.
2/// ConsumerParams defines the parameters for CCV consumer module.
3///
4/// Note this type is referenced in both the consumer and provider CCV modules,
5/// and persisted on the provider, see MakeConsumerGenesis and
6/// SetConsumerGenesis.
7///
8#[derive(Clone, PartialEq, ::prost::Message)]
9pub struct ConsumerParams {
10    /// TODO: Remove enabled flag and find a better way to setup integration tests
11    /// See: <https://github.com/cosmos/interchain-security/issues/339>
12    #[prost(bool, tag = "1")]
13    pub enabled: bool,
14    /// /////////////////////
15    /// Distribution Params
16    /// Number of blocks between ibc-token-transfers from the consumer chain to
17    /// the provider chain. Note that at this transmission event a fraction of
18    /// the accumulated tokens are divided and sent consumer redistribution
19    /// address.
20    #[prost(int64, tag = "2")]
21    pub blocks_per_distribution_transmission: i64,
22    /// Channel, and provider-chain receiving address to send distribution token
23    /// transfers over. These parameters is auto-set during the consumer <->
24    /// provider handshake procedure.
25    #[prost(string, tag = "3")]
26    pub distribution_transmission_channel: ::prost::alloc::string::String,
27    #[prost(string, tag = "4")]
28    pub provider_fee_pool_addr_str: ::prost::alloc::string::String,
29    /// Sent CCV related IBC packets will timeout after this duration
30    #[prost(message, optional, tag = "5")]
31    pub ccv_timeout_period: ::core::option::Option<
32        ::tendermint_proto::google::protobuf::Duration,
33    >,
34    /// Sent transfer related IBC packets will timeout after this duration
35    #[prost(message, optional, tag = "6")]
36    pub transfer_timeout_period: ::core::option::Option<
37        ::tendermint_proto::google::protobuf::Duration,
38    >,
39    /// The fraction of tokens allocated to the consumer redistribution address
40    /// during distribution events. The fraction is a string representing a
41    /// decimal number. For example "0.75" would represent 75%.
42    #[prost(string, tag = "7")]
43    pub consumer_redistribution_fraction: ::prost::alloc::string::String,
44    /// The number of historical info entries to persist in store.
45    /// This param is a part of the cosmos sdk staking module. In the case of
46    /// a ccv enabled consumer chain, the ccv module acts as the staking module.
47    #[prost(int64, tag = "8")]
48    pub historical_entries: i64,
49    /// Unbonding period for the consumer,
50    /// which should be smaller than that of the provider in general.
51    #[prost(message, optional, tag = "9")]
52    pub unbonding_period: ::core::option::Option<
53        ::tendermint_proto::google::protobuf::Duration,
54    >,
55    /// !!! DEPRECATED !!! soft_opt_out_threshold is deprecated. see docs/docs/adrs/adr-015-partial-set-security.md
56    #[deprecated]
57    #[prost(string, tag = "10")]
58    pub soft_opt_out_threshold: ::prost::alloc::string::String,
59    /// Reward denoms. These are the denominations which are allowed to be sent to
60    /// the provider as rewards.
61    #[prost(string, repeated, tag = "11")]
62    pub reward_denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
63    /// Provider-originated reward denoms. These are denoms coming from the
64    /// provider which are allowed to be used as rewards. e.g. "uatom"
65    #[prost(string, repeated, tag = "12")]
66    pub provider_reward_denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
67    /// The period after which a consumer can retry sending a throttled packet.
68    #[prost(message, optional, tag = "13")]
69    pub retry_delay_period: ::core::option::Option<
70        ::tendermint_proto::google::protobuf::Duration,
71    >,
72}
73impl ::prost::Name for ConsumerParams {
74    const NAME: &'static str = "ConsumerParams";
75    const PACKAGE: &'static str = "interchain_security.ccv.v1";
76    fn full_name() -> ::prost::alloc::string::String {
77        "interchain_security.ccv.v1.ConsumerParams".into()
78    }
79    fn type_url() -> ::prost::alloc::string::String {
80        "/interchain_security.ccv.v1.ConsumerParams".into()
81    }
82}
83/// ConsumerGenesisState defines shared genesis information between provider and
84/// consumer
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct ConsumerGenesisState {
87    #[prost(message, optional, tag = "1")]
88    pub params: ::core::option::Option<ConsumerParams>,
89    #[prost(message, optional, tag = "2")]
90    pub provider: ::core::option::Option<ProviderInfo>,
91    /// true for new chain, false for chain restart.
92    ///
93    /// TODO:Check if this is really needed
94    #[prost(bool, tag = "3")]
95    pub new_chain: bool,
96}
97impl ::prost::Name for ConsumerGenesisState {
98    const NAME: &'static str = "ConsumerGenesisState";
99    const PACKAGE: &'static str = "interchain_security.ccv.v1";
100    fn full_name() -> ::prost::alloc::string::String {
101        "interchain_security.ccv.v1.ConsumerGenesisState".into()
102    }
103    fn type_url() -> ::prost::alloc::string::String {
104        "/interchain_security.ccv.v1.ConsumerGenesisState".into()
105    }
106}
107/// ProviderInfo defines all information a consumer needs from a provider
108/// Shared data type between provider and consumer
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct ProviderInfo {
111    /// ProviderClientState filled in on new chain, nil on restart.
112    #[prost(message, optional, tag = "1")]
113    pub client_state: ::core::option::Option<
114        super::super::super::ibc::lightclients::tendermint::v1::ClientState,
115    >,
116    /// ProviderConsensusState filled in on new chain, nil on restart.
117    #[prost(message, optional, tag = "2")]
118    pub consensus_state: ::core::option::Option<
119        super::super::super::ibc::lightclients::tendermint::v1::ConsensusState,
120    >,
121    /// InitialValset filled in on new chain and on restart.
122    #[prost(message, repeated, tag = "3")]
123    pub initial_val_set: ::prost::alloc::vec::Vec<
124        ::tendermint_proto::abci::ValidatorUpdate,
125    >,
126}
127impl ::prost::Name for ProviderInfo {
128    const NAME: &'static str = "ProviderInfo";
129    const PACKAGE: &'static str = "interchain_security.ccv.v1";
130    fn full_name() -> ::prost::alloc::string::String {
131        "interchain_security.ccv.v1.ProviderInfo".into()
132    }
133    fn type_url() -> ::prost::alloc::string::String {
134        "/interchain_security.ccv.v1.ProviderInfo".into()
135    }
136}
137/// This packet is sent from provider chain to consumer chain if the validator
138/// set for consumer chain changes (due to new bonding/unbonding messages or
139/// slashing events) A VSCMatured packet from consumer chain will be sent
140/// asynchronously once unbonding period is over, and this will function as
141/// `UnbondingOver` message for this packet.
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct ValidatorSetChangePacketData {
144    #[prost(message, repeated, tag = "1")]
145    pub validator_updates: ::prost::alloc::vec::Vec<
146        ::tendermint_proto::abci::ValidatorUpdate,
147    >,
148    #[prost(uint64, tag = "2")]
149    pub valset_update_id: u64,
150    /// consensus address of consumer chain validators
151    /// successfully slashed on the provider chain
152    #[prost(string, repeated, tag = "3")]
153    pub slash_acks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
154}
155impl ::prost::Name for ValidatorSetChangePacketData {
156    const NAME: &'static str = "ValidatorSetChangePacketData";
157    const PACKAGE: &'static str = "interchain_security.ccv.v1";
158    fn full_name() -> ::prost::alloc::string::String {
159        "interchain_security.ccv.v1.ValidatorSetChangePacketData".into()
160    }
161    fn type_url() -> ::prost::alloc::string::String {
162        "/interchain_security.ccv.v1.ValidatorSetChangePacketData".into()
163    }
164}
165/// This packet is sent from the consumer chain to the provider chain
166/// to notify that a VSC packet reached maturity on the consumer chain.
167#[derive(Clone, Copy, PartialEq, ::prost::Message)]
168pub struct VscMaturedPacketData {
169    /// the id of the VSC packet that reached maturity
170    #[prost(uint64, tag = "1")]
171    pub valset_update_id: u64,
172}
173impl ::prost::Name for VscMaturedPacketData {
174    const NAME: &'static str = "VSCMaturedPacketData";
175    const PACKAGE: &'static str = "interchain_security.ccv.v1";
176    fn full_name() -> ::prost::alloc::string::String {
177        "interchain_security.ccv.v1.VSCMaturedPacketData".into()
178    }
179    fn type_url() -> ::prost::alloc::string::String {
180        "/interchain_security.ccv.v1.VSCMaturedPacketData".into()
181    }
182}
183/// This packet is sent from the consumer chain to the provider chain
184/// to request the slashing of a validator as a result of an infraction
185/// committed on the consumer chain.
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct SlashPacketData {
188    #[prost(message, optional, tag = "1")]
189    pub validator: ::core::option::Option<::tendermint_proto::abci::Validator>,
190    /// map to the infraction block height on the provider
191    #[prost(uint64, tag = "2")]
192    pub valset_update_id: u64,
193    /// tell if the slashing is for a downtime or a double-signing infraction
194    #[prost(
195        enumeration = "super::super::super::cosmos::staking::v1beta1::Infraction",
196        tag = "3"
197    )]
198    pub infraction: i32,
199}
200impl ::prost::Name for SlashPacketData {
201    const NAME: &'static str = "SlashPacketData";
202    const PACKAGE: &'static str = "interchain_security.ccv.v1";
203    fn full_name() -> ::prost::alloc::string::String {
204        "interchain_security.ccv.v1.SlashPacketData".into()
205    }
206    fn type_url() -> ::prost::alloc::string::String {
207        "/interchain_security.ccv.v1.SlashPacketData".into()
208    }
209}
210/// ConsumerPacketData contains a consumer packet data and a type tag
211#[derive(Clone, PartialEq, ::prost::Message)]
212pub struct ConsumerPacketData {
213    #[prost(enumeration = "ConsumerPacketDataType", tag = "1")]
214    pub r#type: i32,
215    #[prost(oneof = "consumer_packet_data::Data", tags = "2, 3")]
216    pub data: ::core::option::Option<consumer_packet_data::Data>,
217}
218/// Nested message and enum types in `ConsumerPacketData`.
219pub mod consumer_packet_data {
220    #[derive(Clone, PartialEq, ::prost::Oneof)]
221    pub enum Data {
222        #[prost(message, tag = "2")]
223        SlashPacketData(super::SlashPacketData),
224        #[prost(message, tag = "3")]
225        VscMaturedPacketData(super::VscMaturedPacketData),
226    }
227}
228impl ::prost::Name for ConsumerPacketData {
229    const NAME: &'static str = "ConsumerPacketData";
230    const PACKAGE: &'static str = "interchain_security.ccv.v1";
231    fn full_name() -> ::prost::alloc::string::String {
232        "interchain_security.ccv.v1.ConsumerPacketData".into()
233    }
234    fn type_url() -> ::prost::alloc::string::String {
235        "/interchain_security.ccv.v1.ConsumerPacketData".into()
236    }
237}
238/// Note this type is used during IBC handshake methods for both the consumer and provider
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct HandshakeMetadata {
241    #[prost(string, tag = "1")]
242    pub provider_fee_pool_addr: ::prost::alloc::string::String,
243    #[prost(string, tag = "2")]
244    pub version: ::prost::alloc::string::String,
245}
246impl ::prost::Name for HandshakeMetadata {
247    const NAME: &'static str = "HandshakeMetadata";
248    const PACKAGE: &'static str = "interchain_security.ccv.v1";
249    fn full_name() -> ::prost::alloc::string::String {
250        "interchain_security.ccv.v1.HandshakeMetadata".into()
251    }
252    fn type_url() -> ::prost::alloc::string::String {
253        "/interchain_security.ccv.v1.HandshakeMetadata".into()
254    }
255}
256/// ConsumerPacketData contains a consumer packet data and a type tag
257/// that is compatible with ICS v1 and v2 over the wire. It is not used for internal storage.
258#[derive(Clone, PartialEq, ::prost::Message)]
259pub struct ConsumerPacketDataV1 {
260    #[prost(enumeration = "ConsumerPacketDataType", tag = "1")]
261    pub r#type: i32,
262    #[prost(oneof = "consumer_packet_data_v1::Data", tags = "2, 3")]
263    pub data: ::core::option::Option<consumer_packet_data_v1::Data>,
264}
265/// Nested message and enum types in `ConsumerPacketDataV1`.
266pub mod consumer_packet_data_v1 {
267    #[derive(Clone, PartialEq, ::prost::Oneof)]
268    pub enum Data {
269        #[prost(message, tag = "2")]
270        SlashPacketData(super::SlashPacketDataV1),
271        #[prost(message, tag = "3")]
272        VscMaturedPacketData(super::VscMaturedPacketData),
273    }
274}
275impl ::prost::Name for ConsumerPacketDataV1 {
276    const NAME: &'static str = "ConsumerPacketDataV1";
277    const PACKAGE: &'static str = "interchain_security.ccv.v1";
278    fn full_name() -> ::prost::alloc::string::String {
279        "interchain_security.ccv.v1.ConsumerPacketDataV1".into()
280    }
281    fn type_url() -> ::prost::alloc::string::String {
282        "/interchain_security.ccv.v1.ConsumerPacketDataV1".into()
283    }
284}
285/// This packet is sent from the consumer chain to the provider chain
286/// It is backward compatible with the ICS v1 and v2 version of the packet.
287#[derive(Clone, PartialEq, ::prost::Message)]
288pub struct SlashPacketDataV1 {
289    #[prost(message, optional, tag = "1")]
290    pub validator: ::core::option::Option<::tendermint_proto::abci::Validator>,
291    /// map to the infraction block height on the provider
292    #[prost(uint64, tag = "2")]
293    pub valset_update_id: u64,
294    /// tell if the slashing is for a downtime or a double-signing infraction
295    #[prost(enumeration = "InfractionType", tag = "3")]
296    pub infraction: i32,
297}
298impl ::prost::Name for SlashPacketDataV1 {
299    const NAME: &'static str = "SlashPacketDataV1";
300    const PACKAGE: &'static str = "interchain_security.ccv.v1";
301    fn full_name() -> ::prost::alloc::string::String {
302        "interchain_security.ccv.v1.SlashPacketDataV1".into()
303    }
304    fn type_url() -> ::prost::alloc::string::String {
305        "/interchain_security.ccv.v1.SlashPacketDataV1".into()
306    }
307}
308/// ConsumerPacketType indicates interchain security specific packet types.
309#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
310#[repr(i32)]
311pub enum ConsumerPacketDataType {
312    /// UNSPECIFIED packet type
313    ConsumerPacketTypeUnspecified = 0,
314    /// Slash packet
315    ConsumerPacketTypeSlash = 1,
316    /// VSCMatured packet
317    ConsumerPacketTypeVscm = 2,
318}
319impl ConsumerPacketDataType {
320    /// String value of the enum field names used in the ProtoBuf definition.
321    ///
322    /// The values are not transformed in any way and thus are considered stable
323    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
324    pub fn as_str_name(&self) -> &'static str {
325        match self {
326            Self::ConsumerPacketTypeUnspecified => "CONSUMER_PACKET_TYPE_UNSPECIFIED",
327            Self::ConsumerPacketTypeSlash => "CONSUMER_PACKET_TYPE_SLASH",
328            Self::ConsumerPacketTypeVscm => "CONSUMER_PACKET_TYPE_VSCM",
329        }
330    }
331    /// Creates an enum from field names used in the ProtoBuf definition.
332    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
333        match value {
334            "CONSUMER_PACKET_TYPE_UNSPECIFIED" => {
335                Some(Self::ConsumerPacketTypeUnspecified)
336            }
337            "CONSUMER_PACKET_TYPE_SLASH" => Some(Self::ConsumerPacketTypeSlash),
338            "CONSUMER_PACKET_TYPE_VSCM" => Some(Self::ConsumerPacketTypeVscm),
339            _ => None,
340        }
341    }
342}
343/// InfractionType indicates the infraction type a validator committed.
344/// Note ccv.InfractionType to maintain compatibility between ICS versions
345/// using different versions of the cosmos-sdk and ibc-go modules.
346#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
347#[repr(i32)]
348pub enum InfractionType {
349    /// UNSPECIFIED defines an empty infraction type.
350    Unspecified = 0,
351    /// DOUBLE_SIGN defines a validator that double-signs a block.
352    DoubleSign = 1,
353    /// DOWNTIME defines a validator that missed signing too many blocks.
354    Downtime = 2,
355}
356impl InfractionType {
357    /// String value of the enum field names used in the ProtoBuf definition.
358    ///
359    /// The values are not transformed in any way and thus are considered stable
360    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
361    pub fn as_str_name(&self) -> &'static str {
362        match self {
363            Self::Unspecified => "INFRACTION_TYPE_UNSPECIFIED",
364            Self::DoubleSign => "INFRACTION_TYPE_DOUBLE_SIGN",
365            Self::Downtime => "INFRACTION_TYPE_DOWNTIME",
366        }
367    }
368    /// Creates an enum from field names used in the ProtoBuf definition.
369    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
370        match value {
371            "INFRACTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
372            "INFRACTION_TYPE_DOUBLE_SIGN" => Some(Self::DoubleSign),
373            "INFRACTION_TYPE_DOWNTIME" => Some(Self::Downtime),
374            _ => None,
375        }
376    }
377}