Skip to content

Commit d56af59

Browse files
mpokestana-miricMSalopek
authored
feat!: enable standalone consumers to reuse existing clients for ICS (#2400)
* add connection_id to init params * add message validation * add preCCV and connection_id to ProviderInfo * move preccv and connId to ConsumerGenesisState * add provider logic for non-empty connId * validate consumer genesis * initiate CCV channel handshake * fix UT * add changelog entries * add TODO * fix indent * changeover test * remove setting preccv in app.go * add todos for genesis transformation * interchain test desc added to testing.md * update genesis transformation * update changeover procedure docs * Update docs/docs/consumer-development/changeover-procedure.md Co-authored-by: MSalopek <[email protected]> * Update docs/docs/consumer-development/changeover-procedure.md Co-authored-by: MSalopek <[email protected]> * Update docs/docs/consumer-development/changeover-procedure.md Co-authored-by: MSalopek <[email protected]> * Update docs/docs/consumer-development/changeover-procedure.md Co-authored-by: MSalopek <[email protected]> * Update docs/docs/consumer-development/changeover-procedure.md Co-authored-by: MSalopek <[email protected]> * tests: remove unused e2e changeover [replaced by interchaintest] * apply review suggestions * do not remove preCCV from consumer genesis state --------- Co-authored-by: stana-ethernal <[email protected]> Co-authored-by: MSalopek <[email protected]>
1 parent d1072eb commit d56af59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1992
-3004
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- Enable existing (standalone) chains to use the existing client (and connection)
2+
to the provider chain when becoming a consumer chain. This feature introduces
3+
the following API-breaking changes.
4+
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))
5+
6+
- Add `connection_id` and `preCCV` to `ConsumerGenesisState`, the consumer
7+
genesis state created by the provider chain. If the `connection_id` is not empty,
8+
`preCCV` is set to true and both `provider.client_state` and `provider.consensus_state`
9+
are set to nil (as the consumer doesn't need to create a new provider client).
10+
As a result, for older versions of consumers, the `connection_id` in
11+
`ConsumerInitializationParameters` must be empty and the resulting `ConsumerGenesisState`
12+
needs to be adapted, i.e., both `connection_id` and `preCCV` need to be removed.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- Enable existing (standalone) chains to use the existing client (and connection)
2+
to the provider chain when becoming a consumer chain. This feature introduces
3+
the following changes.
4+
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))
5+
6+
- Add `connection_id` to `ConsumerInitializationParameters`, the ID of
7+
the connection end _on the provider chain_ on top of which the CCV channel will
8+
be established. Consumer chain owners can set `connection_id` to a valid ID in
9+
order to reuse the underlying clients.
10+
- Add `connection_id` to the consumer genesis state, the ID of the connection
11+
end _on the consumer chain_ on top of which the CCV channel will be established.
12+
If `connection_id` is a valid ID, then the consumer chain will use the underlying
13+
client as the provider client and it will initiate the channel handshake.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Enable existing (standalone) chains to use the existing client (and connection)
2+
to the provider chain when becoming a consumer chain.
3+
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))

FEATURES.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22

