Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Assignment Feature #424

Closed
wants to merge 193 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
db04c2d
Start addings docs
Oct 25, 2022
31ac0f5
Start adding proto
Oct 25, 2022
57b50a7
Start adding keymap_*.go
Oct 25, 2022
d46bcfb
Add change to difftest/setup
Oct 25, 2022
7cc13c0
Add genesis changes
Oct 25, 2022
af05cc7
Adds driver find.py
Oct 25, 2022
f90c942
Change keeper, keeper_test
Oct 25, 2022
5ffe108
Adds genesis proto import
Oct 25, 2022
ccbfe18
Compile proto, fix build errs
Oct 25, 2022
4648ff1
Change consumer type
Oct 25, 2022
8c1f7d9
Changes provider relay
Oct 25, 2022
b54de67
Proposal, builds
Oct 25, 2022
56a88bb
Adds chainID param in proposal_test
Oct 25, 2022
4f8506f
(diff, short) tests pass, fix genesis test
Oct 25, 2022
4582966
WIP
Oct 25, 2022
8b40bae
wip
Oct 25, 2022
c4a87e2
wip
Oct 25, 2022
7f52e59
build keymap_*.go
Oct 25, 2022
0755b73
Recompile proto, all builds
Oct 25, 2022
4ab1956
Simplify internals internal tests pass
Oct 25, 2022
9e6c82e
Del unused store methods
Oct 25, 2022
231d934
rename setter
Oct 25, 2022
a4f9765
Get,Del,Iter method renames
Oct 25, 2022
48ce93a
all tests (go test ./...) pass
Oct 25, 2022
86a872a
pre refactor inner
Oct 25, 2022
1aa33aa
Split main ComputeUpdates
Oct 25, 2022
8db1288
Start refactoring
Oct 25, 2022
40c3e69
Revert "Start refactoring"
Oct 25, 2022
8ef0e58
Slight refactor tests pass
Oct 25, 2022
4830e7e
Implement consumer removal
Oct 25, 2022
61a8d0f
Adds pk template
Oct 25, 2022
0de5df5
Pre use provider cons addr as forward direction key
Oct 26, 2022
a96bfbc
Start changing to use pca for key
Oct 26, 2022
d6dd825
Rebuild proto start manual renaming
Oct 26, 2022
ddb7582
change proto names
Oct 26, 2022
15fb975
Change keymap
Oct 26, 2022
f53ae04
pre change keymap test mapping struct tyep
Oct 26, 2022
9ac39fa
Make keymap_test build but untested
Oct 26, 2022
b984717
Tweak proto field name, fix build issues
Oct 26, 2022
55ce4d3
Implement provider delete
Oct 26, 2022
780d218
Adds a validator removal unit test
Oct 26, 2022
347bea3
del dummy excal
Oct 26, 2022
fa666e4
Reduce diff in types change
Oct 26, 2022
9607c62
Remove unused alias in keeper
Oct 26, 2022
eaac67b
Remove faulty line in genesis
Oct 26, 2022
6ed4d3c
Small refactor
Oct 26, 2022
e44381a
Rollback extra diff
Oct 26, 2022
80380f0
(go test ./... passes) fix string type
Oct 26, 2022
9cf0596
Reduce overapproximation for model consumer slashing
Oct 26, 2022
682fe1f
Start working on diff test (unfinished) confirm all pass
Oct 26, 2022
d4bd59c
Adds hacky infra to diff test key mapping
Oct 26, 2022
fb3619d
Pre move key gen test util
Oct 26, 2022
bfc1ba9
remove unbonded slash event from constants.ts
Oct 26, 2022
49e579d
Confirm build
Oct 26, 2022
1604f4f
Checkpoint debug
Oct 26, 2022
34c52d9
cp
Oct 26, 2022
b841f6c
Pre del consumerGreatestVscID
Oct 26, 2022
39ca796
Del consumerGreatestVscID
Oct 26, 2022
27b9ca6
(diff pass) use <val, vscid> metadata in consumer slash test
Oct 26, 2022
d2f971d
Add notes, need to add private key signers for diff test
Oct 26, 2022
0ae42ed
cp
Oct 27, 2022
b8fb229
fix regression
Oct 27, 2022
187fe36
cp
Oct 27, 2022
3d0bb51
(Original diff test traces still pass)
Oct 28, 2022
1cfe0d6
(diff tests pass (with no downtime slashes)) milestone
Oct 28, 2022
14a0ec4
Define proto query and tx
Oct 28, 2022
7b02a94
Build query and tx proto go types
Oct 28, 2022
48532e0
Add provider cli query
Oct 28, 2022
63d0742
Add empty query handler
Oct 28, 2022
f888208
Adds tx, flags in provider/cli mimicking staking/tx
Oct 28, 2022
b72acdd
tx proto change but dont rebuild
Oct 28, 2022
e035271
Working on handler, msg server
Oct 28, 2022
b6e0335
Adds msg.go
Oct 28, 2022
d23a709
strip down cli/flags, tx
Oct 28, 2022
2ddb304
Fix missing line in handler.go
Oct 28, 2022
617d7c4
Register Route() and RegisterServices() (use pointer deref)
Oct 28, 2022
fe3a591
Renames tx func call
Oct 28, 2022
99f07ad
Start adding handler test
Oct 28, 2022
9cf39d1
Add handler boilerplat
Oct 28, 2022
a605b24
Adds errors
Oct 28, 2022
d00b337
Change designation msg proto
Oct 28, 2022
a7e935a
Adds to codec.go
Oct 28, 2022
5d2dec9
Write New, ValidateBasic for Msg
Oct 28, 2022
ecc9260
Implement DesignateConsensusKeyForConsumerChain body
Oct 28, 2022
f86122f
Return error in tx body if semantic fail
Oct 28, 2022
7ea1a77
Adds TX handler test skeleton
Oct 28, 2022
c4f8937
Fix key types to create a happy path test
Oct 31, 2022
e6cd49a
Simplify hander_test
Oct 31, 2022
8727c14
cp
Oct 31, 2022
109d2e8
Adds some tests
Oct 31, 2022
967050b
Comments
Oct 31, 2022
acec85d
Delete unused tx var init
Oct 31, 2022
16a7870
Start adding tx
Oct 31, 2022
5574ded
save tx_test before delete
Oct 31, 2022
2e055c3
del unfinished tx_test.go
Oct 31, 2022
2c42f87
Impl tx, flags
Oct 31, 2022
3f3e546
Start working on spec
Oct 31, 2022
e693ec4
cp
Oct 31, 2022
e691abd
Work on model
Oct 31, 2022
5dd8293
Adds todo
Oct 31, 2022
37fab45
cp
Oct 31, 2022
94a7036
Checkpoint
Oct 31, 2022
f57c6d0
checkpoint
Oct 31, 2022
9481d3d
Comment model
Oct 31, 2022
59e81fc
Caps constant names
Oct 31, 2022
6012965
Del unused fun
Oct 31, 2022
5c6be16
API model tweaks
Oct 31, 2022
8e6e978
Change query proto and compile
Nov 1, 2022
6c7b6a0
Impl cli query logic
Nov 1, 2022
a05c6ab
Impl grpc query handler
Nov 1, 2022
f27923b
Add error
Nov 1, 2022
b6d2c8c
Start working on query test
Nov 1, 2022
6ebc077
Checkpoint unfinished queries
Nov 1, 2022
6957163
Impl failing query test
Nov 1, 2022
ddce810
Trying to debug lost CachedValue
Nov 1, 2022
91bdabf
Adds query
Nov 1, 2022
a88e916
Regen proto (no build)
Nov 1, 2022
8227d0e
Make build
Nov 1, 2022
48bbdfe
Squashed commit of the following:
Nov 1, 2022
a686ee3
Rename vscidToMapping
Nov 1, 2022
bb9f65b
Partial refactor some model parts
Nov 1, 2022
42c2593
Improve model clarity
Nov 1, 2022
c75a588
Add key assignment struct
Nov 1, 2022
c72cd64
Tweak model generate new traces
Nov 1, 2022
b8019ac
Checkpoint pre refactor driver
Nov 1, 2022
18b255d
Partial refactors of driver
Nov 1, 2022
944ee5a
Pre strip debugs
Nov 1, 2022
899f6ca
(make test-diff pass) refactors
Nov 1, 2022
e344959
Remove core test grey code
Nov 1, 2022
b71fc9d
Strip down debug statements
Nov 1, 2022
bdb995f
(make test-diff pass) DELETE find.py debug helper
Nov 1, 2022
97abb29
Leave note for consumerPower
Nov 1, 2022
983c87c
Start factoring out duplicate test keys
Nov 2, 2022
f1cfae5
Make adjustment in core_test
Nov 2, 2022
fdc95bd
(test-diff pass) refactor diff core to use common test val utils
Nov 2, 2022
2708a47
Fix method name in setup
Nov 2, 2022
b3c793a
Try revert useless diffs in helpers
Nov 2, 2022
f0cb3f1
rename import in core_test
Nov 2, 2022
0a73df1
Refactor TestDesignateConsensusKeyForConsumerChain handler test
Nov 2, 2022
f4ac5b4
Add staking validator helper to test validator
Nov 2, 2022
89ddbac
Factor out messy validator creation code in diff core setup
Nov 2, 2022
f56196a
Slight improvement core_test keyAssignment
Nov 2, 2022
959dc45
Improve import names
Nov 2, 2022
fbd056b
Simplify grpc_query_test
Nov 2, 2022
80cb85a
Simplify keymap_test (did not run test)
Nov 2, 2022
6b4fc4b
Reach milestone in factoring out test keys
Nov 2, 2022
d7f8d44
Revert import name change in grpc query
Nov 2, 2022
2daab1e
Mass rename KeyMap -> KeyAssignment
Nov 2, 2022
2410cf7
Mass rename keymap -> keyassignment
Nov 2, 2022
c504f45
rename files prefixed with keymap with keyassignment prefix
Nov 2, 2022
747bef4
rename keymap.proto to keyassignment.proto
Nov 2, 2022
a1c47bf
Rename and rebuild proto
Nov 2, 2022
87869c5
DEL keymap.pb.go
Nov 2, 2022
881077e
Fix build errors due to proto rebuild
Nov 2, 2022
62ed143
Update key assignment imports
Nov 2, 2022
24d4ea3
rename imports in keyassignment_test.go
Nov 2, 2022
1540f5a
RN docs
Nov 2, 2022
360ec22
mass rename keyMap -> keyAssignment
Nov 2, 2022
17d216a
Rename map words to assignment words
Nov 2, 2022
c1239d9
Remove long todo
Nov 2, 2022
cad0821
Rename method handle in keyassignment
Nov 2, 2022
888ec23
Fix method handles in core_test
Nov 2, 2022
2c8b3c4
Mass rename to clear up tailing 'pings'
Nov 2, 2022
2df5458
Fix core_test comment
Nov 2, 2022
eaf08cd
Bring go.mod back to matching main
Nov 2, 2022
8affd7b
Renam store methods
Nov 2, 2022
eb501ca
Fix build errors
Nov 2, 2022
1c9db11
Squashed commit of the following:
Nov 2, 2022
efdee98
Renames km -> ka in test
Nov 2, 2022
4730a8c
fmt keyassignment.go
Nov 2, 2022
4bf4d84
Update keys.go names
Nov 2, 2022
708089a
Make a naming improvement pass
Nov 2, 2022
a1fbf82
Move spec to docs, rename docs
Nov 2, 2022
62c0f32
Try remove +100 in _test
Nov 2, 2022
31f0288
Revert "Try remove +100 in _test"
Nov 2, 2022
ed10448
rename key assignment files with underscore
Nov 2, 2022
05da157
Fix proposal TODO
Nov 2, 2022
47bc20d
Adjust query.proto
Nov 2, 2022
92af9f5
Improve relay helper clarity
Nov 2, 2022
b95de07
TODO in msg_server
Nov 2, 2022
2496dfc
Better comment for internal computation
Nov 2, 2022
76ebbfd
Move code block in core_test
Nov 2, 2022
4869820
Bump num traces in in mem test
Nov 2, 2022
8cdcef6
Adjust hardcoded string path in msg.go
Nov 2, 2022
ebc0290
Adds docstrings to keys.go
Nov 2, 2022
bf2211b
Impl UnpackInterfaces
Nov 2, 2022
6eef58a
Remove comment in codec
Nov 2, 2022
87e5a9b
Remove comments in module
Nov 2, 2022
bbc5424
Improve comment in relay
Nov 2, 2022
dd5193b
Start improving design and api docs
Nov 2, 2022
2ecc545
improve design.md
Nov 2, 2022
aa57bff
revert whitespace
Nov 2, 2022
8d465a9
Adds query.pb.go comment
Nov 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/consumer-democracy/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func (app *App) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
//
// in favour of export at a block height
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
// applyAllowedAddrs := false

