Skip to content
Open
Changes from 11 commits
Commits
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
153 changes: 38 additions & 115 deletions releases/cosmwasm/EVM-CosmWasm-Release-Template.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,48 +61,19 @@ Gateway (v1.1.1) -> "storeCodeProposalCodeHash": "2ba600ee0d162184c9387eaf6fad65
MultisigProver (v1.1.1) -> "storeCodeProposalCodeHash": "00428ef0483f103a6e1a5853c4b29466a83e5b180cc53a00d1ff9d022bc2f03a"
```

- Add config in `$ENV.json` to deploy Amplifier contracts.

| Network | `governanceAddress` | `adminAddress` |
| Network | `GOVERNANCE_ADDRESS` | `MULTISIG_ADMIN_ADDRESS` |
| -------------------- | ----------------------------------------------- | ----------------------------------------------- |
| **Devnet-amplifier** | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` | `axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9` |
| **Stagenet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1l7vz4m5g92kvga050vk9ycjynywdlk4zhs07dv` |
| **Testnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` |
| **Mainnet** | `axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj` | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` |

| Network | `serviceName` | `votingThreshold` | `signingThreshold` | `confirmationHeight` |
| -------------------- | ------------- | ----------------- | ------------------ | -------------------- |
| **Devnet-amplifier** | `validators` | `["6", "10"]` | `["6", "10"]` | `1` |
| **Stagenet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | `1` |
| **Testnet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | `1` |
| **Mainnet** | `amplifier` | `["2", "3"]` | `["2", "3"]` | `1` |

```bash
# Add under `config.axelar.contracts.VotingVerifier` based on Network
"$CHAIN" : {
"governanceAddress": "[governance address]",
"serviceName": "[service name]",
"sourceGatewayAddress": "[external gateway address]",
"votingThreshold": "[voting threshold]",
"blockExpiry": 10,
"confirmationHeight": 1000000, # if $CHAIN uses a custom finality mechanism such as the "finalized" tag, set this value very high (i.e. 1000000) to prevent accidental use
"msgIdFormat": "hex_tx_hash_and_event_index",
"addressFormat": "eip55"
}

# Add under `config.axelar.contracts.MultisigProver` based on Network
"$CHAIN" : {
"governanceAddress": "[governance address]",
"adminAddress": "[admin address]",
"signingThreshold": "[signing threshold]",
"serviceName": "[service name]",
"verifierSetDiffThreshold": 0,
"encoder": "abi",
"keyType": "ecdsa"
}
Comment on lines -81 to -102
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing these. There are certain configuration that still need to be published and the scripts dont do that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's covered by the new script

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • see the ts-node cosmwasm/coordinator.ts instantiate command below. It is automatically saved in the config file

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont agree with this approach, in the new scripts and PR you have set constant DEFAULT value that only matches testnet, but you can see that the values are not equivalent across all the environments so this would make it harder for deployer since now they need to still pass values in manually.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User can override the DEFAULT values by using CLI options - everything can be updated when using a single CLI command. The default values were taken directly from this document. We can always remove them and make the options required to be provided by a user

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the new configure command

