From 84cf0b638552f419df89a82cad8f4fed5ff70e55 Mon Sep 17 00:00:00 2001 From: Marty <149421156+ffe9f8@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:20:42 +0200 Subject: [PATCH] feat: integrator governance proposal doc (#1027) --- src/layouts/navigation.ts | 4 + .../governance-proposals.mdx | 232 ++++++++++++++++++ src/pages/learn/cosmwasm-governance.md | 150 ----------- 3 files changed, 236 insertions(+), 150 deletions(-) create mode 100644 src/pages/dev/amplifier/chain-integration/governance-proposals.mdx delete mode 100644 src/pages/learn/cosmwasm-governance.md diff --git a/src/layouts/navigation.ts b/src/layouts/navigation.ts index 3315a86d3..1219fa786 100644 --- a/src/layouts/navigation.ts +++ b/src/layouts/navigation.ts @@ -239,6 +239,10 @@ export const getNavigation = (section) => { title: "Integrate a Chain", href: "/dev/amplifier/chain-integration/integrate-a-chain", }, + { + title: "Governance Proposals", + href: "/dev/amplifier/chain-integration/governance-proposals", + }, { title: "Add Rewards", href: "/dev/amplifier/add-rewards", diff --git a/src/pages/dev/amplifier/chain-integration/governance-proposals.mdx b/src/pages/dev/amplifier/chain-integration/governance-proposals.mdx new file mode 100644 index 000000000..2d37c285a --- /dev/null +++ b/src/pages/dev/amplifier/chain-integration/governance-proposals.mdx @@ -0,0 +1,232 @@ +# Chain Integration Governance Proposals + +import { Callout } from "/src/components/callout" + +New chains are onboarded to the Axelar Amplifier through [community governance](/resources/community/community-pool-proposals). In general, you will need to submit five governance proposals to integrate your chain: + +- Proposal to instantiate the verifier contract +- Proposal to instantiate the gateway contract +- Proposal to instantiate the prover contract +- Proposal to register your chain with the router +- Proposal to authorize your prover with the [Amplifier multisig contract](https://github.com/axelarnetwork/axelar-amplifier/blob/main/contracts/multisig/src/msg.rs) + +For example, EVM chain integrators should be using an `instantiate-contract` proposal to use existing `code_id`s, but teams with customized contract needs should use a `store-instantiate` proposal to both store and instantiate their custom code. + +## Prerequisites + +- Access to the [Axelar command-line interface](/learn/cli) +- 2,000 AXL for each proposal, either from your [own wallet](/resources/community/community-pool-proposals#create-a-local-wallet) or through a community member who can fund the proposal within one hour of posting +- A running [RPC endpoint](/resources/rpc/resources) or [Axelar node](/node/config-node) +- Experience with the appropriate Amplifier CosmWasm contracts and interfaces for integrating a chain (i.e. completed the [Integrate a Chain](/dev/amplifier/chain-integration/integrate-a-chain) tutorial) + +## Community Forum introduction + +You will need to introduce your chain to the community in order for Axelar token holders to vote for your proposals. This should be done on the governance section of the [Axelar Community Forum](https://community.axelar.network/c/governance2/33). Make a community introduction post that precedes and can be referenced by any on-chain proposals. It should include the following information: + +- Background +- Governance details +- Pre-deployed source chain gateway address +- Plan for funding rewards pools + +All of your on-chain proposals will refer back to this introduction, so make sure to be thorough. You should stay present and engage with any questions or comments during the seven-day feedback period, which can include public comments as well as a security council review. When the feedback period is over, submit your on-chain governance proposals to finish the integration of your chain. + + +Examples were created with contracts on the `ethereum-sepolia` chain. Please refer to [`devnet-amplifier.json`](https://github.com/axelarnetwork/axelar-contract-deployments/blob/main/axelar-chains-config/info/devnet-amplifier.json) for contracts associated with other chains. + + +## Proposal to instantiate the verifier contract + + + + + +If you are integrating an EVM chain, you can submit a proposal to instantiate the pre-deployed voting verifier contract with the [proper instantiation parameters](https://github.com/axelarnetwork/axelar-amplifier/blob/deab56a75209a158c082cbf9b77caf500eb4ec7c/contracts/voting-verifier/src/msg.rs#L9) using its existing `code_id` (`500`): + +```bash +export CODE_ID=500 +export NETWORK_GOV_ADDRESS="axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj" +export RPC="http://devnet-amplifier.axelar.dev:26657" +``` + +```bash +axelard tx gov submit-proposal instantiate-contract $CODE_ID \ +'{ + "governance_address": "axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj", + "service_registry_address": "axelar1c9fkszt5lq34vvvlat3fxj6yv7ejtqapz04e97vtc9m5z9cwnamq8zjlhz", + "service_name":"validators", + "source_gateway_address":"0xeE9E463Fd8bE9AF266e1B143C27F7D42648f4006", + "voting_threshold":["1","1"], + "block_expiry":10, + "confirmation_height":1, + "source_chain":"ethereum-sepolia", +"rewards_address":"axelar1vaj9sfzc3z0gpel90wu4ljutncutv0wuhvvwfsh30rqxq422z89qnd989l", + "msg_id_format":"hex_tx_hash_and_event_index" +}' \ +--title="Instantiate verifier contract for [chain name]" \ +--description="Instantiate verifier contract for [chain name]" \ +--run-as $NETWORK_GOV_ADDRESS \ +--label "[chain name]" \ +--deposit=2000000000uamplifier \ +--keyring-backend test \ +--from wallet \ +--gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \ +--chain-id=devnet-amplifier \ +--no-admin \ +--node $RPC +``` + + + + + +## Proposal to instantiate the gateway contract + + + + +If you are integrating an EVM chain, you can submit a proposal to instantiate the pre-deployed gateway contract with the [proper instantiation parameters](https://github.com/axelarnetwork/axelar-amplifier/blob/deab56a75209a158c082cbf9b77caf500eb4ec7c/contracts/gateway/src/msg.rs#L4) using its existing `code_id` (`493`): + +```bash +export CODE_ID=493 +export NETWORK_GOV_ADDRESS="axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj" +export RPC="http://devnet-amplifier.axelar.dev:26657" +``` + +```bash +axelard tx gov submit-proposal instantiate-contract $CODE_ID \ + '{ + "verifier_address": "axelar1e6jnuljng6aljk0tjct6f0hl9tye6l0n9p067pwx2374h82dmr0s9qcqy9", + "router_address": "axelar14jjdxqhuxk803e9pq64w4fgf385y86xxhkpzswe9crmu6vxycezst0zq8y" + }' \ + --title="Instantiate gateway contract for [chain name]" \ + --description="Instantiate gateway contract for [chain name]" \ + --run-as $NETWORK_GOV_ADDRESS \ + --label "[chain name]" \ + --deposit=2000000000uamplifier \ + --keyring-backend test \ + --from wallet \ + --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \ + --chain-id=devnet-amplifier \ + --no-admin \ + --node $RPC +``` + + + + +## Proposal to instantiate the prover contract + + + + +If you are integrating an EVM chain, you can submit a proposal to instantiate the pre-deployed prover contract with the [proper instantiation parameters](https://github.com/axelarnetwork/axelar-amplifier/blob/deab56a75209a158c082cbf9b77caf500eb4ec7c/contracts/multisig-prover/src/msg.rs#L12) using its existing `code_id` (`495`): + +```bash +export CODE_ID=495 +export CHAIN_NAME="[chain name]" +export NETWORK_GOV_ADDRESS="axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj" +export RPC="http://devnet-amplifier.axelar.dev:26657" +``` + +```bash +axelard tx gov submit-proposal instantiate-contract $CODE_ID \ + '{ +"admin_address": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", # Prover admin address +"governance_address": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", +"gateway_address": "axelar1hdx49xndyxzrs3t5jkzart00taqysu6kmaf77waxv8regwxxpp4qcsea2w" +"multisig_address": "axelar19jxy26z0qnnspa45y5nru0l5rmy9d637z5km2ndjxthfxf5qaswst9290r", +"coordinator_address":"axelar1m2498n4h2tskcsmssjnzswl5e6eflmqnh487ds47yxyu6y5h4zuqr9zk4g", +"service_registry_address":"axelar1c9fkszt5lq34vvvlat3fxj6yv7ejtqapz04e97vtc9m5z9cwnamq8zjlhz", +"voting_verifier_address": "axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9", # Ethereum Sepolia voting verifier governance address +"signing_threshold": ["1","1"], +"service_name": "validators", +"chain_name": "[chain name]", +"verifier_set_diff_threshold": 1, +"encoder": "abi", +"key_type": "ecdsa", +"domain_separator": "6973c72935604464b28827141b0a463af8e3487616de69c5aa0c785392c9fb9f" # Hash of chain name, admin address, and code ID. Value must be a String in hex format without `0x`. + }' \ + --title="Instantiate prover contract for [chain name]" \ + --description="Instantiate prover contract for [chain name]" \ + --run-as $NETWORK_GOV_ADDRESS \ + --label "[chain name]" \ + --deposit=2000000000uamplifier \ + --keyring-backend test \ + --from wallet \ + --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \ + --chain-id=devnet-amplifier \ + --admin="axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9" + --node $RPC +``` + + + + +## Register your chain with the router + +```bash +export ROUTER_CONTRACT_ADDRESS="axelar14jjdxqhuxk803e9pq64w4fgf385y86xxhkpzswe9crmu6vxycezst0zq8y" +export ROUTER_GOV_ADDRESS="axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9" +export RPC="http://devnet-amplifier.axelar.dev:26657" +``` + +```bash +axelard tx gov submit-proposal execute-contract $ROUTER_CONTRACT_ADDRESS \ + '{ + "register_chain": { + "chain":"[Chain name]", + "gateway_address": "[chain gateway address]", + "msg_id_format": "hex_tx_hash_and_event_index" + } + }' \ + --title="Register [chain name] chain with the Amplifier router" \ + --description="Register [chain name] chain with the Amplifier router" \ + --run-as $ROUTER_GOV_ADDRESS \ + --deposit=2000000000uamplifier \ + --keyring-backend test \ + --from wallet \ + --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \ + --chain-id=devnet-amplifier \ + --node $RPC +``` + +## Authorize your prover with the Amplifier multisig contract + +Once the feedback period has passed, submit the proposal on the command line: + +```bash +export MULTISIG_CONTRACT_ADDRESS="axelar1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqa9263g" +export MULTISIG_GOV_ADDRESS="axelar1zlr7e5qf3sz7yf890rkh9tcnu87234k6k7ytd9" +export RPC="http://devnet-amplifier.axelar.dev:26657" +``` + +```bash +axelard tx gov submit-proposal execute-contract $MULTISIG_CONTRACT_ADDRESS \ + '{ + "authorize_caller": + { + "contract_address":"[chain prover address]" + } + }' \ + --title="Authorize [chain name] prover with the Amplifier multisig contract" \ + --description="Authorize [chain name] prover with the Amplifier multisig contract" \ + --run-as $MULTISIG_GOV_ADDRESS \ + --deposit=2000000000uamplifier \ + --keyring-backend test \ + --from wallet \ + --gas auto --gas-adjustment 1.5 --gas-prices 0.007uamplifier \ + --chain-id=devnet-amplifier \ + --node $RPC +``` + +## Track your proposal + +You can track the status of your proposal with the `proposal_id` given in the output after a successful submission. + +## Costs + +Each proposal requires a 2,000 AXL deposit to submit. These funds will be refunded if votes reach quorum. The Axelar Network currently requires a 33.4% quorum of staked tokens. + +## Voting period + +There is a three-day (72-hour) voting period for all mainnet proposals. \ No newline at end of file diff --git a/src/pages/learn/cosmwasm-governance.md b/src/pages/learn/cosmwasm-governance.md deleted file mode 100644 index d685a5f6e..000000000 --- a/src/pages/learn/cosmwasm-governance.md +++ /dev/null @@ -1,150 +0,0 @@ -# CosmWasm Governance Proposals - -CosmWasm contracts on the Axelar blockchain can only be created or updated via governance proposals. This guide will walk you through the process of creating and submitting a governance proposal with your CosmWasm code. - -## Prerequisites - -To create a governance proposal, make sure you have: - -* An account with enough funds to create a proposal -* An updated version of [axelard](https://docs.axelar.dev/node/config-node) with `wasm` enabled (`make WASM=true build`) - -## Setup - -1. Set the parameters to environment variables: - - ```bash - TESNET=... # fix this value - RPC=http://... - GOVERNANCE=axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj # fix this value - ``` - -1. Run the optimizer to get the contracts bytecode. This should be done via a [Docker container](https://www.docker.com/) to ensure that the bytecode is built with the proper environment. The following command will build the contract and save it to the `artifacts` folder: - - ```bash - docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/workspace-optimizer-arm64:0.12.13 - ``` - -## Change upload permission to governance address only - -1. Save the JSON proposal to a file, such as `gov-proposal.json`. For example: - - ```json - { - "title": "set upload access address to axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj", - "description": "set wasm code upload access to axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj", - "changes": [ - { - "subspace": "wasm", - "key": "uploadAccess", - "value": { - "permission": "AnyOfAddresses", - "address": "", - "addresses": ["axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj"] - } - } - ], - "deposit": "200000000uaxl" - } - ``` - -1. In your terminal, create a `GOV_PROPOSAL` variable and set its value to the path of your JSON file. - - ```bash - GOV_PROPOSAL=/Users/you/Projects/Axelar/gov-proposal.json - DENOM=uaxl - ``` - -1. Submit the proposal. - - ```bash - axelard tx gov submit-proposal param-change $GOV_PROPOSAL --from test --output json --gas auto --gas-adjustment 2 --gas-prices=0.00005$DENOM --node $RPC --chain-id $TESTNET - ``` - -1. Set the `PROPOSAL_ID` variable to the previous command’s output. - - ```bash - PROPOSAL_ID=4 - ``` - -1. Ask people on Axelar's [Discord](https://discord.com/invite/axelar), Telegram groups, and [Forum](https://community.axelar.network/) to vote on your proposal. You can also use other accounts to vote for your own proposal. - -## Submit the governance proposal to upload code - -1. Set contract vars to upload. You can get the hash from the optimizer output: - - ```bash - CONTRACT_WASM=artifacts/service_registry-aarch64.wasm -CONTRACT_SOURCE=https://github.com/axelarnetwork/axelar-amplifier/tree/main/contracts/service-registry # correct this - CONTRACT_CODE_HASH=20814e7f6a11bb7be119babbd233c3a647a2c8b5d9376eb810729152288d225c - ``` - -1. Submit the proposal to upload your code: - - ```bash - axelard tx gov submit-proposal wasm-store $CONTRACT_WASM --code-source-url $CONTRACT_SOURCE --builder "cosmwasm/workspace-optimizer-arm64:0.12.13" --code-hash $CONTRACT_CODE_HASH --instantiate-anyof-addresses $GOVERNANCE --title "Upload service registry" --description "Upload service registry" --run-as $(axelard keys show -a test) --deposit "200000000uedwin" --from test --output json --gas auto --gas-adjustment 2 --gas-prices=0.00005$DENOM --node $RPC --chain-id $DEVNET - ``` - -1. Set proposal ID variable based on the output of the previous command: - -```bash -PROPOSAL_ID=8 -``` - -1. Follow the same steps to get the network to approve your contract storage proposal. - -1. Query list of codes to retrieve the new one: - - ```bash - axelar-service-registry % axelard q wasm list-code --node $RPC --chain-id $DEVNET - ``` - - ```bash - - code_id: "4" - creator: axelar1a8ldskqrlkc0pushavypu359s5dvxcs3xgzu69 - data_hash: 20814E7F6A11BB7BE119BABBD233C3A647A2C8B5D9376EB810729152288D225C - instantiate_permission: - address: "" - addresses: - - axelar10d07y265gmmuvt4z0w9aw880jnsr700j7v9daj - permission: AnyOfAddresses - ``` - - ```bash - CODE_ID=4 - ``` - - It might take a bit for the proposal to be executed. - -## Submit governance proposal to instantiate contract - -1. Submit proposal to instantiate. Get the proposal ID from the output: - - ```bash - axelard tx gov submit-proposal instantiate-contract $CODE_ID '{"governance_account":"'$GOVERNANCE'"}' --label service_registry --no-admin --title "Instantiate service registry" --description "Instantiate service registry" --run-as $(axelard keys show -a test) --deposit "200000000uedwin" --from test --output json --gas auto --gas-adjustment 2 --gas-prices=0.00005$DENOM --node $RPC --chain-id $DEVNET - ``` - - ```bash - PROPOSAL_ID=12 - ``` - -1. Follow the same steps to get the network to approve your contract storage proposal. - -1. Query contracts for code_id to get newest address: - - ```bash - axelard q wasm list-contract-by-code $CODE_ID --node $RPC --chain-id $DEVNET - ``` - - ```bash - contracts: - - axelar1zwv6feuzhy6a9wekh96cd57lsarmqlwxdypdsplw6zhfncqw6ftqhk6q2n - - axelar1ghd753shjuwexxywmgs4xz7x2q732vcnkm6h2pyv9s6ah3hylvrqt7a82d - - axelar1xt4ahzz2x8hpkc0tk6ekte9x6crw4w6u0r67cyt3kz9syh24pd7scrmm2x - - axelar1kj8q8g2pmhnagmfepp9jh9g2mda7gzd0m5zdq0s08ulvac8ck4dqz8wvmz - pagination: - next_key: null - total: "0" - ``` - - It might take a bit for the proposal to be executed.