Expand Down
3 changes: 2 additions & 1 deletion app/provider/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func (app *App) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
//
// in favour of export at a block height
func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
11 changes: 11 additions & 0 deletions docs/key-assignment/api.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CONSTANTS
STORAGE_CONSTANT = 2
(*
Could be improved by using model value symmetries.
*)
PROVIDER_KEYS = {0, 1, 2}
CONSUMER_KEYS = {0, 1, 2, 3, 4, 5, 6, 7, 8}
INIT Init
NEXT Next
INVARIANT Invariant

178 changes: 178 additions & 0 deletions docs/key-assignment/api.tla
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---- MODULE api ----

EXTENDS Integers, Naturals, FiniteSets, Sequences, TLC

CONSTANTS
STORAGE_CONSTANT,
PROVIDER_KEYS,
CONSUMER_KEYS

VARIABLES
assignments,
providerValSets,
committedProviderVSCID,
committedConsumerVSCID,
maturedConsumerVSCID

(***************************************************************************)
(** Model ******************************************************************)
(***************************************************************************)
(***************************************************************************)

(***************************************)
(** State at genesis *******************)
(***************************************)
(***************************************)

Init ==
\* Store the genesis assignment, and the current assignment
/\ assignments = [vscid \in 1..2 |-> [key \in PROVIDER_KEYS |-> key]]
\* One valset has been committed (genesis)
/\ \E valset \in SUBSET PROVIDER_KEYS:
providerValSets = [vscid \in {1} |-> valset]
\* Genesis block is committed
/\ committedProviderVSCID = 1
\* on consumer too.
/\ committedConsumerVSCID = 1
\* Nothing has matured yet.
/\ maturedConsumerVSCID = 0

