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!: enable standalone consumers to reuse existing clients for ICS #2400

Merged
merged 33 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
34409d7
add connection_id to init params
mpoke Nov 4, 2024
d496224
add message validation
mpoke Nov 4, 2024
29c8d9a
add preCCV and connection_id to ProviderInfo
mpoke Nov 4, 2024
85e9a53
move preccv and connId to ConsumerGenesisState
mpoke Nov 5, 2024
0540cbf
fix merge conflicts
mpoke Nov 7, 2024
049dd9e
add provider logic for non-empty connId
mpoke Nov 11, 2024
6c50702
Merge branch 'main' into marius/894-preccv
mpoke Nov 11, 2024
fa189f5
validate consumer genesis
mpoke Nov 13, 2024
81536d8
initiate CCV channel handshake
mpoke Nov 13, 2024
b07b3ab
fix UT
mpoke Nov 13, 2024
940596d
add changelog entries
mpoke Nov 13, 2024
5241586
fix merge conflicts
mpoke Nov 13, 2024
bc51f31
add TODO
mpoke Nov 13, 2024
1fa7866
fix indent
mpoke Nov 13, 2024
c3f1891
Merge branch 'main' into marius/894-preccv
stana-miric Dec 11, 2024
72e4064
changeover test
stana-miric Dec 12, 2024
4e034e1
Merge branch 'main' into marius/894-preccv
stana-miric Dec 23, 2024
d5c766a
remove setting preccv in app.go
mpoke Jan 2, 2025
57503fa
Merge branch 'main' into marius/894-preccv
mpoke Jan 2, 2025
226f710
Merge branch 'main' into marius/894-preccv
mpoke Jan 2, 2025
fad5f5b
add todos for genesis transformation
mpoke Jan 2, 2025
4d59eb2
interchain test desc added to testing.md
stana-miric Jan 6, 2025
7deec2d
update genesis transformation
stana-miric Jan 6, 2025
add1b5e
update changeover procedure docs
mpoke Jan 7, 2025
1dc3ea1
Update docs/docs/consumer-development/changeover-procedure.md
mpoke Jan 7, 2025
75a9826
Update docs/docs/consumer-development/changeover-procedure.md
mpoke Jan 7, 2025
c061b27
Update docs/docs/consumer-development/changeover-procedure.md
mpoke Jan 7, 2025
88f24ea
Update docs/docs/consumer-development/changeover-procedure.md
mpoke Jan 7, 2025
0c378eb
Update docs/docs/consumer-development/changeover-procedure.md
mpoke Jan 7, 2025
015037d
tests: remove unused e2e changeover [replaced by interchaintest]
MSalopek Jan 7, 2025
479421e
apply review suggestions
mpoke Jan 7, 2025
530b52d
Merge branch 'marius/894-preccv' of github.com:cosmos/interchain-secu…
mpoke Jan 7, 2025
36515a2
do not remove preCCV from consumer genesis state
mpoke Jan 7, 2025
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
12 changes: 12 additions & 0 deletions .changelog/unreleased/api-breaking/2400-preccv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- Enable existing (standalone) chains to use the existing client (and connection)
to the provider chain when becoming a consumer chain. This feature introduces
the following API-breaking changes.
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))

- Add `connection_id` and `preCCV` to `ConsumerGenesisState`, the consumer
mpoke marked this conversation as resolved.
Show resolved Hide resolved
genesis state created by the provider chain. If the `connection_id` is not empty,
`preCCV` is set to true and both `provider.client_state` and `provider.consensus_state`
are set to nil (as the consumer doesn't need to create a new provider client).
As a result, for older versions of consumers, the `connection_id` in
`ConsumerInitializationParameters` must be empty and the resulting `ConsumerGenesisState`
needs to be adapted, i.e., both `connection_id` and `preCCV` need to be removed.
13 changes: 13 additions & 0 deletions .changelog/unreleased/features/2400-preccv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- Enable existing (standalone) chains to use the existing client (and connection)
to the provider chain when becoming a consumer chain. This feature introduces
the following changes.
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))