```

### Instantiate Amplifier contracts
| Network | `SERVICE_NAME` | `VOTING_THRESHOLD` | `SIGNING_THRESHOLD` | `CONFIRMATION_HEIGHT` |
| -------------------- | -------------- | ------------------ | ------------------- | --------------------- |
| **Devnet-amplifier** | `validators` | `["6", "10"]` | `["6", "10"]` | `1` |
| **Stagenet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | `1` |
| **Testnet** | `amplifier` | `["51", "100"]` | `["51", "100"]` | `1` |
| **Mainnet** | `amplifier` | `["2", "3"]` | `["2", "3"]` | `1` |

| Network | `CONTRACT_ADMIN` |
| -------------------- | ----------------------------------------------- |
Expand All @@ -113,25 +84,29 @@ MultisigProver (v1.1.1) -> "storeCodeProposalCodeHash": "00428ef0483f103a6e1a585

`CONTRACT_ADMIN` is the wasm contract admin address for contract upgrades.

1. Instantiate `VotingVerifier`

```bash
ts-node ./cosmwasm/deploy-contract.js instantiate -c VotingVerifier --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN
```

2. Instantiate `Gateway`
1. Instantiate **Gateway**, **Verifier** and **Prover** contracts using **Coordinator**

```bash
ts-node ./cosmwasm/deploy-contract.js instantiate -c Gateway --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN
ts-node cosmwasm/coordinator.ts instantiate \
--contract-admin "$CONTRACT_ADMIN" \
--multisig-admin "$MULTISIG_ADMIN_ADDRESS" \
--service-name "$SERVICE_NAME" \
--voting-threshold "$VOTING_THRESHOLD" \
--signing-threshold "$SIGNING_THRESHOLD" \
--confirmation-height "$CONFIRMATION_HEIGHT" \
--source-gateway-address "$SOURCE_GATEWAY_ADDRESS" \
--governance-address "$GOVERNANCE_ADDRESS" \
--run-as "$GOVERNANCE_ADDRESS"
```

3. Instantiate `MultisigProver`

2. Register the new chain in the **Coordinator** contract:
```bash
ts-node ./cosmwasm/deploy-contract.js instantiate -c MultisigProver --fetchCodeId --instantiate2 --admin $CONTRACT_ADMIN
ts-node cosmwasm/coordinator.ts register-deployment \
--run-as "$GOVERNANCE_ADDRESS"
```

4. Set environment variables
3. Set environment variables

- These variables are network-specific

Expand All @@ -153,68 +128,15 @@ ROUTER=$(cat ./axelar-chains-config/info/$ENV.json | jq .axelar.contracts.Router
| **Testnet** | `axelar17qafmnc4hrfa96cq37wg5l68sxh354pj6eky35` | `1000000uaxl` |
| **Mainnet** | `axelar1pczf792wf3p3xssk4dmwfxrh6hcqnrjp70danj` | `1000000uaxl` |

```bash
PROVER_ADMIN=[prover admin who is responsible for the contract's operations]
REWARD_AMOUNT=[reward amount]
EPOCH_DURATION=[epoch duration according to the environment]
```

- Add a community post for the mainnet proposal. i.e: https://community.axelar.network/t/proposal-add-its-hub-to-mainnet/3227
- Note: [ITS proposal](../evm/EVM-ITS-Release-Template.md) should also be submitted at this time if possible.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this step is already in the guide here, as step 10 (now step 6)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored a little bit the - Note: all the following governance proposals should be submitted at one time so deployment doesn't get held up while waiting for voting. [ITS proposal](../evm/EVM-ITS-Release-Template.md) should also be submitted at this time if possible. note. It says that we can proceed with ITS in parallel, though I didn't check if that makes sense - only wanted to keep it as it was

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just add the instruction to go to step 6 for the proposal instructions rather than linking the external guide

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the EVM-ITS-Release-Template.md and it seems that the doc and the step.7 are something different. This should be analyzed from the ITS perspective once again


- Note: all the following governance proposals should be submitted at one time so deployment doesn't get held up while waiting for voting. [ITS proposal](../evm/EVM-ITS-Release-Template.md) should also be submitted at this time if possible.

5. Register Gateway at the Router

```bash
ts-node cosmwasm/submit-proposal.js execute \
-c Router \
-t "Register Gateway for $CHAIN" \
-d "Register Gateway address for $CHAIN at Router contract" \
--msg "{
\"register_chain\": {
\"chain\": \"$CHAIN\",
\"gateway_address\": \"$GATEWAY\",
\"msg_id_format\": \"hex_tx_hash_and_event_index\"
}
}"
```

6. Register prover contract on coordinator

```bash
ts-node cosmwasm/submit-proposal.js execute \
-c Coordinator \
-t "Register Multisig Prover for $CHAIN" \
-d "Register Multisig Prover address for $CHAIN at Coordinator contract" \
--msg "{
\"register_prover_contract\": {
\"chain_name\": \"$CHAIN\",
\"new_prover_addr\": \"$MULTISIG_PROVER\"
}
}"
```

7. Authorize `$CHAIN` Multisig Prover on Multisig

```bash
ts-node cosmwasm/submit-proposal.js execute \
-c Multisig \
-t "Authorize Multisig Prover for $CHAIN" \
-d "Authorize Multisig Prover address for $CHAIN at Multisig contract" \
--msg "{
\"authorize_callers\": {
\"contracts\": {
\"$MULTISIG_PROVER\": \"$CHAIN\"
}
}
}"
```

8. Create reward pool for voting verifier
4. Create reward pool for voting verifier

#### Rewards

| Network | `epoch_duration` | `participation_threshold` | `rewards_per_epoch` |
| Network | `EPOCH_DURATION` | `PARTICIPATION_THRESHOLD` | `REWARDS_PER_EPOCH` |
| -------------------- | ---------------- | ------------------------- | ------------------- |
| **Devnet-amplifier** | `100` | `[\"7\", \"10\"]` | `100` |
| **Stagenet** | `600` | `[\"7\", \"10\"]` | `100` |
Expand All @@ -230,8 +152,8 @@ ts-node cosmwasm/submit-proposal.js execute \
\"create_pool\": {
\"params\": {
\"epoch_duration\": \"$EPOCH_DURATION\",
\"participation_threshold\": [participation threshold],
\"rewards_per_epoch\": \"[rewards per epoch]\"
\"participation_threshold\": \"$PARTICIPATION_THRESHOLD\",
\"rewards_per_epoch\": \"$REWARDS_PER_EPOCH\"
},
\"pool_id\": {
\"chain_name\": \"$CHAIN\",
Expand All @@ -241,7 +163,8 @@ ts-node cosmwasm/submit-proposal.js execute \
}"
```

9. Create reward pool for multisig

5. Create reward pool for multisig

```bash
ts-node cosmwasm/submit-proposal.js execute \
Expand All @@ -252,8 +175,8 @@ ts-node cosmwasm/submit-proposal.js execute \
\"create_pool\": {
\"params\": {
\"epoch_duration\": \"$EPOCH_DURATION\",
\"participation_threshold\": [participation threshold],
\"rewards_per_epoch\": \"[rewards per epoch]\"
\"participation_threshold\": \"$PARTICIPATION_THRESHOLD\",
\"rewards_per_epoch\": \"$REWARDS_PER_EPOCH\"
},
\"pool_id\": {
\"chain_name\": \"$CHAIN\",
Expand All @@ -263,7 +186,7 @@ ts-node cosmwasm/submit-proposal.js execute \
}"
```

10. Register ITS edge contract on ITS Hub
6. Register ITS edge contract on ITS Hub

Proceed with this step only if ITS deployment on $CHAIN is confirmed. Add the following to `contracts` in the `$CHAIN` config within `ENV.json`:

Expand Down Expand Up @@ -291,15 +214,15 @@ ts-node cosmwasm/submit-proposal.js \

- Please remove this temporary config after submitting the proposal and reset contracts to an empty object.

11. Add funds to reward pools from a wallet containing the reward funds `$REWARD_AMOUNT`
7. Add funds to reward pools from a wallet containing the reward funds `$REWARD_AMOUNT`

```bash
axelard tx wasm execute $REWARDS "{ \"add_rewards\": { \"pool_id\": { \"chain_name\": \"$CHAIN\", \"contract\": \"$MULTISIG\" } } }" --amount $REWARD_AMOUNT --from $WALLET