(***************************************)
(** Public transaction (tx) API ********)
(***************************************)
(***************************************)

AssignKey ==
\E providerKey \in PROVIDER_KEYS, consumerKey \in CONSUMER_KEYS:
\* consumerKey is not in use
/\ ~(\E i \in DOMAIN assignments: \E k \in DOMAIN assignments[i] : assignments[i][k] = consumerKey)
\* Do assignment
/\ assignments' = [
assignments EXCEPT ![committedProviderVSCID + 1] =
[@ EXCEPT ![providerKey] = consumerKey] ]
\* The rest...
/\ UNCHANGED << providerValSets, committedProviderVSCID, committedConsumerVSCID, maturedConsumerVSCID >>

(***************************************)
(** Internal implemenation API *********)
(***************************************)
(***************************************)

ProviderEndAndCommitBlock ==
\E valset \in SUBSET PROVIDER_KEYS:
\* Create a new assignment entry
/\ assignments' = assignments @@ [vscid \in {committedProviderVSCID+2} |-> assignments[committedProviderVSCID]]
\* Get a new validator set from changes in voting power
/\ providerValSets' = providerValSets @@ [vscid \in {committedProviderVSCID+1} |-> valset]
\* Increment vscid
/\ committedProviderVSCID' = committedProviderVSCID + 1
\* The rest...
/\ UNCHANGED << committedConsumerVSCID, maturedConsumerVSCID >>