- Add `connection_id` to `ConsumerInitializationParameters`, the ID of
the connection end _on the provider chain_ on top of which the CCV channel will
be established. Consumer chain owners can set `connection_id` to a valid ID in
order to reuse the underlying clients.
- Add `connection_id` to the consumer genesis state, the ID of the connection
end _on the consumer chain_ on top of which the CCV channel will be established.
If `connection_id` is a valid ID, then the consumer chain will use the underlying
client as the provider client and it will initiate the channel handshake.
3 changes: 3 additions & 0 deletions .changelog/unreleased/state-breaking/2400-preccv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Enable existing (standalone) chains to use the existing client (and connection)
to the provider chain when becoming a consumer chain.
([\#2400](https://github.com/cosmos/interchain-security/pull/2400))
37 changes: 19 additions & 18 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

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

| Feature | `v4.0.0` | `v4.4.0` | `v4.5.0` | `v5.0.0` | `v5.2.0` | `v6.1.0` | `v6.3.0` |
|---------|---------:|---------:|---------:|---------:|----------:|---------:|---------:|
| 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` |
|---------|---------:|---------:|---------:|---------:|----------:|---------:|---------:|---------:|
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Reward distribution](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#reward-distribution) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Consumer chain removal](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#consumer-chain-removal) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Key assignment](https://github.com/cosmos/interchain-security/issues/26) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Jail throttling](https://github.com/cosmos/interchain-security/issues/404) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Soft opt-out](https://github.com/cosmos/interchain-security/issues/851) | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
| [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)) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Cryptographic verification of equivocation](https://github.com/cosmos/interchain-security/issues/732) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Jail throttling with retries](https://github.com/cosmos/interchain-security/issues/713) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [ICS epochs](https://cosmos.github.io/interchain-security/adrs/adr-014-epochs) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Partial Set Security](https://cosmos.github.io/interchain-security/adrs/adr-015-partial-set-security) | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ |
| [Inactive Provider Validators](https://cosmos.github.io/interchain-security/adrs/adr-017-allowing-inactive-validators) | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Permissionless](https://cosmos.github.io/interchain-security/adrs/adr-019-permissionless-ics) | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [ICS Rewards in non-native denoms](https://github.com/cosmos/interchain-security/issues/1634) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| [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) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Reward distribution](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/overview_and_basic_concepts.md#reward-distribution) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Consumer chain removal](https://github.com/cosmos/ibc/blob/main/spec/app/ics-028-cross-chain-validation/methods.md#consumer-chain-removal) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Key assignment](https://github.com/cosmos/interchain-security/issues/26) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Jail throttling](https://github.com/cosmos/interchain-security/issues/404) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Soft opt-out](https://github.com/cosmos/interchain-security/issues/851) | ✅ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
| [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)) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Cryptographic verification of equivocation](https://github.com/cosmos/interchain-security/issues/732) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Jail throttling with retries](https://github.com/cosmos/interchain-security/issues/713) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [ICS epochs](https://cosmos.github.io/interchain-security/adrs/adr-014-epochs) | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| [Partial Set Security](https://cosmos.github.io/interchain-security/adrs/adr-015-partial-set-security) | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ |
| [Inactive Provider Validators](https://cosmos.github.io/interchain-security/adrs/adr-017-allowing-inactive-validators) | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| [Permissionless](https://cosmos.github.io/interchain-security/adrs/adr-019-permissionless-ics) | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| [ICS Rewards in non-native denoms](https://github.com/cosmos/interchain-security/issues/1634) | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ |
| [Customizable Slashing and Jailing](https://cosmos.github.io/interchain-security/adrs/adr-020-cutomizable_slashing_and_jailing) | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ test-integration-cov:
go test ./tests/integration/... -timeout 30m -coverpkg=./... -coverprofile=integration-profile.out -covermode=atomic

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

# run mbt tests
test-mbt:
Expand Down
19 changes: 11 additions & 8 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ All missing minor release versions have been discontinued.
| `v5.2.x` | May 9, 2025 |
| `v6.1.x` | Sep 13, 2025 |
| `v6.3.x` | Sep 13, 2025 |
| `v6.4.x` | Sep 13, 2025 |

## Version Matrix

Expand All @@ -80,6 +81,7 @@ Versions of Golang, IBC, Cosmos SDK and CometBFT used by ICS in the currently ac
| [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 | |
| [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 | |
| [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 | |
| [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 | |

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

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

The following table indicates the compatibility of currently active releases:

| Consumer | Provider | `v5.2.0` | `v6.1.0` | `v6.3.0` |
| -------- | -------- | -------- | -------- | -------- |
| `v4.0.0` | | ✅ | ✅ | ✅ (1) |
| `v4.4.0` | | ✅ | ✅ | ✅ (1) |
| `v4.5.0` | | ✅ | ✅ | ✅ |
| `v5.0.0` | | ✅ | ✅ | ✅ (1) |
| `v5.2.0` | | ✅ | ✅ | ✅ (1) |
| `v6.3.0` | | ✅ | ✅ | ✅ |
| Consumer | Provider | `v5.2.0` | `v6.1.0` | `v6.3.0` | `v6.4.0` |
| ------------------- | -------- | -------- | -------- | -------- | -------- |
| `v4.0.0` | | ✅ | ✅ | ✅ (1) | ✅ (1) |
| `v4.4.0` | | ✅ | ✅ | ✅ (1) | ✅ (1) |
| `v4.5.0` | | ✅ | ✅ | ✅ | ✅ (1) |
| `v5.0.0` | | ✅ | ✅ | ✅ (1) | ✅ (1) |
| `v5.2.0` | | ✅ | ✅ | ✅ (1) | ✅ (1) |
| `v6.2.0` / `v6.3.0` | | ✅ | ✅ | ✅ | ✅ (1) |
| `v6.4.0` | | ✅ | ✅ | ✅ | ✅ |

#### Notes
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.
Expand Down
12 changes: 12 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ Notably, as-of-now simulation tests do not include any multi-chain testing, so c
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
related make command listed below.

## Interchain Tests
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.
- If you wish to build the docker image from the code on your desired branch, run this command:
```bash
docker build -t test-image:local .
```

## Running Tests
Tests can be run using `make`:

Expand Down Expand Up @@ -80,6 +87,11 @@ make sim-full

#run simulation tests where providerModule.max_provider_consensus_validators=stakingModule.max_validators=100
make sim-full-no-inactive-vals

#run interchain tests (running with the latest image ghcr.io/cosmos/interchain-security:latest)
make test-interchain
# run interchain tests with specific image(e.g. test-image:local)
make test-interchain PROVIDER_IMAGE_NAME=test-image PROVIDER_IMAGE_TAG=local SOUVEREIGN_IMAGE_NAME=test-image SOUVEREIGN_IMAGE_TAG=local
```

Alternatively you can run tests using `go test`:
Expand Down
2 changes: 0 additions & 2 deletions app/consumer-democracy/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,6 @@ func New(

consumerGenesis := consumertypes.GenesisState{}
appCodec.MustUnmarshalJSON(appState[consumertypes.ModuleName], &consumerGenesis)

consumerGenesis.PreCCV = true
app.ConsumerKeeper.InitGenesis(sdkCtx, &consumerGenesis)

app.Logger().Info("start to run module migrations...")
Expand Down
Loading
Loading