33
The following table indicates the major ICS features available in the [currently active releases](./RELEASES.md#version-matrix):
44

5-
| Feature | `v4.0.0` | `v4.4.0` | `v4.5.0` | `v5.0.0` | `v5.2.0` | `v6.1.0` | `v6.3.0` |
6-
|---------|---------:|---------:|---------:|---------:|----------:|---------:|---------:|
5+
| Feature | `v4.0.0` | `v4.4.0` | `v4.5.0` | `v5.0.0` | `v5.2.0` | `v6.1.0` | `v6.3.0` | `v6.4.0` |
6+
|---------|---------:|---------:|---------:|---------:|----------:|---------:|---------:|---------:|
77
| [Channel initialization: new chains](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#channel-initialization-new-chains) ||||||||
8-
| [Validator set update](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#validator-set-update) ||||||||
9-
| [Completion of unbonding operations](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#completion-of-unbonding-operations) ||||||||
10-
| [Consumer initiated slashing](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#consumer-initiated-slashing) ||||||||
11-
| [Reward distribution](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#reward-distribution) ||||||||
12-
| [Consumer chain removal](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#consumer-chain-removal) ||||||||
13-
| [Key assignment](https://github.com/cosmos/interchain-security/issues/26) ||||||||
14-
| [Jail throttling](https://github.com/cosmos/interchain-security/issues/404) ||||||||
15-
| [Soft opt-out](https://github.com/cosmos/interchain-security/issues/851) ||||||||
16-
| [Channel initialization: existing chains](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#channel-initialization-existing-chains) (aka [Standalone to consumer changeover](https://github.com/cosmos/interchain-security/issues/756)) ||||||||
17-
| [Cryptographic verification of equivocation](https://github.com/cosmos/interchain-security/issues/732) ||||||||
18-
| [Jail throttling with retries](https://github.com/cosmos/interchain-security/issues/713) ||||||||
19-
| [ICS epochs](https://cosmos.github.io/interchain-security/adrs/adr-014-epochs) ||||||||
20-
| [Partial Set Security](https://cosmos.github.io/interchain-security/adrs/adr-015-partial-set-security) ||||||||
21-
| [Inactive Provider Validators](https://cosmos.github.io/interchain-security/adrs/adr-017-allowing-inactive-validators) ||||||||
22-
| [Permissionless](https://cosmos.github.io/interchain-security/adrs/adr-019-permissionless-ics) ||||||||
23-
| [ICS Rewards in non-native denoms](https://github.com/cosmos/interchain-security/issues/1634) ||||||||
8+
| [Validator set update](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#validator-set-update) |||||||||
9+
| [Completion of unbonding operations](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#completion-of-unbonding-operations) |||||||||
10+
| [Consumer initiated slashing](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#consumer-initiated-slashing) |||||||||
11+
| [Reward distribution](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#reward-distribution) |||||||||
12+
| [Consumer chain removal](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#consumer-chain-removal) |||||||||
13+
| [Key assignment](https://github.com/cosmos/interchain-security/issues/26) |||||||||
14+
| [Jail throttling](https://github.com/cosmos/interchain-security/issues/404) |||||||||
15+
| [Soft opt-out](https://github.com/cosmos/interchain-security/issues/851) |||||||||
16+
| [Channel initialization: existing chains](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#channel-initialization-existing-chains) (aka [Standalone to consumer changeover](https://github.com/cosmos/interchain-security/issues/756)) |||||||||
17+
| [Cryptographic verification of equivocation](https://github.com/cosmos/interchain-security/issues/732) |||||||||
18+
| [Jail throttling with retries](https://github.com/cosmos/interchain-security/issues/713) |||||||||
19+
| [ICS epochs](https://cosmos.github.io/interchain-security/adrs/adr-014-epochs) |||||||||
20+
| [Partial Set Security](https://cosmos.github.io/interchain-security/adrs/adr-015-partial-set-security) |||||||||
21+
| [Inactive Provider Validators](https://cosmos.github.io/interchain-security/adrs/adr-017-allowing-inactive-validators) |||||||||
22+
| [Permissionless](https://cosmos.github.io/interchain-security/adrs/adr-019-permissionless-ics) |||||||||
23+
| [ICS Rewards in non-native denoms](https://github.com/cosmos/interchain-security/issues/1634) |||||||||
24+
| [Customizable Slashing and Jailing](https://cosmos.github.io/interchain-security/adrs/adr-020-cutomizable_slashing_and_jailing) |||||||||

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ test-integration-cov:
5353
go test ./tests/integration/... -timeout 30m -coverpkg=./... -coverprofile=integration-profile.out -covermode=atomic
5454

5555
# run interchain tests
56-
# we can use PROVIDER_IMAGE_TAG and PROVIDER_IMAGE_NAME to run tests with a desired docker image,
57-
# including a locally built one that, for example, contains some of our changes that are not yet on the main branch.
58-
# if not provided, default value for PROVIDER_IMAGE_TAG is "latest" and for PROVIDER_IMAGE_NAME "ghcr.io/cosmos/interchain-security"
56+
# we can use PROVIDER_IMAGE_TAG, PROVIDER_IMAGE_NAME, SOUVEREIGN_IMAGE_TAG, and SOUVEREIGN_IMAGE_NAME to run tests with desired docker images,
57+
# including locally built ones that, for example, contain some of our changes that are not yet on the main branch.
58+
# if not provided, default value for PROVIDER_IMAGE_TAG and SOUVEREIGN_IMAGE_TAG is "latest" and for PROVIDER_IMAGE_NAME
59+
# and SOUVEREIGN_IMAGE_NAME is "ghcr.io/cosmos/interchain-security"
5960
test-interchain:
60-
cd tests/interchain && PROVIDER_IMAGE_NAME=$(PROVIDER_IMAGE_NAME) PROVIDER_IMAGE_TAG=$(PROVIDER_IMAGE_TAG) go test ./... -timeout 30m
61+
cd tests/interchain && \
62+
PROVIDER_IMAGE_NAME=$(PROVIDER_IMAGE_NAME) \
63+
PROVIDER_IMAGE_TAG=$(PROVIDER_IMAGE_TAG) \
64+
SOUVEREIGN_IMAGE_NAME=$(SOUVEREIGN_IMAGE_NAME) \
65+
SOUVEREIGN_IMAGE_TAG=$(SOUVEREIGN_IMAGE_TAG) \
66+
go test ./... -timeout 30m
6167

6268
# run mbt tests
6369
test-mbt:

RELEASES.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ All missing minor release versions have been discontinued.
6666
| `v5.2.x` | May 9, 2025 |
6767
| `v6.1.x` | Sep 13, 2025 |
6868
| `v6.3.x` | Sep 13, 2025 |
69+
| `v6.4.x` | Sep 13, 2025 |
6970

7071
## Version Matrix
7172

@@ -80,6 +81,7 @@ Versions of Golang, IBC, Cosmos SDK and CometBFT used by ICS in the currently ac
8081
| [v5.2.0](https://github.com/cosmos/interchain-security/releases/tag/v5.2.0) | 1.22 | v8.3.2 | v0.50.8 | v0.38.9 | |
8182
| [v6.1.0](https://github.com/cosmos/interchain-security/releases/tag/v6.1.0) | 1.22 | v8.5.0 | v0.50.9 | v0.38.11 | |
8283
| [v6.3.0](https://github.com/cosmos/interchain-security/releases/tag/v6.3.0) | 1.22 | v8.5.1 | v0.50.9 | v0.38.11 | |
84+
| [v6.4.0](https://github.com/cosmos/interchain-security/releases/tag/v6.4.0) | 1.22 | v8.5.2 | v0.50.11 | v0.38.15 | |
8385

8486
**Note:** For a list of major ICS features available in the currently active releases, see [FEATURES.md](./FEATURES.md).
8587

@@ -89,14 +91,15 @@ A MAJOR version of ICS will always be backwards compatible with the previous MAJ
8991

9092
The following table indicates the compatibility of currently active releases:
9193

92-
| Consumer | Provider | `v5.2.0` | `v6.1.0` | `v6.3.0` |
93-
| -------- | -------- | -------- | -------- | -------- |
94-
| `v4.0.0` | ||| ✅ (1) |
95-
| `v4.4.0` | ||| ✅ (1) |
96-
| `v4.5.0` | ||||
97-
| `v5.0.0` | ||| ✅ (1) |
98-
| `v5.2.0` | ||| ✅ (1) |
99-
| `v6.3.0` | ||||
94+
| Consumer | Provider | `v5.2.0` | `v6.1.0` | `v6.3.0` | `v6.4.0` |
95+
| ------------------- | -------- | -------- | -------- | -------- | -------- |
96+
| `v4.0.0` | ||| ✅ (1) | ✅ (1) |
97+
| `v4.4.0` | ||| ✅ (1) | ✅ (1) |
98+
| `v4.5.0` | |||| ✅ (1) |
99+
| `v5.0.0` | ||| ✅ (1) | ✅ (1) |
100+
| `v5.2.0` | ||| ✅ (1) | ✅ (1) |
101+
| `v6.2.0` / `v6.3.0` | |||| ✅ (1) |
102+
| `v6.4.0` | |||||
100103

101104
#### Notes
102105
The following adjustments must be made to the CCV consumer genesis state that is obtained from the provider chain after the spawn time is reached in order for the consumer chain to start without errors.

TESTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ Notably, as-of-now simulation tests do not include any multi-chain testing, so c
4444
To test compatibility between different provider and consumer versions the [E2E tests](tests/e2e/) were extended by compatibility tests. The test cases perform basic sanity tests against the selected provider and consumer versions. A selected combination of provider and consumer versions are tested on a nightly bases and can be run locally with the
4545
related make command listed below.
4646

47+
## Interchain Tests
48+
The interchain tests evaluate the fundamental functionalities of both the provider and provider-consumer chains. This includes testing the transition of a sovereign chain to a consumer chain. These tests leverage the interchain framework, where each chain node operates within its own Docker container.To execute these tests, you can use the default ics image built from the latest code on the main branch. Alternatively, tests can be run with a specific image and version, whether published or locally built. The tests are triggered using the make test-interchain command. For more details, see the [Running Tests](#running-tests) section.
49+
- If you wish to build the docker image from the code on your desired branch, run this command:
50+
```bash
51+
docker build -t test-image:local .
52+
```
53+
4754
## Running Tests
4855
Tests can be run using `make`:
4956

@@ -80,6 +87,11 @@ make sim-full
8087

8188
#run simulation tests where providerModule.max_provider_consensus_validators=stakingModule.max_validators=100
8289
make sim-full-no-inactive-vals
90+
91+
#run interchain tests (running with the latest image ghcr.io/cosmos/interchain-security:latest)
92+
make test-interchain
93+
# run interchain tests with specific image(e.g. test-image:local)
94+
make test-interchain PROVIDER_IMAGE_NAME=test-image PROVIDER_IMAGE_TAG=local SOUVEREIGN_IMAGE_NAME=test-image SOUVEREIGN_IMAGE_TAG=local
8395
```
8496

8597
Alternatively you can run tests using `go test`:

app/consumer-democracy/app.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,6 @@ func New(
689689

690690
consumerGenesis := consumertypes.GenesisState{}
691691
appCodec.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis)
692-
693-
consumerGenesis.PreCCV = true
694692
app.ConsumerKeeper.InitGenesis(sdkCtx, &consumerGenesis)
695693

696694
app.Logger().Info("start to run module migrations...")

0 commit comments

Comments
 (0)