ConsumerDeliverUpdates ==
\* Fast forward the consumer
\E vscid \in (committedConsumerVSCID + 1)..committedProviderVSCID:
committedConsumerVSCID' = vscid
\* The rest...
/\ UNCHANGED <<committedProviderVSCID, assignments, providerValSets, maturedConsumerVSCID >>

ProviderDeliverMaturities ==
\* Fast forward the consumer maturities, and notify provider
\E vscid \in (maturedConsumerVSCID + 1)..committedConsumerVSCID:
/\ maturedConsumerVSCID' = vscid
/\ assignments' = [i \in {
j \in DOMAIN assignments : vscid < j \/ committedProviderVSCID <= j
} |-> assignments[i]]
\* The rest...
/\ UNCHANGED <<committedConsumerVSCID, committedProviderVSCID, providerValSets>>

Next ==
\/ AssignKey
\/ ProviderEndAndCommitBlock
\/ ConsumerDeliverUpdates
\/ ProviderDeliverMaturities

(***************************************************************************)
(** Invariants and properties **********************************************)
(***************************************************************************)
(***************************************************************************)

(***************************************)
(** Public query API *******************)
(***************************************)
(***************************************)

(*
The current consumer key assigned to a provider key is defined and
queryable.
True by construction: 'how' not explicitly modelled.
*)
AssignmentIsDefined ==
\A k \in PROVIDER_KEYS:
LET ConsumerKey == assignments[committedProviderVSCID + 1][k]
IN TRUE

