Skip to content

Commit

Permalink
docs: update onboarding guidelines (#2365)
Browse files Browse the repository at this point in the history
* update revision height in docs

* update onboarding guidelines
  • Loading branch information
mpoke authored Oct 18, 2024
1 parent 31a1524 commit 31985a6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/docs/build/modules/02-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ where `update-consumer-msg.json` contains:
"initialization_parameters":{
"initial_height":{
"revision_number": 1,
"revision_height": 0
"revision_height": 1
},
"genesis_hash": "",
"binary_hash": "",
Expand Down
65 changes: 52 additions & 13 deletions docs/docs/consumer-development/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ title: Onboarding Checklist
---
# Consumer Onboarding Checklist

The following checklists will aid in onboarding a new consumer chain to interchain security.
The following checklists will aid in onboarding a new consumer chain to Interchain Security.

Additionally, you can check the [testnet repo](https://github.com/cosmos/testnets/blob/master/interchain-security/CONSUMER_LAUNCH_GUIDE.md) for a comprehensive guide on preparing and launching consumer chains.

## 1. Complete testing & integration

- [ ] test integration with gaia
- [ ] test your protocol with supported relayer versions (minimum hermes 1.4.1)
- [ ] test your protocol with supported relayer versions (minimum hermes 1.10.2)
- [ ] reach out to the ICS team if you are facing issues

## 2. Create an Onboarding Repository
Expand All @@ -20,11 +20,10 @@ To help validators and other node runners onboard onto your chain, please prepar

This should include (at minimum):

- [ ] genesis.json without CCV data (before the proposal passes)
- [ ] genesis.json with CCV data (after spawn time passes). Check if CCV data needs to be transformed (see [Transform Consumer Genesis](./consumer-genesis-transformation.md))
- [ ] genesis.json without the consumer module genesis (before the spawn time passes). **Make sure the genesis time is within the trusting period (i.e., one day before launch time or shorter).**
- [ ] genesis.json with the consumer module genesis (after the spawn time passes). Check if the consumer module genesis needs to be transformed (see [Transform Consumer Genesis](./consumer-genesis-transformation.md))
- [ ] information about relevant seed/peer nodes you are running
- [ ] relayer information (compatible versions)
- [ ] copy of your governance proposal (as JSON)
- [ ] a script showing how to start your chain and connect to peers (optional)
- [ ] take feedback from other developers, validators and community regarding your onboarding repo and make improvements where applicable

Expand All @@ -35,8 +34,8 @@ Example of such a repository can be found [here](https://github.com/hyphacoop/ic
Before you start your chain, you need to submit a `MsgCreateConsumer` message that generates and returns back the
`consumerId` that should be used in any upcoming interactions by the consumer chain or the validators that interact
with your chain.
Additionally, you need to decider whether your chain should be an Opt-In chain or a Top N chain (see [Partial Set Security](../features/partial-set-security.md))
and act accordingly (see [Permissionless ICS](../features/permissionless.md).
Additionally, you need to decide whether your chain should be an Opt-In chain or a Top N chain (see [Partial Set Security](../features/partial-set-security.md))
and act accordingly (see [Permissionless ICS](../features/permissionless.md)).

If you create a Top N chain through, please consider allowing at least a day between your proposal passing and the chain spawn time.
This will allow the validators, other node operators and the community to prepare for the chain launch.
Expand All @@ -57,9 +56,9 @@ Example of initialization parameters:
// ConsumerInitializationParameters provided in MsgCreateConsumer or MsgUpdateConsumer
{
// Initial height of new consumer chain.
// For a completely new chain, this will be {0,1}.
// For a completely new chain, this will be {1,1}.
"initial_height" : {
"revision_height": 0,
"revision_height": 1,
"revision_number": 1,
},
// Hash of the consumer chain genesis state without the consumer CCV module genesis params.
Expand Down Expand Up @@ -120,9 +119,9 @@ Example of power-shaping parameters:
"validator_set_cap": 0,
// Corresponds to a list of provider consensus addresses of validators that are the ONLY ones that can validate
// the consumer chain.
"allowlist": ["cosmosvalcons1l9qq4m300z8c5ez86ak2mp8znftewkwgjlxh88"],
"allowlist": ["cosmosvalcons..."],
// Corresponds to a list of provider consensus addresses of validators that CANNOT validate the consumer chain.
"denylist": [],
"denylist": ["cosmosvalcons..."],
// Corresponds to the minimal amount of (provider chain) stake required to validate on the consumer chain.
"min_stake": 0,
// Corresponds to whether inactive validators are allowed to validate the consumer chain.
Expand All @@ -138,13 +137,53 @@ Example of allowlisted reward denoms:
}
```

:::caution
For opt-in consumer chains, make sure that at least one validator opts in before the spawn time elapses.
Otherwise the launch process will be aborted and the spawn time needs to be updated by submitting a `MsgUpdateConsumer` message.
:::

## 4. Launch

The consumer chain starts after at least 66.67% of its voting power comes online.
Note that this means 66.67% of the voting power in the *consumer* validator set, which will be comprised of all validators that either opted in to the chain or are part of the top N% of the provider chain (and are thus automatically opted in).
The consumer chain is considered interchain secured once the appropriate CCV channels are established and the first validator set update is propagated from the provider to the consumer

- [ ] provide a repo with onboarding instructions for validators (it should already be listed in the proposal)
- [ ] genesis.json with ccv data populated (MUST contain the initial validator set)
- [ ] provide a repo with onboarding instructions for validators
- [ ] genesis.json with the consumer module section populated (MUST contain the initial validator set)
- [ ] maintenance & emergency contact info (relevant discord, telegram, slack or other communication channels)
- [ ] have a block explorer in place to track chain activity & health

### Establish CCV channel

Once the consumer chain is launched, the CCV channel needs to be established. The following instructions are setting both the connection and channel using Hermes:

```bash
#!/bin/bash

# CONSUMER_CLIENT_ID is created on CONSUMER upon genesis
CONSUMER_CLIENT_ID="<consumer-client-id>"
CONSUMER_CHAIN_ID="<consumer-chain-id>"

# PROVIDER_CLIENT_ID is created on PROVIDER upon CONSUMER spawn time: gaiad q provider list-consumer-chains
PROVIDER_CLIENT_ID="<provider-client-id>"
PROVIDER_CHAIN_ID="<provider-chain-id>"

CONFIG=$1
if [ -z "$CONFIG" ]; then
CONFIG=$HOME/.hermes/config.toml
fi
if [ ! -f "$CONFIG" ]; then
echo "no config file found at $CONFIG"
exit 1
fi

output=$(hermes --json --config $CONFIG create connection --a-chain $CONSUMER_CHAIN_ID --a-client $CONSUMER_CLIENT_ID --b-client $PROVIDER_CLIENT_ID | tee /dev/tty)
json_output=$(echo "$output" | grep 'result')
a_side_connection_id=$(echo "$json_output" | jq -r '.result.a_side.connection_id')
output=$(hermes --json --config $CONFIG create channel --a-chain $CONSUMER_CHAIN_ID --a-port consumer --b-port provider --order ordered --a-connection $a_side_connection_id --channel-version 1 | tee /dev/tty)
json_output=$(echo "$output" | grep 'result')
echo "---- DONE ----"
echo "$json_output" | jq

# hermes start
```
4 changes: 2 additions & 2 deletions x/ccv/provider/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ where create_consumer.json has the following structure:
"initialization_parameters": {
"initial_height": {
"revision_number": 1,
"revision_height": 0
"revision_height": 1
},
"genesis_hash": "",
"binary_hash": "",
Expand Down Expand Up @@ -332,7 +332,7 @@ where update_consumer.json has the following structure:
"initialization_parameters": {
"initial_height": {
"revision_number": 1,
"revision_height": 0
"revision_height": 1
},
"genesis_hash": "",
"binary_hash": "",
Expand Down

0 comments on commit 31985a6

Please sign in to comment.