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

feat!: remove VSCMaturedPackets (provider changes) #2098

Merged
merged 100 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
897a300
turn off expensive tests
MSalopek May 24, 2024
bca9eb5
Merge remote-tracking branch 'upstream/main'
mpoke Jun 12, 2024
51d6543
deprecate key prefixes
mpoke Jun 12, 2024
b8eac2c
tag protos for removal
mpoke Jun 12, 2024
57a5c30
remove QueryOldestUnconfirmedVsc
mpoke Jun 12, 2024
1723a07
make AfterUnbondingInitiated a noop
mpoke Jun 12, 2024
294476c
add migration
mpoke Jun 12, 2024
b8632e0
remove completeMaturedUnbondingOps
mpoke Jun 12, 2024
cb27a8e
send VSCPacket only on valupdates
mpoke Jun 12, 2024
2707a04
remove VSC timeout logic
mpoke Jun 12, 2024
b33496d
remove unbonding ops logic
mpoke Jun 12, 2024
e64f872
remove VscUnbondingOps from ConsumerState
mpoke Jun 12, 2024
899a93e
remove unnecessary fields from GenesisState
mpoke Jun 12, 2024
3ad2d3d
remove GetAllUnbondingOps
mpoke Jun 12, 2024
cac47fa
remove deprecated protos
mpoke Jun 12, 2024
73509c8
remove TODO
mpoke Jun 12, 2024
8657fbd
remove unbonding integration tests
mpoke Jun 12, 2024
7767adb
fix checkConsumerChainIsRemoved
mpoke Jun 12, 2024
cb319df
remove checkCCVUnbondingOp
mpoke Jun 12, 2024
6f31e5c
TestProviderStateIsCleanedAfterConsumerChainIsStopped
mpoke Jun 12, 2024
ddb4031
fix TestRelayAndApplyDowntimePacket
mpoke Jun 12, 2024
d958152
remove vsc_timeout_period param
mpoke Jun 12, 2024
bf23c1e
add TestUndelegationCompletion
mpoke Jun 12, 2024
ddb5fcb
add TODO for init timeout
mpoke Jun 12, 2024
81af307
fix integration tests
mpoke Jun 12, 2024
eb5f1e9
Merge remote-tracking branch 'upstream/main'
mpoke Jun 12, 2024
6216b04
Merge branch 'main' into marius/remove-vscmatured
mpoke Jun 12, 2024
703afd2
avoid breaking protos
mpoke Jun 18, 2024
2714579
remove TestTooManyLastValidators
mpoke Jun 18, 2024
9c4c2b4
Merge remote-tracking branch 'upstream/main'
mpoke Jun 19, 2024
4104b5c
Merge branch 'main' into marius/remove-vscmatured
mpoke Jun 19, 2024
c2be16f
add ADR for removing vscmatured packets
mpoke Jun 19, 2024
1b5857d
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 19, 2024
dfd2956
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 19, 2024
283ac29
add consumer changes -- wip
mpoke Jun 19, 2024
a895aab
consumer changes
mpoke Jun 19, 2024
af6e0e2
add new prefix for ConsumerAddrsToPrune
mpoke Jun 20, 2024
b330507
add consumer_addrs_to_prune_v2 to GenesisState
mpoke Jun 20, 2024
0b23432
add migration for ConsumerAddrsToPrune index
mpoke Jun 20, 2024
f4bafdb
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 20, 2024
ca9b8f9
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 20, 2024
76c5627
deprecate ConsumerAddrsToPruneBytePrefix
mpoke Jun 21, 2024
581dd48
change name of field for ConsumerAddrsToPruneV2
mpoke Jun 21, 2024
76ab502
reuse original ConsumerAddrsToPrune methods
mpoke Jun 21, 2024
636cd8d
stop handling VSCMaturedPackets
mpoke Jun 21, 2024
5079929
update ADR
mpoke Jun 21, 2024
70eaea4
apply review suggestions
mpoke Jun 21, 2024
d771102
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 25, 2024
a39908a
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 25, 2024
7a29c15
Update docs/docs/adrs/adr-018-remove-vscmatured.md
mpoke Jun 26, 2024
4ebd2b8
describe how hermes uses UnbondingPeriod
mpoke Jun 26, 2024
2f7758b
apply review suggestions
mpoke Jun 26, 2024
089089b
Merge pull request #41 from informalsystems/marius/adr-remove-vscmatured
mpoke Jun 26, 2024
1626437
apply review suggestions
mpoke Jun 28, 2024
2762613
apply review suggestions
mpoke Jun 28, 2024
a0fcd07
Merge pull request #36 from informalsystems/marius/remove-vscmatured
mpoke Jun 28, 2024
25d7bd5
resolve merge conflicts
mpoke Jun 28, 2024
589aa30
remove ConsumerAddrsToPrune
mpoke Jun 28, 2024
c52deed
deprecate InitTimeoutTimestampBytePrefix
mpoke Jul 2, 2024
3862a39
remove init timeout logic
mpoke Jul 3, 2024
142e45e
migration to remove InitTimeoutTimestamp state
mpoke Jul 3, 2024
94e4030
update GenesisState
mpoke Jul 3, 2024
38eaade
fix tests
mpoke Jul 3, 2024
fbde460
Update x/ccv/provider/types/keys.go
mpoke Jul 3, 2024
59d593f
apply review suggestions
mpoke Jul 3, 2024
37b912f
uncomment TestSimulatedAssignmentsAndUpdateApplication
mpoke Jul 3, 2024
459d6bf
Fixed TestSimulatedAssignmentsAndUpdateApplication test
insumity Jul 5, 2024
2827264
formatting fix
insumity Jul 5, 2024
7eb97f7
Merge pull request #46 from informalsystems/marius/consumer-key-pruning
mpoke Jul 5, 2024
ec0f489
Merge branch 'feat/read-only-v1' into marius/remove-init-timeout
mpoke Jul 5, 2024
c7ddf84
fix error message
mpoke Jul 5, 2024
617ee8e
Merge remote-tracking branch 'upstream/main'
bermuell Jul 9, 2024
99046b5
remove TestInitTimeout
mpoke Jul 15, 2024
4eff896
remove init_timeout_period param
mpoke Jul 15, 2024
94158b3
Merge pull request #51 from informalsystems/marius/remove-init-timeout
mpoke Jul 15, 2024
c453e20
Merge remote-tracking branch 'upstream/main'
bermuell Jul 16, 2024
4c07d67
fix merge conflicts
mpoke Jul 16, 2024
4672cbf
fix migration and tests
mpoke Jul 16, 2024
f254514
Merge pull request #60 from informalsystems/marius/read-only-v50
mpoke Jul 17, 2024
175c56b
update ADR 18 status
mpoke Jul 17, 2024
975fb79
remove InitTimeoutTimestamp proto
mpoke Jul 17, 2024
8de627d
add TestPreserveBytePrefix
mpoke Jul 17, 2024
ed41483
fix migration; wip
mpoke Jul 18, 2024
eb67add
remove throttle_legacy as not needed
mpoke Jul 18, 2024
21e3692
Merge remote-tracking branch 'upstream/main'
bermuell Jul 19, 2024
9bde6b8
Merge remote-tracking branch 'upstream/main'
mpoke Jul 24, 2024
a047363
fix merge conflicts
mpoke Jul 24, 2024
70daf5b
fix v7 migration
mpoke Jul 25, 2024
46caa60
remove GetBinaryCodec
mpoke Jul 25, 2024
2a3f4a6
avoid calling ConsumerAddrsToPruneV2Key twice
mpoke Jul 25, 2024
67eb577
convert keys prefixes to byte
mpoke Jul 25, 2024
64f064c
add changelog entries
mpoke Jul 26, 2024
f6dd448
update docs
mpoke Jul 26, 2024
67fe4d1
remove duplicate event type
mpoke Jul 26, 2024
42cb3ad
revert changes to test.yml
mpoke Jul 26, 2024
80e90f8
apply review suggestions
mpoke Jul 26, 2024
7846cbb
apply minor changes
mpoke Jul 26, 2024
eafb76f
add test for MigrateConsumerAddrsToPrune
mpoke Jul 26, 2024
fa759e1
apply review suggestion
mpoke Jul 30, 2024
7278cc4
resolve merge conflicts
mpoke Jul 31, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- The removal of `VSCMaturedPackets` entail several API breaking changes.
([\#2098](https://github.com/cosmos/interchain-security/pull/2098))

- Remove the `oldest_unconfirmed_vsc` query -- used to get
the send timestamp of the oldest unconfirmed VSCPacket.
- Deprecate the `init_timeout_period` and `vsc_timeout_period` parameters
from the provider module.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Remove `VSCMaturedPackets` from the provider module, which entails the following
changes to the provider.
([\#2098](https://github.com/cosmos/interchain-security/pull/2098))

- Remove unbonding operations pausing.
- Remove the CCV channel initialization timeout.
- Remove `VSCPackets` timeout.
- Redesign key assignment pruning -- prune old consumer keys after the unbonding period elapses.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Remove `VSCMaturedPackets` from the provider module.
([\#2098](https://github.com/cosmos/interchain-security/pull/2098))
6 changes: 5 additions & 1 deletion app/provider/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ func New(
govtypes.NewMultiGovHooks(app.ProviderKeeper.Hooks()),
)

providerModule := ibcprovider.NewAppModule(&app.ProviderKeeper, app.GetSubspace(providertypes.ModuleName))
providerModule := ibcprovider.NewAppModule(
&app.ProviderKeeper,
app.GetSubspace(providertypes.ModuleName),
keys[providertypes.StoreKey],
)

app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
Expand Down
188 changes: 188 additions & 0 deletions docs/docs/adrs/adr-018-remove-vscmatured.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
sidebar_position: 19
title: Remove VSCMatured Packets
---
# ADR 018: Remove VSCMatured Packets

## Changelog
* 19/06/2024: Create initial draft

## Status

Accepted

## Context

> The idea of removing VSCMatured packets was first suggested by [Jae Kwon](https://github.com/jaekwon) over a conversation in 2022.
> As a result of that conversation, [an ADR was proposed](https://github.com/cosmos/interchain-security/pull/712) to halt consumer chain if VSC packets are no longer received.
> The ADR was not accepted due to other considerations regarding the safety of consumer chains.
> See [this blog post](https://informal.systems/blog/learning-to-live-with-unbonding-pausing) for more details.

The consumer module on the consumer chains is a representation of the Hub’s staking module, i.e., it provides an _asynchronous_ view of the voting powers and indirectly of the locked collateral.
The key word here is _asynchronous_, which means that (in theory) there is no bound on the lag between the Hub’s view of stake and the consumer’s view of stake.
The reasons for this asynchrony are relaying delays and chain liveness (e.g., a consumer could be down for a long period of time without affecting the liveness of the staking module on the Hub).

The current version of ICS uses `VSCMaturedPackets` to create on the consumers a _partially synchronous_ view of the Hub’s staking module.
Partially synchronous means that the lag between the Hub’s view of stake and the consumer’s view of stake is bounded, because consumers that exceed this lag are forcibly removed from the protocol.
p-offtermatt marked this conversation as resolved.
Show resolved Hide resolved
p-offtermatt marked this conversation as resolved.
Show resolved Hide resolved
Basically, unlocking collateral from the Hub is being delayed until the consumers’ `UnbondingPeriod` elapses.
The reason the view is only partially synchronous is that eventually the collateral is unlocked, i.e., if `VSCMaturedPackets` are not received from a consumer for `VscTimeoutPeriod` (default: 5 weeks), then the consumer is removed from ICS and the collateral is unlocked.
Note that keeping the stake locked “forever” would affect the Hub’s liveness, so it’s not a viable option.

The issue is that whatever attack is possible with an asynchronous view of the staking module, it is eventually possible with the partially synchronous view as well.
For example, an attacker could wait for `VscTimeoutPeriod` for the collateral to be unlocked and then send invalid headers to third-party chains that are not aware the consumer's collateral is no longer locked on the Hub (i.e., the consumer is no longer part of ICS).

mpoke marked this conversation as resolved.
Show resolved Hide resolved
Moreover, with the introduction of [PSS](./adr-015-partial-set-security.md), a consumer’s validator set could “lie” about its `UnbondingPeriod` elapsing by sending `VSCMaturedPackets` earlier.
This would result in a discrepancy between a light client’s view of the `UnbondingPeriod` and the actual Hub’s `UnbondingPeriod`.

## Decision

This ADR proposes the removal of `VSCMaturedPackets`. The reason is twofold.
First, `VSCMaturedPackets` provide a "false" sense of correctness as the attack discribed above is still possible.
Second, `VSCMaturedPackets` add considerable complexity to the ICS protocol -- an extra message plus the pausing of unbonding operations that can affect the UX.
mpoke marked this conversation as resolved.
Show resolved Hide resolved

To simplify the upgrading process, removing `VSCMaturedPackets` can be done in two releases:

* (R1) Update the provider to drop `VSCMaturedPackets`.
* (R2) Update the consumer to stop sending `VSCMaturedPackets`.

As a result, once the provider chain runs R1, the consumers can start upgrading to R2.

### Provider Changes (R1)

#### Parameters

Deprecate the `InitTimeoutPeriod` and `VscTimeoutPeriod` parameters.

#### State

Add the following key prefix to the state:

- `ConsumerAddrsToPruneV2BytePrefix` -- the byte prefix for storing consumer validators addresses that need to be pruned.
mpoke marked this conversation as resolved.
Show resolved Hide resolved
These are stored as
```
ConsumerAddrsToPruneV2BytePrefix | len(chainID) | chainID | ts -> (consumer_address1, consumer_address2, ...)
```
where `ts` is the timestamp at which the consumer validators addresses can be pruned.

Migrate the consumer validator addresses stored under the `ConsumerAddrsToPruneBytePrefix` to the new prefix `ConsumerAddrsToPruneV2BytePrefix`.
Note that these consumer validators addresses are stored as
```
ConsumerAddrsToPruneBytePrefix | len(chainID) | chainID | vscID -> (consumer_address1, consumer_address2, ...)
```
where `vscID` is the ID of the first VSCPacket sent after these consumer validator addresses were changed.
These means that we can use the `VscSendTimestamp`s to compute the timestamps when these consumer validator addresses can be pruned, i.e.,
```golang
func MigrateConsumerAddrsToPrune()
iterator := sdk.KVStorePrefixIterator(store, []byte{providertypes.ConsumerAddrsToPruneBytePrefix})
for ; iterator.Valid(); iterator.Next() {
chainID, vscID, _ := providertypes.ParseChainIdAndUintIdKey(providertypes.ConsumerAddrsToPruneBytePrefix, iterator.Key())
// use the VscSendTimestamp index to compute the timestamp at which this consumer addresses can be pruned
vscSendTimestampKey := providertypes.ChainIdAndUintIdKey(providertypes.VscSendTimestampBytePrefix, chainID, vscID)
timeBz := store.Get(vscSendTimestampKey)
sentTime, _ := sdk.ParseTimeBytes(timeBz)
pruneTs := sentTime.Add(sk.UnbondingTime(ctx))

var addrs providertypes.AddressList
addrs.Unmarshal(iterator.Value())

for _, addr := range addrs.Addresses {
consumerAddr := providertypes.NewConsumerConsAddress(addr)
pk.AppendConsumerAddrsToPrune(ctx, chainID, pruneTs, consumerAddr)
}
}
}
```

Remove the following key prefixes from the state. Note that these removals require state migration.

- `MaturedUnbondingOpsByteKey` -- the byte key that stores the list of all unbonding operations ids that have matured from a consumer chain perspective.
- `UnbondingOpBytePrefix` -- the byte prefix that stores a record of all the ids of consumer chains that need to unbond before a given unbonding operation can unbond on this chain.
- `UnbondingOpIndexBytePrefix` -- the byte prefix of the index for looking up which unbonding operations are waiting for a given consumer chain to unbond.
- `InitTimeoutTimestampBytePrefix` -- the byte prefix for storing the init timeout timestamp for a given consumer chainID.
- `VscSendTimestampBytePrefix` -- the byte prefix for storing the list of VSC sending timestamps for a given consumer chainID.
- `ConsumerAddrsToPruneBytePrefix` -- the byte prefix for storing the mapping from VSC IDs to consumer validators addresses that need to be pruned.
mpoke marked this conversation as resolved.
Show resolved Hide resolved

#### State Transitions

Removing `VSCMaturedPackets` affects three ICS sub-protocols (see [HandleVSCMaturedPacket](https://github.com/cosmos/interchain-security/blob/v4.2.0/x/ccv/provider/keeper/relay.go#L51)): unbonding operations pausing, `VSCPackets` timeout, and key assignment pruning.
The first two are no longer needed, while the third (key assignment pruning) needs to be redesigned to not depend on `VSCMaturedPackets`.

**Removing unbonding operations pausing:**

- Make the `AfterUnbondingInitiated` hook a no-op. As a result, unbonding operations are no longer paused.
- Stop calling the `UnbondingCanComplete` method from the staking keeper. This entails, it is no longer necessary to append `MaturedUnbondingOps` and the `completeMaturedUnbondingOps` method can be removed.
- Note, that during the upgrade, all unbonding operations stored under the `UnbondingOpBytePrefix` prefix need to be completed (via the `UnbondingCanComplete` method from the staking keeper).
- Remove the init timeout timestamp logic from the following methods: `CreateConsumerClient`, `SetConsumerChain`, and `EndBlockCCR`.

**Removing `VSCPackets` timeout:**

- Stop setting VSC send timestamps when sending `VSCPackets`.
- Stop removing the VSC send timestamps when receiving `VSCMaturedPackets`.
- Remove the logic from `EndBlockCCR` that checks if the first VSC send timestamp in iterator plus `VscTimeoutPeriod` exceeds the current block time.
mpoke marked this conversation as resolved.
Show resolved Hide resolved

**Redesign key assignment pruning.** The reason for keeping "old" consumer addresses is to enable slashing / jailing validators that misbehave on consumer chains,
i.e., the slashing logic uses the `GetProviderAddrFromConsumerAddr` method that accesses the mapping from validator addresses on consumer chains to validator addresses on the provider chain (`ValidatorsByConsumerAddrBytePrefix`).
Thus, "old" consumer addresses are no longer needed after the provider's `UnbondingPeriod` elapses.
This means that once a validator changes its key on a consumer, we can prune the address corresponding to the "old" key after `UnbondingPeriod`.
This requires the following changes:

- Adapt the `AppendConsumerAddrsToPrune()` method to use the timestamp at which it is safe to prune the consumer validator address (instead of the current `vscID`).
- Add a new method `ConsumeConsumerAddrsToPrune(ts)` that returns the list of consumer addresses that can be pruned at timestamp `ts`.
- Adapt the `PruneKeyAssignments()` method to call `ConsumeConsumerAddrsToPrune(ctx.BlockTime())`.
- Call the `PruneKeyAssignments()` method from every `EndBlock()` instead of calling it from `HandleVSCMaturedPacket()`.
mpoke marked this conversation as resolved.
Show resolved Hide resolved

#### Queries

Remove the `oldest_unconfirmed_vsc` query.

### Consumer Changes (R2)

#### Parameters

Given that currently relayers use the consumer `UnbondingPeriod` (see `ConsumerParams`), this param cannot be deprecated.
Note that Hermes queries the `UnbondingPeriod` for sanity checks and to set the default trusting period when it is not specified.
As a result, the `UnbondingTime` method from the staking interface will continue to be used to retrieve the consumer's `UnbondingPeriod`.

#### State

Remove the following key prefixes from the state:

- `PacketMaturityTimeBytePrefix` -- the byte prefix that will store maturity time for each received VSC packet

Note that these removals require state migration.
mpoke marked this conversation as resolved.
Show resolved Hide resolved

#### State Transitions

To stop the consumer chains from sending `VSCMaturedPackets`, it is sufficient to not store the maturity time of `VSCPacket`s when receiving them, i.e., do not call `SetPacketMaturityTime` from the `OnRecvVSCPacket()` method.
Note that eventually, no additional `VSCMaturedPackets` will be added to the sending queue as `QueueVSCMaturedPackets` iterates over elapsed maturity times.
In addition, to clean up the code, the `QueueVSCMaturedPackets` must be removed.

#### Messages

`VSCMaturedPacketData` is deprecated.
Note that this is a wire-breaking change -- older consumer versions will send `VSCMaturedPackets` and older provider versions will expect to receive `VSCMaturedPackets`.

## Consequences

### Positive

- Remove feature that provides a "false" sense of correctness.
- Remove unnecessary complexity, from both ICS and Cosmos SDK.
- Remove one IBC packet and, thus, reduce relaying cost.
- Remove unbonding pausing logic that could affect the UX.
mpoke marked this conversation as resolved.
Show resolved Hide resolved
mpoke marked this conversation as resolved.
Show resolved Hide resolved

### Negative

- Large refactor that might introduce unexpected bugs.
- Consumer chains are no longer removed if the duration between creating a client and creating the CCV channel exceeds `InitTimeoutPeriod`.
mpoke marked this conversation as resolved.
Show resolved Hide resolved
This means that if the CCV channel is not created on time, the client expires and the consumer chain can no longer start without a ClientUpdate proposal or re-submitting a `ConsumerAdditionProposal`.

### Neutral

- Consumer chains are no longer removed after a `VscTimeoutPeriod` of inactivity.
Note that consumers are still removed if their CCV channel expires, which usually happens after two weeks instead of five weeks (the default value for `VscTimeoutPeriod`).
mpoke marked this conversation as resolved.
Show resolved Hide resolved

## References

- [PR #712](https://github.com/cosmos/interchain-security/pull/712) -- Proposal to set an expiration date on the consumer chain updated on each VSCPacket received to ensure the chain is up-to-date.
- [Learning to Live with “Unbonding Pausing”](https://informal.systems/blog/learning-to-live-with-unbonding-pausing) blog post.
1 change: 1 addition & 0 deletions docs/docs/adrs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ To suggest an ADR, please make use of the [ADR template](https://github.com/cosm
- [ADR 013: Slashing on the provider for consumer equivocation](./adr-013-equivocation-slashing.md)
- [ADR 014: Epochs](./adr-014-epochs.md)
- [ADR 015: Partial Set Security](./adr-015-partial-set-security.md)
- [ADR 018: Remove VSCMatured Packets](./adr-018-remove-vscmatured.md)

### Proposed

Expand Down
15 changes: 0 additions & 15 deletions docs/docs/introduction/params.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,6 @@ CCVTimeoutPeriod may have different values on the provider and consumer chains.
- `CCVTimeoutPeriod` on the provider **must** be larger than `ConsumerUnbondingPeriod`
- `CCVTimeoutPeriod` on the consumer is initial set via the `ConsumerAdditionProposal`

### InitTimeoutPeriod
`InitTimeoutPeriod` is the maximum allowed duration for CCV channel initialization to execute.

For any consumer chain, if the CCV channel is not established within `InitTimeoutPeriod` then the consumer chain will be removed and therefore will not be secured by the provider chain.

The countdown starts when the `spawn_time` specified in the `ConsumerAdditionProposal` is reached.

### VscTimeoutPeriod
`VscTimeoutPeriod` is the provider-side param that enables the provider to timeout VSC packets even when a consumer chain is not live.
If the `VscTimeoutPeriod` is ever reached for a consumer chain that chain will be considered not live and removed from interchain security.

:::tip
`VscTimeoutPeriod` MUST be larger than the `ConsumerUnbondingPeriod`.
:::

### BlocksPerDistributionTransmission
`BlocksPerDistributionTransmission` is the number of blocks between rewards transfers from the consumer to the provider.

Expand Down
36 changes: 20 additions & 16 deletions proto/interchain_security/ccv/provider/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@
import "interchain_security/ccv/provider/v1/provider.proto";

// GenesisState defines the CCV provider chain genesis state
message GenesisState {

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "11" with name "consumer_addrs_to_prune" on message "GenesisState" was deleted.

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "12" with name "init_timeout_timestamps" on message "GenesisState" was deleted.

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "13" with name "exported_vsc_send_timestamps" on message "GenesisState" was deleted.

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "3" with name "unbonding_ops" on message "GenesisState" was deleted.

Check failure on line 13 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "4" with name "mature_unbonding_ops" on message "GenesisState" was deleted.
// Reserve 3rd slot for removed unbonding_ops field
reserved 3;

// Reserve 4th slot for removed mature_unbonding_ops field
reserved 4;

// Reserve 11th slot for consumer_addrs_to_prune field
reserved 11;

// Reserve 12th slot for removed init_timeout_timestamps field
reserved 12;

// Reserve 13th slot for removed exported_vsc_send_timestamps field
reserved 13;

// strictly positive and set to 1 (DefaultValsetUpdateID) for a new chain
uint64 valset_update_id = 1;
// empty for a new chain
Expand All @@ -19,11 +34,6 @@
(gogoproto.moretags) = "yaml:\"consumer_states\""
];
// empty for a new chain
repeated interchain_security.ccv.provider.v1.UnbondingOp unbonding_ops = 3
[ (gogoproto.nullable) = false ];
// empty for a new chain
interchain_security.ccv.provider.v1.MaturedUnbondingOps mature_unbonding_ops = 4;
// empty for a new chain
repeated ValsetUpdateIdToHeight valset_update_id_to_height = 5
[ (gogoproto.nullable) = false ];
// empty for a new chain
Expand All @@ -39,21 +49,19 @@
// empty for a new chain
repeated ValidatorByConsumerAddr validators_by_consumer_addr = 10
[ (gogoproto.nullable) = false ];
// empty for a new chain
repeated ConsumerAddrsToPrune consumer_addrs_to_prune = 11
[ (gogoproto.nullable) = false ];

repeated interchain_security.ccv.provider.v1.InitTimeoutTimestamp init_timeout_timestamps = 12
[ (gogoproto.nullable) = false ];

repeated interchain_security.ccv.provider.v1.ExportedVscSendTimestamp exported_vsc_send_timestamps = 13
// empty for a new chain
repeated ConsumerAddrsToPruneV2 consumer_addrs_to_prune_v2 = 14
[ (gogoproto.nullable) = false ];
}

// The provider CCV module's knowledge of consumer state.
//
// Note this type is only used internally to the provider CCV module.
message ConsumerState {

Check failure on line 61 in proto/interchain_security/ccv/provider/v1/genesis.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present field "8" with name "unbonding_ops_index" on message "ConsumerState" was deleted.
// Reserve 8th slot for removed unbonding_ops_index field
reserved 8;

// ChainID defines the chain ID for the consumer chain
string chain_id = 1;
// ChannelID defines the IBC channel ID for the consumer chain
Expand All @@ -70,10 +78,6 @@
repeated interchain_security.ccv.v1.ValidatorSetChangePacketData
pending_valset_changes = 6 [ (gogoproto.nullable) = false ];
repeated string slash_downtime_ack = 7;
// UnbondingOpsIndex defines the unbonding operations waiting on this consumer
// chain
repeated interchain_security.ccv.provider.v1.VscUnbondingOps
unbonding_ops_index = 8 [ (gogoproto.nullable) = false ];
}

// ValsetUpdateIdToHeight defines the genesis information for the mapping
Expand Down
Loading
Loading