(****************************************)
(** Internal implementation properties **)
(****************************************)
(****************************************)

(*
The consumer validator set at committedConsumerVSCID
is defined as the provider validator set at committedConsumerVSCID
mapped through the assignment at committedConsumerVSCID.
True by construction: 'how' not explicitly modelled.
*)
ConsumerValidatorSetIsDefined ==
LET
ConsumerValset == {assignments[committedConsumerVSCID][k] : k \in providerValSets[committedConsumerVSCID]}
IN TRUE

(*
For any unmatured consumer valset, it is always possible to retrieve a unique provider key
for any consumer key in the set.
*)
UniqueReverseQueryResultIsDefined ==
\A i \in (maturedConsumerVSCID + 1)..committedConsumerVSCID :
LET
\* The valset known to the consumer
ConsumerValset == {assignments[i][k] : k \in providerValSets[i]}
\* All the keys that are assigned to the consumerKey in stored assignments
Assigned(consumerKey) == {
providerKey \in PROVIDER_KEYS :
\E j \in DOMAIN assignments : assignments[j][providerKey] = consumerKey
}
\* The query for the providerKey is successful and the result is unique.
IN \A consumerKey \in ConsumerValset : Cardinality(Assigned(consumerKey)) = 1

(*
Storage cost grows linearly with committedProviderVSCID - maturedConsumerVSCID
*)
StorageIsBounded ==
Cardinality(DOMAIN(assignments)) <= STORAGE_CONSTANT * (1 + (committedProviderVSCID - maturedConsumerVSCID))


(*Check that the spec is written correctly.*)
Sanity == LET
Sanity0 == committedConsumerVSCID <= committedProviderVSCID
Sanity1 == maturedConsumerVSCID <= committedConsumerVSCID
Sanity2 == committedProviderVSCID \in DOMAIN assignments
Sanity3 == committedProviderVSCID + 1 \in DOMAIN assignments
Sanity4 == committedProviderVSCID \in DOMAIN providerValSets
IN
/\ Sanity0
/\ Sanity1
/\ Sanity2
/\ Sanity3
/\ Sanity4

Invariant ==
/\ Sanity
/\ AssignmentIsDefined
/\ ConsumerValidatorSetIsDefined
/\ UniqueReverseQueryResultIsDefined
/\ StorageIsBounded

(***************************************************************************)

====
86 changes: 86 additions & 0 deletions docs/key-assignment/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# KeyAssignment

KeyAssignment is the name of the feature that allows validator operators to use different consensus keys for each consumer chain validator node that they operate.

