diff --git a/docs/governance/how-do-i-participate-in-governance.mdx b/docs/governance/how-do-i-participate-in-governance.mdx deleted file mode 100644 index b3822e2f..00000000 --- a/docs/governance/how-do-i-participate-in-governance.mdx +++ /dev/null @@ -1,450 +0,0 @@ ---- -title: How do I participate in governance? -dependencies: - octez: 0 - ligo: 0 ---- - -import InlineCopy from '@site/src/components/InlineCopy'; - -Tezos bakers can participate in the [Etherlink governance process](/governance/how-is-etherlink-governed) by submitting proposals and voting for them. - -The voting power of a baker is the amount of tez that it has staked plus the tez that delegators have delegated to it, also called its _staking balance_. - -Separate contracts manage the slow kernel updates, the fast kernel updates, and the sequencer operator, so to interact with them, bakers send transactions to those contracts, such as with the Octez client. -The addresses of the governance contracts are specified in Etherlink's kernel. -For information about the Octez client, see [Command Line Interface](https://octez.tezos.com/docs/active/cli-commands.html) in the Octez documentation. - -## Governance web site - -For information about Etherlink governance and to vote on governance proposals, see https://governance.etherlink.com. -This site: - -- Shows information about each governance process -- Shows the active and past governance contracts -- Shows active and past proposals and their states -- Allows voting keys to claim voting rights - -## Governance contract addresses - -You need the address of the correct governance contract (and sometimes the address of the Etherlink Smart Rollup) to propose changes, vote on changes, and trigger approved changes. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ContractMainnet address
Kernel governance (slow)
Kernel governance (fast)
Sequencer operator
Voting keys
Etherlink Smart Rollup
- -## Setting up an Etherlink voting key - -For convenience, Tezos bakers can use a voting key to vote on Etherlink proposals instead of using their baking key directly. -Using a voting key can be more convenient than using your baking key because you don't have to retrieve the baking key from your baking setup to be able to vote on Etherlink governance. - -You can set any Tezos layer 1 account as your voting key, so you can use an existing account or create an account to be the voting key. -The voting key has no special built-in privileges in Etherlink; it is merely an account used to authenticate on the governance contracts. -Bakers can change their Etherlink voting keys at any time, and changes take effect immediately. - -:::note - -Setting up an Etherlink voting key affects only Etherlink voting rights, not Tezos layer 1 protocol upgrade voting rights or layer 1 account delegation. - -::: - -Setting up a voting key is a two-step process; the voting key is not active until both of these steps are complete: - -1. The baking key proposes a voting key by calling the `propose_voting_key` entrypoint. -1. The voting key claims the voting rights by calling the `claim_voting_rights` entrypoint. - -Proposing a voting key requires a transaction from the Octez client or an indexer, but you can claim rights from a voting key with the [governance web site](https://governance.etherlink.com). - - -:::warning - -Voting keys claim rights with the `claim_voting_rights` entrypoint only once. -Suppose that a baking key proposes a voting key for a certain contract and the voting key calls the `claim_voting_rights` entrypoint. -Then, the baking key submits a second proposal for a second contract to the same voting key. -In this case, the voting key automatically receives rights for the second contract, without needing to call the `claim_voting_rights` entrypoint again. - -In fact, a voting key should never call the `claim_voting_rights` entrypoint more than once because doing so deactivates its voting rights and returns them to the baking key. - -::: - -At each vote period, each baker can vote only once, authenticating itself using either a voting key or its baking key. - -### Setting a voting key for all contracts - -To set up a voting key, call the `propose_voting_key` entrypoint of the voting rights contract. -By default, when you set up a voting key, that voting key receives the rights to vote for all governance contracts. -For example, the following command proposes allowing the voting key to vote for all governance contracts from the baking key with the alias `my_wallet`. -It uses the placeholder `` in place of the address of the voting key: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from my_wallet \ - --entrypoint propose_voting_key \ - --arg '(Pair "" True None)' --burn-cap 0.1 -``` - -Then, to claim voting rights, go to the [governance web site](https://governance.etherlink.com), connect your voting key with the **Connect** button at the top right of the page, and use the connection dialog to claim rights. - -As an alternative, you can claim voting rights directly by calling the `claim_voting_rights` entrypoint from the voting key and passing the baking key address. -For example, the following command claims the voting rights proposed in the previous command. -It uses the placeholder `` in place of the address of the baking key: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ - --entrypoint claim_voting_rights \ - --arg '""' -``` - -:::warning - -Claiming rights a second time with the `claim_voting_rights` entrypoint with the voting key returns the voting rights to the baking key. - -::: - -### Setting a voting key for specific contracts - -You can also select specific governance contracts to allow the voting key to vote for. -The following example passes `True` and the addresses of the slow kernel governance and sequencer governance contracts as a proposal. -As a result, the voting key can vote on those contracts but not on the kernel fast governance contract: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ - --entrypoint propose_voting_key \ - --arg '(Pair "" True (Some { "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" ; "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" }))' -``` - -Then, to claim voting rights, go to the [governance web site](https://governance.etherlink.com), connect your voting key with the **Connect** button at the top right of the page, and use the connection dialog to claim rights. - -As an alternative, you can claim voting rights directly for the specified contracts, which is just like the previous command to claim voting rights: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ - --entrypoint claim_voting_rights \ - --arg '""' -``` - -The following example passes `False` and the address of the fast kernel governance contract. -The result is the same as the previous proposal example: the voting key can vote on the slow kernel governance and sequencer governance contracts but not the fast kernel governance contract. -You can also use this proposal to remove the voting key's ability to vote for specific contracts: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ - --entrypoint propose_voting_key \ - --arg '(Pair "" False (Some { "KT1QDgF5pBkXEizj5RnmagEyxLxMTwVRpmYk" }))' --burn-cap 0.1 -``` - -:::tip - -The source code for the voting rights contract is in the file [`delegated_governance.mligo`](https://gitlab.com/tezos/tezos/-/blob/master/etherlink/tezos_contracts/governance/contracts/delegated_governance.mligo) in the Octez repository. -You can install LIGO and use its `compile expression` command and information from the source code to compile parameters to call it. - -For example, from the code of the contract you can see that the parameter to pass to the `propose_voting_key` entrypoint is the type `address * bool * (address set) option`. -This command compiles an expression of this CameLIGO type to Michelson to propose rights for two contracts: - -```bash -ligo compile expression cameligo '("" : address), True, (Some (Set.literal [("KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" : address); ("KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" : address)]) : (address set) option)' -``` - -You can use the result as the parameter to pass to the `propose_voting_key` entrypoint. -Here is the result of the command: - -```michelson -(Pair "" - True - (Some { "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" ; - "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" })) -``` - -Here is the resulting `octez-client` command: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ - --entrypoint propose_voting_key \ - --arg '(Pair "" True (Some { "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" ; "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" }))' -``` -::: - -### Verifying voting rights - -To check if an address has voting rights for a governance contract, pass the baking account address, the voting account address, and an option containing the governance contracts (or `None` for all contracts) to the `is_voting_key_of` view. -For example, the following command verifies that the voting key represented by the placeholder `` has the rights to vote for the baking key represented by the placeholder ``. -It returns True if the `` voting key has rights to vote in place of the `` baking key for all contracts that use this contract to track voting rights or False if it has not. - -```bash -octez-client run view is_voting_key_of on contract KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH \ - with input 'Pair "" "" None' -``` - -To check voting rights for a specific contract, pass the address as an option. -For example, this command verifies rights for the slow kernel governance contract: - -```bash -octez-client run view is_voting_key_of on contract KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH \ - with input 'Pair "" "" (Some "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r")' -``` - -:::tip - -Similar to how you can compile parameters for the entrypoints as described in [Setting a voting key for specific contracts](#setting-a-voting-key-for-specific-contracts), you can use the `ligo compile expression` command to compile the parameter for the view. -The view accepts a tuple that includes the address of the voting key, the address of the baker key, and an option that is either None or a list of contracts. - -For example, to compile the parameter from the previous example, install LIGO and run this command: - -```bash -ligo compile expression cameligo '("" : address), ("" : address), (Some ("KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" : address): address option)' -``` - -You can use the result as the parameter to pass to the view. -Here is the result of the command: - -```michelson -(Pair "tz1fsVnw7VQD73kUDB8ZWc67GWvCjTEibi9A" - "tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx" - (Some "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r")) -``` - -::: - -### Removing rights - -To revoke rights from a voting key, call the `propose_voting_key` entrypoint from the baking key with the parameter `(Pair False None)`, as in this example: - -```bash -octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from my_wallet \ - --entrypoint propose_voting_key \ - --arg '(Pair "" False None)' --burn-cap 0.1 -``` - -This command revokes voting rights for only the specified voting key. -If you have set up other voting keys, you must run the same command for those keys. - -You do not need to use the `claim_voting_rights` entrypoint to complete the removal of baking rights. - -## Participating in kernel governance - -Bakers can propose, vote on, and trigger kernel updates with these commands. -The commands are the same for slow and fast upgrades but they target different governance contracts. - -### Getting information about the current period - -You can get information about the current period at https://governance.etherlink.com. - -To get information about the current state of either kernel governance contract directly from the contract, connect the Octez client to an active node and call the contract's `get_voting_state` view. -For example, this Octez client command calls this view for the slow governance contract on Mainnet: - -```bash -octez-client -E https://mainnet.ecadinfra.com \ - run view get_voting_state on contract KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r -``` - -The view returns information about the current governance period in this order: - -- The index of the current period -- Whether the current period is Proposal (`Left Unit`) or Promotion (`Right Unit`) -- The number of blocks remaining in the period -- Information about voting during the period - -For example, this response shows that the contract is currently in the Proposal period: - -``` -(Pair 1619 (Left Unit) 64 None) -``` - -Block explorers show this information in a more human-readable format. - -You can also subscribe to the `voting_finished` event to be notified when the Proposal period completes. - -### Proposing and upvoting upgrades - -During a Proposal period, bakers can propose updates by calling the `new_proposal` entrypoint of the appropriate governance contract and passing the hash of their proposed kernel, as in this example, which uses `` as the kernel hash: - -```bash -octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ - --entrypoint "new_proposal" \ - --arg "" -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the Etherlink kernel governance contract -- The hash of the upgraded kernel, which the proposer must generate from the code of the new kernel - -The proposer must make the code and hash of the new kernel available for people to evaluate. -You can look for this information in blog posts or other announcements from proposal developers. -Proposers can make it easier for bakers to upgrade to the new kernel by providing the preimages for the kernel online so nodes can update from them directly. - -To upvote a proposed kernel update during a Proposal period, go to the [governance web site](https://governance.etherlink.com), connect your wallet (baking key or voting key), select the governance process and active period, and cast your vote. - -As an alternative, call the `upvote_proposal` entrypoint with the same parameters as the `new_proposal` entrypoint: - -```bash -octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ - --entrypoint "upvote_proposal" \ - --arg "" -``` - -It's not necessary to upvote a proposal that you submitted; submitting a proposal implies that your account upvotes it. - -### Voting for or against upgrades - -When a proposal is in the Promotion period, you can vote for or against it by going to the [governance web site](https://governance.etherlink.com), connecting your wallet (baking key or voting key), selecting the governance process and active period, and casting your vote. - -As an alternative, you can vote for it by calling the `vote` entrypoint of the appropriate governance contract: - -```bash -octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ - --entrypoint "vote" --arg '"yea"' -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the Etherlink kernel governance contract -- `"yea"`, `"nay"`, or `"pass"`, including the double quotes - -The command does not need the hash of the kernel because only one kernel can be in the Promotion period at a time, so the options are to vote for or against that kernel or to abstain by voting "pass." - -### Triggering upgrades - -After a proposal wins a vote, any account can trigger the kernel upgrade by calling the appropriate governance contract's `trigger_kernel_upgrade` entrypoint: - -```bash -octez-client call KT1DxndcFitAbxLdJCN3C1pPivqbC3RJxD1R from my_wallet \ - --entrypoint "trigger_kernel_upgrade" \ - --arg '"sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf"' -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the appropriate Etherlink kernel governance contract -- The address of the Etherlink Smart Rollup; the parameter must include the double quotes - -After the new kernel becomes active, bakers must provide their nodes with the preimages for the new kernel to continue to participate in Etherlink. -They can copy the new preimages into the node data directory without stopping or restarting the node. -If a node uses a preimages endpoint as described in [Running an Etherlink EVM node](/network/evm-nodes) and [Running an Etherlink Smart Rollup node](/network/smart-rollup-nodes), the node updates automatically. - -## Participating in sequencer governance - -Bakers can propose the account to operate Etherlink's sequencer, vote for or against proposed operators, and trigger the change to a new account. - -### Getting information about the current period - -You can get information about the current period at https://governance.etherlink.com. - -To get information about the current state of the sequencer operator governance contract directly from the contract, call its `get_voting_state` view. -For example, this Octez client command calls this view for the kernel governance contract on Mainnet: - -```bash -octez-client -E https://mainnet.ecadinfra.com \ - run view get_voting_state on contract KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf -``` - -The view returns information about the current governance period. -Block explorers show this information in a more human-readable format. - -You can also subscribe to the `voting_finished` event to be notified when the Proposal period completes. - -### Proposing and voting for a new operator - -To propose an account to be the sequencer operator, bakers can call the `new_proposal` entrypoint of the governance contract during the Proposal period: - -```bash -octez-client transfer 0 from my_wallet to KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf \ - --entrypoint new_proposal \ - --arg 'Pair "" ' -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the sequencer governance contract (referred to on the block explorer as the sequencer committee governance contract) -- The public key (not the public key hash or account address) of the account to propose, including the double quotes, represented in this example as `` -- The Etherlink address of the account to propose, represented in this example as `` - -For example: - -```bash -octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ - --entrypoint new_proposal \ - --arg 'Pair "" ' -``` - -To upvote a proposed sequencer operator during a Proposal period, go to the [governance web site](https://governance.etherlink.com), connect your wallet (baking key or voting key), select the governance process and active period, and cast your vote. - -As an alternative, call the `upvote_proposal` entrypoint with the same parameters as the `new_proposal` entrypoint: - -```bash -octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ - --entrypoint upvote_proposal \ - --arg 'Pair "" ' -``` - -It's not necessary to upvote a proposal that you submitted; submitting a proposal implies that your account upvotes it. - -### Voting for or against an operator - -When a proposal is in the Promotion period, you can vote for or against it by going to the [governance web site](https://governance.etherlink.com), connecting your wallet (baking key or voting key), selecting the governance process and active period, and casting your vote. - -As an alternative, you can vote for or against it or pass on voting by calling the `vote` entrypoint of the governance contract: - -```bash -octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ - --entrypoint "vote" --arg '"yea"' -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the sequencer governance contract -- `"yea"`, `"nay"`, or `"pass"`, including the double quotes - -For example: - -```bash -octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from tz1RLPEeMxbJYQBFbXYw8WHdXjeUjnG5ZXNq \ - --entrypoint "vote" --arg '"yea"' -``` - -### Triggering sequencer operator updates - -After a proposed account wins a vote, any account can trigger the change and enable that account to run the sequencer by calling the governance contract's `trigger_committee_upgrade` entrypoint: - -```bash -octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ - --entrypoint "trigger_committee_upgrade" \ - --arg '"sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf"' -``` - -The command takes these parameters: - -- The address or Octez client alias of your baker account or voting key -- The address of the sequencer governance contract -- The address of the Etherlink Smart Rollup; the parameter must include the double quotes diff --git a/docs/governance/how-is-etherlink-governed.md b/docs/governance/how-is-etherlink-governed.md index 661564d0..8a47bd70 100644 --- a/docs/governance/how-is-etherlink-governed.md +++ b/docs/governance/how-is-etherlink-governed.md @@ -36,7 +36,7 @@ The real-world duration of governance periods can be longer, depending on the ac For information about governance proposals and updates, see https://governance.etherlink.com. -For the addresses of the contracts that manage governance, see [How do I participate in governance?](/governance/how-do-i-participate-in-governance). +For the addresses of the contracts that manage governance, see [Governance overview](/governance/overview). ## Kernel governance (slow) diff --git a/docs/governance/kernel-governance.md b/docs/governance/kernel-governance.md new file mode 100644 index 00000000..9a589ae6 --- /dev/null +++ b/docs/governance/kernel-governance.md @@ -0,0 +1,74 @@ +--- +title: Participating in kernel governance +dependencies: + octez: 24.1 +--- + +:::note + +For simplified instructions for voting for Etherlink kernel upgrades, see [Voting quickstart](/governance/quickstart). + +::: + +Bakers can vote on kernel updates with these commands. +The commands are the same for slow and fast upgrades but they target different governance contracts. + +## Getting information about the current period + +You can get information about the current period at https://governance.etherlink.com. + +To get information about the current state of either kernel governance contract directly from the contract, connect the Octez client to an active node and call the contract's `get_voting_state` view. +For example, this Octez client command calls this view for the slow governance contract on Mainnet: + +```bash +octez-client -E https://mainnet.ecadinfra.com \ + run view get_voting_state on contract KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r +``` + +The view returns information about the current governance period in this order: + +- The index of the current period +- Whether the current period is Proposal (`Left Unit`) or Promotion (`Right Unit`) +- The number of blocks remaining in the period +- Information about voting during the period + +For example, this response shows that the contract is currently in the Proposal period: + +``` +(Pair 1619 (Left Unit) 64 None) +``` + +Block explorers and the [governance web site](https://governance.etherlink.com) show this information in a more human-readable format. + +You can also subscribe to the `voting_finished` event to be notified when the Proposal period completes. + +## Upvoting upgrades in the Proposal period + +To upvote a proposed kernel update during a Proposal period, go to the [governance web site](https://governance.etherlink.com), connect your wallet (baking key or voting key), select the governance process and active period, and cast your vote. + +As an alternative, call the `upvote_proposal` entrypoint with the same parameters as the `new_proposal` entrypoint: + +```bash +octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ + --entrypoint "upvote_proposal" \ + --arg "0x" +``` + +## Voting for or against upgrades in the Promotion period + +When a proposal is in the Promotion period, you can vote for or against it by going to the [governance web site](https://governance.etherlink.com), connecting your wallet (baking key or voting key), selecting the governance process and active period, and casting your vote. + +As an alternative, you can vote for it by calling the `vote` entrypoint of the appropriate governance contract: + +```bash +octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ + --entrypoint "vote" --arg '"yea"' +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or voting key +- The address of the Etherlink kernel governance contract +- `"yea"`, `"nay"`, or `"pass"`, including the double quotes + +The command does not need the hash of the kernel because only one kernel can be in the Promotion period at a time, so the options are to vote for or against that kernel or to abstain by voting "pass." diff --git a/docs/governance/overview.mdx b/docs/governance/overview.mdx new file mode 100644 index 00000000..7ad91392 --- /dev/null +++ b/docs/governance/overview.mdx @@ -0,0 +1,59 @@ +--- +title: Governance overview +--- + +import InlineCopy from '@site/src/components/InlineCopy'; + +The Etherlink governance process manages updates to Etherlink's kernel and the account that operates the sequencer. + +Tezos bakers can participate in the [Etherlink governance process](/governance/how-is-etherlink-governed) by submitting proposals to change the kernel and sequencer operator and voting for or against them. +The voting power of a baker is the amount of tez that it has staked plus the tez that delegators have delegated to it, also called its _staking balance_. + +Separate contracts manage the slow kernel updates, the fast kernel updates, and the sequencer operator, so to interact with them, bakers send transactions to those contracts, such as with the Octez client. +The addresses of the governance contracts are specified in Etherlink's kernel. +For information about the Octez client, see [Command Line Interface](https://octez.tezos.com/docs/active/cli-commands.html) in the Octez documentation. + +## Governance web site + +For information about Etherlink governance and to vote on governance proposals, see https://governance.etherlink.com. +This site: + +- Shows information about each governance process +- Shows the active and past governance contracts +- Shows active and past proposals and their states +- Allows voting keys to claim voting rights + +## Governance contract addresses + +You need the address of the correct governance contract (and sometimes the address of the Etherlink Smart Rollup) to propose changes, vote on changes, and trigger approved changes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ContractMainnet address
Kernel governance (slow)
Kernel governance (fast)
Sequencer operator
Voting keys
Etherlink Smart Rollup
\ No newline at end of file diff --git a/docs/governance/proposing-upgrades.md b/docs/governance/proposing-upgrades.md new file mode 100644 index 00000000..8fe6e1d5 --- /dev/null +++ b/docs/governance/proposing-upgrades.md @@ -0,0 +1,32 @@ +--- +title: Proposing kernel upgrades +dependencies: + octez: 24.1 +--- + +:::note + +Only the baker that proposes the upgrade runs this command. +Other bakers use different commands to vote for or against it, as described in [Participating in kernel governance](/governance/kernel-governance). + +::: + +During a Proposal period, bakers can propose updates by calling the `new_proposal` entrypoint of the appropriate governance contract and passing the hash of their proposed kernel, as in this example, which uses `` as the kernel hash: + +```bash +octez-client call KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r from my_wallet \ + --entrypoint "new_proposal" \ + --arg "0x" +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or [voting key](/governance/voting-key) +- The address of the Etherlink kernel governance contract, either `KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r` for the slow governance process or `KT1DxndcFitAbxLdJCN3C1pPivqbC3RJxD1R` for the fast governance process; see [Governance contract addresses](/governance/overview#governance-contract-addresses) +- The hash of the upgraded kernel, which the proposer must generate from the code of the new kernel + +The proposer must make the code and hash of the new kernel available for people to evaluate. +You can look for this information in blog posts or other announcements from proposal developers. +Proposers can make it easier for bakers to upgrade to the new kernel by providing the preimages for the kernel online so nodes can update from them directly. + +It's not necessary to upvote a proposal that you submitted; submitting a proposal implies that your account upvotes it. diff --git a/docs/governance/quickstart.md b/docs/governance/quickstart.md new file mode 100644 index 00000000..353d047b --- /dev/null +++ b/docs/governance/quickstart.md @@ -0,0 +1,51 @@ +--- +title: Voting quickstart +dependencies: + octez: 24.1 +--- + +:::note + +This page includes only the basic commands for voting for Etherlink kernel upgrade proposals. +For complete information, see [Participating in kernel governance](/governance/kernel-governance). + +::: + +## Using the governance web site + +To upvote a proposed kernel update during a Proposal period, go to the [governance web site](https://governance.etherlink.com), connect your wallet (baking key or voting key), select the governance process and active period, and cast your vote. + +If you prefer to use the command line instead of the governance web site, the following sections cover how to vote with the Octez client. + +## Voting in the Proposal period with the command line + +During a Proposal period, go to the [governance web site](https://governance.etherlink.com) and find the hash of the kernel to upvote, adding `0x` if it doesn't already start with `0x`. +Then run this command: + +```bash +octez-client call from \ + --entrypoint "upvote_proposal" \ + --arg "0x" +``` + +Parameters: + +- ``: The governance contract to call, either `KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r` for the slow governance process or `KT1DxndcFitAbxLdJCN3C1pPivqbC3RJxD1R` for the fast governance process; see [Governance contract addresses](/governance/overview#governance-contract-addresses) +- ``: Your baker key or Etherlink [voting key](/governance/voting-key) +- ``: The hash of the kernel to upvote, starting with `0x` + +## Voting in the Promotion period with the command line + +During a Promotion period, run this command to vote for or against the kernel by running this command, using `yea`, `nay`, or `pass` as the argument: + +```bash +octez-client call from \ + --entrypoint "vote" --arg '"yea"' +``` + +Parameters: + +- ``: The governance contract to call, either `KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r` for the slow governance process or `KT1DxndcFitAbxLdJCN3C1pPivqbC3RJxD1R` for the fast governance process; see [Governance contract addresses](/governance/overview#governance-contract-addresses) +- ``: Your baker key or Etherlink [voting key](/governance/voting-key) + +The command does not need the hash of the kernel because only one kernel can be in the Promotion period at a time, so the options are to vote for or against that kernel or to abstain by voting "pass." diff --git a/docs/governance/sequencer-upgrades.md b/docs/governance/sequencer-upgrades.md new file mode 100644 index 00000000..c780d2b4 --- /dev/null +++ b/docs/governance/sequencer-upgrades.md @@ -0,0 +1,101 @@ +--- +title: Participating in sequencer governance +dependencies: + octez: 24.1 +--- + +Bakers can propose the account to operate Etherlink's sequencer, vote for or against proposed operators, and trigger the change to a new account. + +## Getting information about the current period + +You can get information about the current period at https://governance.etherlink.com. + +To get information about the current state of the sequencer operator governance contract directly from the contract, call its `get_voting_state` view. +For example, this Octez client command calls this view for the kernel governance contract on Mainnet: + +```bash +octez-client -E https://mainnet.ecadinfra.com \ + run view get_voting_state on contract KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf +``` + +The view returns information about the current governance period. +Block explorers show this information in a more human-readable format. + +You can also subscribe to the `voting_finished` event to be notified when the Proposal period completes. + +## Proposing and voting for a new operator + +To propose an account to be the sequencer operator, bakers can call the `new_proposal` entrypoint of the governance contract during the Proposal period: + +```bash +octez-client transfer 0 from my_wallet to KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf \ + --entrypoint new_proposal \ + --arg 'Pair "" ' +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or voting key +- The address of the sequencer governance contract (referred to on the block explorer as the sequencer committee governance contract) +- The public key (not the public key hash or account address) of the account to propose, including the double quotes, represented in this example as `` +- The Etherlink address of the account to propose, represented in this example as `` + +For example: + +```bash +octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ + --entrypoint new_proposal \ + --arg 'Pair "" ' +``` + +To upvote a proposed sequencer operator during a Proposal period, go to the [governance web site](https://governance.etherlink.com), connect your wallet (baking key or voting key), select the governance process and active period, and cast your vote. + +As an alternative, call the `upvote_proposal` entrypoint with the same parameters as the `new_proposal` entrypoint: + +```bash +octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ + --entrypoint upvote_proposal \ + --arg 'Pair "" ' +``` + +It's not necessary to upvote a proposal that you submitted; submitting a proposal implies that your account upvotes it. + +## Voting for or against an operator + +When a proposal is in the Promotion period, you can vote for or against it by going to the [governance web site](https://governance.etherlink.com), connecting your wallet (baking key or voting key), selecting the governance process and active period, and casting your vote. + +As an alternative, you can vote for or against it or pass on voting by calling the `vote` entrypoint of the governance contract: + +```bash +octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ + --entrypoint "vote" --arg '"yea"' +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or voting key +- The address of the sequencer governance contract +- `"yea"`, `"nay"`, or `"pass"`, including the double quotes + +For example: + +```bash +octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from tz1RLPEeMxbJYQBFbXYw8WHdXjeUjnG5ZXNq \ + --entrypoint "vote" --arg '"yea"' +``` + +## Triggering sequencer operator updates + +After a proposed account wins a vote, any account can trigger the change and enable that account to run the sequencer by calling the governance contract's `trigger_committee_upgrade` entrypoint: + +```bash +octez-client call KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf from my_wallet \ + --entrypoint "trigger_committee_upgrade" \ + --arg '"sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf"' +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or voting key +- The address of the sequencer governance contract +- The address of the Etherlink Smart Rollup; the parameter must include the double quotes diff --git a/docs/governance/triggering-upgrades.md b/docs/governance/triggering-upgrades.md new file mode 100644 index 00000000..bc67e2b9 --- /dev/null +++ b/docs/governance/triggering-upgrades.md @@ -0,0 +1,23 @@ +--- +title: Triggering kernel upgrades +dependencies: + octez: 24.1 +--- + +After a proposal wins a vote, any account can trigger the kernel upgrade by calling the appropriate governance contract's `trigger_kernel_upgrade` entrypoint: + +```bash +octez-client call KT1DxndcFitAbxLdJCN3C1pPivqbC3RJxD1R from my_wallet \ + --entrypoint "trigger_kernel_upgrade" \ + --arg '"sr1Ghq66tYK9y3r8CC1Tf8i8m5nxh8nTvZEf"' +``` + +The command takes these parameters: + +- The address or Octez client alias of your baker account or voting key +- The address of the appropriate Etherlink kernel governance contract +- The address of the Etherlink Smart Rollup; the parameter must include the double quotes + +After the new kernel becomes active, bakers must provide their nodes with the preimages for the new kernel to continue to participate in Etherlink. +They can copy the new preimages into the node data directory without stopping or restarting the node. +If a node uses a preimages endpoint as described in [Running an Etherlink EVM node](/network/evm-nodes) and [Running an Etherlink Smart Rollup node](/network/smart-rollup-nodes), the node updates automatically. diff --git a/docs/governance/voting-key.md b/docs/governance/voting-key.md new file mode 100644 index 00000000..6585b369 --- /dev/null +++ b/docs/governance/voting-key.md @@ -0,0 +1,190 @@ +--- +title: Setting up an Etherlink voting key +dependencies: + octez: 24.1 + ligo: 1.10.0 +--- + +For convenience, Tezos bakers can use a voting key to vote on Etherlink proposals instead of using their baking key directly. +Using a voting key can be more convenient than using your baking key because you don't have to retrieve the baking key from your baking setup to be able to vote on Etherlink governance. + +You can set any Tezos layer 1 account as your voting key, so you can use an existing account or create an account to be the voting key. +The voting key has no special built-in privileges in Etherlink; it is merely an account used to authenticate on the governance contracts. +Bakers can change their Etherlink voting keys at any time, and changes take effect immediately. + +:::note + +Setting up an Etherlink voting key affects only Etherlink voting rights, not Tezos layer 1 protocol upgrade voting rights or layer 1 account delegation. + +::: + +Setting up a voting key is a two-step process; the voting key is not active until both of these steps are complete: + +1. The baking key proposes a voting key by calling the `propose_voting_key` entrypoint. +1. The voting key claims the voting rights by calling the `claim_voting_rights` entrypoint. + +Proposing a voting key requires a transaction from the Octez client or an indexer, but you can claim rights from a voting key with the [governance web site](https://governance.etherlink.com). + + +:::warning + +Voting keys claim rights with the `claim_voting_rights` entrypoint only once. +Suppose that a baking key proposes a voting key for a certain contract and the voting key calls the `claim_voting_rights` entrypoint. +Then, the baking key submits a second proposal for a second contract to the same voting key. +In this case, the voting key automatically receives rights for the second contract, without needing to call the `claim_voting_rights` entrypoint again. + +In fact, a voting key should never call the `claim_voting_rights` entrypoint more than once because doing so deactivates its voting rights and returns them to the baking key. + +::: + +At each vote period, each baker can vote only once, authenticating itself using either a voting key or its baking key. + +### Setting a voting key for all contracts + +To set up a voting key, call the `propose_voting_key` entrypoint of the voting rights contract. +By default, when you set up a voting key, that voting key receives the rights to vote for all governance contracts. +For example, the following command proposes allowing the voting key to vote for all governance contracts from the baking key with the alias `my_wallet`. +It uses the placeholder `` in place of the address of the voting key: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from my_wallet \ + --entrypoint propose_voting_key \ + --arg '(Pair "" True None)' --burn-cap 0.1 +``` + +Then, to claim voting rights, go to the [governance web site](https://governance.etherlink.com), connect your voting key with the **Connect** button at the top right of the page, and use the connection dialog to claim rights. + +As an alternative, you can claim voting rights directly by calling the `claim_voting_rights` entrypoint from the voting key and passing the baking key address. +For example, the following command claims the voting rights proposed in the previous command. +It uses the placeholder `` in place of the address of the baking key: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ + --entrypoint claim_voting_rights \ + --arg '""' +``` + +:::warning + +Claiming rights a second time with the `claim_voting_rights` entrypoint with the voting key returns the voting rights to the baking key. + +::: + +### Setting a voting key for specific contracts + +You can also select specific governance contracts to allow the voting key to vote for. +The following example passes `True` and the addresses of the slow kernel governance and sequencer governance contracts as a proposal. +As a result, the voting key can vote on those contracts but not on the kernel fast governance contract: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ + --entrypoint propose_voting_key \ + --arg '(Pair "" True (Some { "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" ; "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" }))' +``` + +Then, to claim voting rights, go to the [governance web site](https://governance.etherlink.com), connect your voting key with the **Connect** button at the top right of the page, and use the connection dialog to claim rights. + +As an alternative, you can claim voting rights directly for the specified contracts, which is just like the previous command to claim voting rights: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ + --entrypoint claim_voting_rights \ + --arg '""' +``` + +The following example passes `False` and the address of the fast kernel governance contract. +The result is the same as the previous proposal example: the voting key can vote on the slow kernel governance and sequencer governance contracts but not the fast kernel governance contract. +You can also use this proposal to remove the voting key's ability to vote for specific contracts: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ + --entrypoint propose_voting_key \ + --arg '(Pair "" False (Some { "KT1QDgF5pBkXEizj5RnmagEyxLxMTwVRpmYk" }))' --burn-cap 0.1 +``` + +:::tip + +The source code for the voting rights contract is in the file [`delegated_governance.mligo`](https://gitlab.com/tezos/tezos/-/blob/master/etherlink/tezos_contracts/governance/contracts/delegated_governance.mligo) in the Octez repository. +You can install LIGO and use its `compile expression` command and information from the source code to compile parameters to call it. + +For example, from the code of the contract you can see that the parameter to pass to the `propose_voting_key` entrypoint is the type `address * bool * (address set) option`. +This command compiles an expression of this CameLIGO type to Michelson to propose rights for two contracts: + +```bash +ligo compile expression cameligo '("" : address), True, (Some (Set.literal [("KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" : address); ("KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" : address)]) : (address set) option)' +``` + +You can use the result as the parameter to pass to the `propose_voting_key` entrypoint. +Here is the result of the command: + +```michelson +(Pair "" + True + (Some { "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" ; + "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" })) +``` + +Here is the resulting `octez-client` command: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from \ + --entrypoint propose_voting_key \ + --arg '(Pair "" True (Some { "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" ; "KT1WckZ2uiLfHCfQyNp1mtqeRcC1X6Jg2Qzf" }))' +``` +::: + +### Verifying voting rights + +To check if an address has voting rights for a governance contract, pass the baking account address, the voting account address, and an option containing the governance contracts (or `None` for all contracts) to the `is_voting_key_of` view. +For example, the following command verifies that the voting key represented by the placeholder `` has the rights to vote for the baking key represented by the placeholder ``. +It returns True if the `` voting key has rights to vote in place of the `` baking key for all contracts that use this contract to track voting rights or False if it has not. + +```bash +octez-client run view is_voting_key_of on contract KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH \ + with input 'Pair "" "" None' +``` + +To check voting rights for a specific contract, pass the address as an option. +For example, this command verifies rights for the slow kernel governance contract: + +```bash +octez-client run view is_voting_key_of on contract KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH \ + with input 'Pair "" "" (Some "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r")' +``` + +:::tip + +Similar to how you can compile parameters for the entrypoints as described in [Setting a voting key for specific contracts](#setting-a-voting-key-for-specific-contracts), you can use the `ligo compile expression` command to compile the parameter for the view. +The view accepts a tuple that includes the address of the voting key, the address of the baker key, and an option that is either None or a list of contracts. + +For example, to compile the parameter from the previous example, install LIGO and run this command: + +```bash +ligo compile expression cameligo '("" : address), ("" : address), (Some ("KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r" : address): address option)' +``` + +You can use the result as the parameter to pass to the view. +Here is the result of the command: + +```michelson +(Pair "tz1fsVnw7VQD73kUDB8ZWc67GWvCjTEibi9A" + "tz1QCVQinE8iVj1H2fckqx6oiM85CNJSK9Sx" + (Some "KT1VZVNCNnhUp7s15d9RsdycP7C1iwYhAQ8r")) +``` + +::: + +### Removing rights + +To revoke rights from a voting key, call the `propose_voting_key` entrypoint from the baking key with the parameter `(Pair False None)`, as in this example: + +```bash +octez-client call KT1Ut6kfrTV9tK967tDYgQPMvy9t578iN7iH from my_wallet \ + --entrypoint propose_voting_key \ + --arg '(Pair "" False None)' --burn-cap 0.1 +``` + +This command revokes voting rights for only the specified voting key. +If you have set up other voting keys, you must run the same command for those keys. + +You do not need to use the `claim_voting_rights` entrypoint to complete the removal of baking rights. \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index cf4c928e..1f42cbdd 100644 --- a/sidebars.js +++ b/sidebars.js @@ -130,8 +130,14 @@ const sidebars = { label: 'Governance', collapsed: false, items: [ + 'governance/overview', + 'governance/quickstart', 'governance/how-is-etherlink-governed', - 'governance/how-do-i-participate-in-governance', + 'governance/voting-key', + 'governance/proposing-upgrades', + 'governance/kernel-governance', + 'governance/triggering-upgrades', + 'governance/sequencer-upgrades', ], }, {