axelard tx wasm execute $REWARDS "{ \"add_rewards\": { \"pool_id\": { \"chain_name\": \"$CHAIN\", \"contract\": \"$VOTING_VERIFIER\" } } }" --amount $REWARD_AMOUNT --from $WALLET
```

12. Confirm proposals have passed
8. Confirm proposals have passed

- Check proposals on block explorer (i.e. https://axelarscan.io/proposals)
- "Register Gateway for `$CHAIN`"
Expand Down Expand Up @@ -340,7 +263,7 @@ axelard q wasm contract-state smart $MULTISIG "{\"is_caller_authorized\": {\"con
ts-node cosmwasm/query.js rewards -n $CHAIN
```

13. Update `ampd` with the `$CHAIN` chain configuration. Verifiers should use their own `$CHAIN` RPC node for the `http_url` in production.
9. Update `ampd` with the `$CHAIN` chain configuration. Verifiers should use their own `$CHAIN` RPC node for the `http_url` in production.

| Network | `http_url` |
| -------------------- | ----------------- |
Expand Down Expand Up @@ -370,13 +293,13 @@ cosmwasm_contract="$VOTING_VERIFIER"
type="EvmVerifierSetVerifier"
```

14. Update `ampd` with the `$CHAIN` chain configuration.
10. Update `ampd` with the `$CHAIN` chain configuration.

```bash
ampd register-chain-support "[service name]" $CHAIN
ampd register-chain-support "$SERVICE_NAME" $CHAIN
```

15. Create genesis verifier set
11. Create genesis verifier set

Note that this step can only be run once a sufficient number of verifiers have registered.

Expand Down