Validators can improve their security by using different consensus keys for each chain. That way, different teams in an organization can operate a subset (can be size 1) of the total number of consumer chains associated to a provider chain. If one key leaks the other keys will not be at risk. It is possible to change the keys at any time by submitting a transaction.

## Overview

The KeyAssignment feature is available via a provider chain API (transactions and queries). The provider chain validator operator submits an assignment transaction to the provider chain with a consumer chain ID and desired consensus key as parameters. The over-IBC protocol used by Interchain Security takes care of forwarding the assignment to the specified consumer chain. When the consumer chain receives the key, it will immediately start using it with tendermint.

It is possible to start validating a consumer chain with the same key as used for the provider. This is the default behavior. It is also possible to specify another key to use when joining the validator set. Moreover it is possible to change the used key at any time, any multiple times, with some minor restrictions.

## External API (High Level)

**TXs**

```go
// Assign a new public consensus key to be used by a validator
// on the provider when it signs transactions on the consumer chain.
// The TX must be signed by the private key associated to the provider
// validator address.
//
// The assignment can fail if the consumer consensus key is already
// in use for the chain, currently, or in the recent past.
AssignConsensusPublicKeyToConsumerChain(
ChainId string, // consumer chain
ProviderValidatorAddress string, // must sign TX
ConsumerConsensusPubKey *types.Any
)
```

**Queries**

```go
// Returns the last consumer key associated to the provider key and
// the consumer chain by a call to AssignConsensusPublicKeyToConsumerChain.
QueryConsumerChainValidatorKeyAssignment (
ChainId string, // consumer chain
ProviderValidatorAddress string, // validator address for the provider chain
)
```

## Internal API (High Level)

TODO: write this section

## API (Details)

The external API is specified in [api.tla](./api.tla). An 'internal' API is also specified. The external API supports the TXs and Queries listed above. The internal API documents the API that the implementation of KeyAssignment exposes for integration
in the implementation of the wider system.

## Implementation

### Algorithm idea


### System integration points


## External properties

KeyAssignment has some properties relevant to the external user:



