Skip to content

Commit

Permalink
use protobufs to define ccv state (cosmos#332)
Browse files Browse the repository at this point in the history
* refactor UnbondingOpsIndex operations

Define message UnbondingOpsIndex in ccv protos.
Use UnbondingOpsIndex instead of []uint64 where applicable.

* update UnbondingOpsIndex tests

* refactor MaturedUnboundingOps store operations

Define message MaturedUnboundingOps in ccv protos.
Refactor code to use new message where applicable.

* update e2e tests

* refactor protobuf usage for ccv state

* add slash requests message

* use protobuf for storing slashes on consumer

* use protobuf for storing slash acks on provider

Co-authored-by: Jehan <[email protected]>
  • Loading branch information
MSalopek and jtremback authored Sep 20, 2022
1 parent 25bd627 commit 2f1f620
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions proto/interchain_security/ccv/consumer/v1/consumer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ message SlashRequest {
interchain_security.ccv.v1.SlashPacketData packet = 1;
cosmos.staking.v1beta1.InfractionType infraction = 2;
}

// SlashRequests is a list of slash requests for CCV consumer module
message SlashRequests {
repeated SlashRequest requests = 1;
}
6 changes: 6 additions & 0 deletions proto/interchain_security/ccv/provider/v1/provider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,9 @@ message HandshakeMetadata {
string provider_fee_pool_addr = 1;
string version = 2;
}

// SlashAcks contains addesses of consumer chain validators
// successfully slashed on the provider chain
message SlashAcks {
repeated string addresses = 1;
}
10 changes: 10 additions & 0 deletions proto/interchain_security/ccv/v1/ccv.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,13 @@ message SlashPacketData {
// tell if the slashing is for a downtime or a double-signing infraction
cosmos.staking.v1beta1.InfractionType infraction = 3;
}

// UnbondingOpsIndex defines a list of unbonding operation ids.
message UnbondingOpsIndex {
repeated uint64 ids = 1;
}

// MaturedUnbondingOps defines a list of ids corresponding to ids of matured unbonding operations.
message MaturedUnbondingOps {
repeated uint64 ids = 1;
}

0 comments on commit 2f1f620

Please sign in to comment.