Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Oct 5, 2023
1 parent 34f43a0 commit 80b637f
Show file tree
Hide file tree
Showing 2 changed files with 1,136 additions and 125 deletions.
57 changes: 48 additions & 9 deletions proto/interchain_security/ccv/v1/wire.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ package interchain_security.ccv.v1;

option go_package = "github.com/cosmos/interchain-security/v3/x/ccv/types";

import "cosmos/staking/v1beta1/staking.proto";

import "gogoproto/gogo.proto";
import "tendermint/abci/types.proto";

//
// Note any type defined in this file is used by both the consumer and provider
// AND SENT OVER THE WIRE via a ccv channel. Ideally these schemas should never change, or at least
// be backwards compatible if ever changed.
// AND SENT OVER THE WIRE via a ccv channel. Ideally these schemas should never change (or at least
// be backwards compatible if ever changed), and should not rely on external dependencies.
//

// This packet is sent from provider chain to consumer chain if the validator
Expand All @@ -21,7 +18,7 @@ import "tendermint/abci/types.proto";
// asynchronously once unbonding period is over, and this will function as
// `UnbondingOver` message for this packet.
message ValidatorSetChangePacketData {
repeated .tendermint.abci.ValidatorUpdate validator_updates = 1 [
repeated ValidatorUpdate validator_updates = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"validator_updates\""
];
Expand All @@ -42,14 +39,14 @@ message VSCMaturedPacketData {
// to request the slashing of a validator as a result of an infraction
// committed on the consumer chain.
message SlashPacketData {
tendermint.abci.Validator validator = 1 [
Validator validator = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"validator\""
];
// map to the infraction block height on the provider
uint64 valset_update_id = 2;
// tell if the slashing is for a downtime or a double-signing infraction
cosmos.staking.v1beta1.Infraction infraction = 3;
Infraction infraction = 3;
}

// ConsumerPacketData contains a consumer packet data and a type tag
Expand Down Expand Up @@ -97,7 +94,7 @@ message ConsumerPacketDataV1 {
// This packet is sent from the consumer chain to the provider chain
// It is backward compatible with the ICS v1 and v2 version of the packet.
message SlashPacketDataV1 {
tendermint.abci.Validator validator = 1 [
Validator validator = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "yaml:\"validator\""
];
Expand All @@ -120,3 +117,45 @@ enum InfractionType {
// DOWNTIME defines a validator that missed signing too many blocks.
INFRACTION_TYPE_DOWNTIME = 2 [(gogoproto.enumvalue_customname) = "Downtime"];
}

// Note this type originally resides from cometbft at commit fe45483be36ebfea7e172a3ad949e8fe09a8fd95 (version 0.37.2),
// However, external deps were removed from this file to resolve https://github.com/cosmos/interchain-security/issues/1215.
//
// See https://github.com/cometbft/cometbft/blob/fe45483be36ebfea7e172a3ad949e8fe09a8fd95/proto/tendermint/abci/types.proto#L366
message Validator {
bytes address = 1;
int64 power = 3;
}

// Note this type originally resides from cometbft at commit fe45483be36ebfea7e172a3ad949e8fe09a8fd95 (version 0.37.2),
// However, external deps were removed from this file to resolve https://github.com/cosmos/interchain-security/issues/1215.
//
// See https://github.com/cometbft/cometbft/blob/fe45483be36ebfea7e172a3ad949e8fe09a8fd95/proto/tendermint/abci/types.proto#L372
message ValidatorUpdate {
PublicKey pub_key = 1 [(gogoproto.nullable) = false];
int64 power = 2;
}

// Note this type originally resides from cometbft at commit fe45483be36ebfea7e172a3ad949e8fe09a8fd95 (version 0.37.2),
// However, external deps were removed from this file to resolve https://github.com/cosmos/interchain-security/issues/1215.
//
// See https://github.com/cometbft/cometbft/blob/fe45483be36ebfea7e172a3ad949e8fe09a8fd95/proto/tendermint/crypto/keys.proto#L9
message PublicKey {
option (gogoproto.compare) = true;
option (gogoproto.equal) = true;

oneof sum {
bytes ed25519 = 1;
bytes secp256k1 = 2;
}
}

// Note this type originally resides from the cosmos-sdk at commit 2e9e5d6eea24d6c11eddc9c002c66e89ae036187 (v0.47.5),
// However, external deps were removed from this file to resolve https://github.com/cosmos/interchain-security/issues/1215.
//
// See https://github.com/cosmos/cosmos-sdk/blob/2e9e5d6eea24d6c11eddc9c002c66e89ae036187/proto/cosmos/staking/v1beta1/staking.proto#L392
enum Infraction {
INFRACTION_UNSPECIFIED = 0;
INFRACTION_DOUBLE_SIGN = 1;
INFRACTION_DOWNTIME = 2;
}
Loading

0 comments on commit 80b637f

Please sign in to comment.