1. Validator Set Replication\
When the Interchain Security property [Validator Set Replication](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/system_model_and_properties.md#system-properties) holds for an implementation without KeyAssignment, then the property holds when KeyAssignment is used.
2. Slashable Consumer Misbehavior\
When the Interchain Security property [Slashable Consumer Misbehavior](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/system_model_and_properties.md#system-properties) holds for an implementation without KeyAssignment, then the property holds when KeyAssignment is used.

All Interchain Security properties still hold when KeyAssignment is used, the above are just the most relevant.

Additionally

3. When a `AssignConsensusPublicKeyToConsumerChain` operation succeeds for a given `(chainID, ProviderValidatorAddress, ConsumerConsensusPubKey)` tuple at block height `hp0`, and is not followed by a subsquent call for the same tuple before or during a height `hp1` (`hp0 <= hp1`), and at `hp1` a validator set update packet is committed at the provider chain, then at the next earliest height `hc2` on the consumer chain that the packet is received, the `ConsumerConsensusPubKey ` is passed as consensus key to tendermint. Thus tendermint will expect a signature from `ConsumerConsensusPubKey ` from height `hc2 + 1`.


## Internal properties

The internal properties section in [api.tla](./api.tla) specifies abstract but precise properties. In particular, at a high level:

1. The consumer validator set is always defined as per the validator set replication property.
2. It is always possible to lookup the provider consensus address, for a given consumer consensus public key, when the consumer has been sent that public key and that key is still liable for double signing or downtime slashing.
3. The storage requirements are reasonable.

Please see [api.tla](./api.tla) and [key_assignment_test.go::externalInvariants](../../x/ccv/provider/keeper/key_assignment_test.go) and [key_assignment.go::internalInvariants](../../x/ccv/provider/keeper/key_assignment.go) for precise formulations.
2 changes: 1 addition & 1 deletion docs/quality_assurance.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The main concern addressed in this section is the correctness of the provider ch
| 4.01 | Liveness of undelegations <br> - unbonding delegation entries are eventually removed from `UnbondingDelegation` | `Scheduled` | `NA` | `Done` <br> [unbonding_test.go](../tests/e2e/unbonding_test.go) | `Done` | `Scheduled` | `NA` |
| 4.02 | Liveness of redelegations <br> - redelegations entries are eventually removed from `Redelegations` | `Scheduled` | `NA` | `Scheduled` | `Scheduled` | `Scheduled` | `NA` |
| 4.03 | Liveness of validator unbondings <br> - unbonding validators with no delegations are eventually removed from `Validators` | `Scheduled` | `NA` | `NA` | `Done` | `Scheduled` | `NA` |
| 4.04 | Unbonding operations (undelegations, redelegations, validator unbondings) should eventually complete even if the CCV channel is never established (due to error) <br> - expected outcome: the channel initialization sub-protocol eventually times out, which leads to the consumer chain removal <br> - requires https://github.com/cosmos/interchain-security/issues/278 | `Scheduled` | `NA` | `Scheduled` | `Future work` | `Scheduled` | `Done` |
| 4.04 | Unbonding operations (undelegations, redelegations, validator unbondings) should eventually complete even if the CCV channel is never established (due to error) <br> - expected outcome: the channel initialization sub-protocol eventually times out, which leads to the consumer chain removal | `Scheduled` | `NA` | `Done` [TestUndelegationDuringInit](../tests/e2e/unbonding_test.go#145) | `Future work` | `Scheduled` | `Done` |
| 4.05 | Unbonding operations (undelegations, redelegations, validator unbondings) should eventually complete even if one of the clients expire <br> - expected outcome: the pending VSC packets eventually timeout, which leads to the consumer chain removal <br> - requires https://github.com/cosmos/interchain-security/issues/283 | `Scheduled` | `NA` | `Scheduled` | `Future work` | `Scheduled` | `NA` |
| 4.06 | A validator cannot get slashed more than once for double signing, regardless of how many times it double signs on different chains (consumers or provider) | `Scheduled` | `NA` |`Done` <br> [TestHandleSlashPacketErrors](../tests/e2e/slashing_test.go#L317) | `Done` | `Scheduled` | `NA` |
| 4.07 | A validator cannot get slashed multiple times for downtime on the same consumer chain without requesting to `Unjail` itself on the provider chain in between | `Scheduled` | `NA` | `Partial coverage` <br> [TestSendSlashPacket](../tests/e2e/slashing_test.go#L648) | `Partial coverage` | `Scheduled` | `NA` |
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.18

require (
github.com/cosmos/cosmos-sdk v0.45.2-0.20220901181011-06d4a64bf808
github.com/cosmos/ibc-go v1.2.2
github.com/cosmos/ibc-go/v3 v3.0.0-alpha1.0.20220210141024-fb2f0416254b
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
Expand Down Expand Up @@ -135,4 +134,4 @@ replace (
github.com/cosmos/ibc-go/v3 => github.com/informalsystems/ibc-go/v3 v3.0.0-beta1.0.20220816140824-aba9c2f2b943
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
google.golang.org/grpc => google.golang.org/grpc v1.33.2
)
)
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ github.com/cosmos/iavl v0.15.3/go.mod h1:OLjQiAQ4fGD2KDZooyJG9yz+p2ao2IAYSbke8mV
github.com/cosmos/iavl v0.17.1/go.mod h1:7aisPZK8yCpQdy3PMvKeO+bhq1NwDjUwjzxwwROUxFk=
github.com/cosmos/iavl v0.17.3 h1:s2N819a2olOmiauVa0WAhoIJq9EhSXE9HDBAoR9k+8Y=
github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w=
github.com/cosmos/ibc-go v1.2.2 h1:bs6TZ8Es1kycIu2AHlRZ9dzJ+mveqlLN/0sjWtRH88o=
github.com/cosmos/ibc-go v1.2.2/go.mod h1:XmYjsRFOs6Q9Cz+CSsX21icNoH27vQKb3squgnCOCbs=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8=
Expand Down
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 @@ -47,6 +47,11 @@ message Params {
// 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];
}

// LastTransmissionBlockHeight is the last time validator holding
Expand Down
Loading