-
Notifications
You must be signed in to change notification settings - Fork 152
docs (governance): update interactions and overview #1145
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
docs (governance): update interactions and overview #1145
Conversation
Development to main
Merge dev in main
Development into main
Development into main
spelling error
| The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string. | ||
|
|
||
| The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame the votes can be cast. | ||
| The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame, lasting 10 days, the votes can be cast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During this time frame, lasting 10 days, the votes can be cast. -> lasting at most 10 days,
| - `vote_type` as encoded string representing the vote | ||
| - `total_stake` total staked EGLD for the sender address | ||
| - `total_voting_power` total available voting power for the sender address | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please add an example here how the encoding looks like?
similar to line 197 from this file: https://github.com/multiversx/mx-docs/pull/1145/files#diff-07f3478f0433c88d1671159679aeaa7019d72cb78c63c302d45db6cc13fe1afeR197
I took this example: https://devnet-explorer.multiversx.com/transactions/2cd33ee164881dd273a3568ed6cb272e3d7f05b7b46fd8f4a64d28dc30e1fe48/logs
WQ== -> hex 59 -> 89
eWVz -> hex 79657 -> "yes"
BxRA1dqcrTxyQw== -> hex 071440d5da9cad3c7243 -> 33430172142116630458947 (~33430 EGLD)
BxRA1dqcrTxyQw== -> hex 071440d5da9cad3c7243 -> 33430172142116630458947 (~33430 EGLD)
|
|
||
| That is why we offered an endpoint to the governance smart contact that can be called **only by a shard smart contract** and the governance contract will record the address provided, the vote type and vote value. | ||
|
|
||
| This is very useful whenever implementing liquid-staking-like smart contracts. The liquid-staking contract knows the balance for each user, so it will delegate the call to the governance contract providing the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
providing the value -> providing the corresponding voting power.
|
|
||
| After issuing the vote, a log event is generated containing the `proposal` identifier and the following encoded topics: | ||
|
|
||
| - `nonce` as encoded integer which uniquely identifies the proposals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here please have an example of the encoding.
|
|
||
| That is why we offered an endpoint to the governance smart contact that can be called **only by a shard smart contract** and the governance contract will record the address provided, the vote type and vote value. | ||
|
|
||
| This is very useful whenever implementing liquid-staking-like smart contracts. The liquid-staking contract knows the balance for each user, so it will delegate the call to the governance contract providing the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before the GovernanceVoteThroughDelegationTransaction we need a short explanation like this:
The user that delegated through a liquid-staking-like contract in order to vote on a proposal, sends a transaction to the liquid-staking-like contract. The smart contract then creates the GovernanceVoteThroughDelegationTransaction based on the users transaction inputs to forward the vote and the computed voting power to the governance contract.
There's a typo in Thourgh -> Through
| "AA==", (number of direct nonces: 0) | ||
| "AA==", (used power: 0) | ||
| "AA==", (used stake: 0) | ||
| "A+g=", (total power: 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here please make last 2 values equal.
|
|
||
| A user can create any number of proposals as long as it pays the locking fee & the gas used for the transaction. The proposal can be closed in any epoch following the provided end epoch. | ||
| After a proposal is created, the following rules will apply: | ||
| - If the proposal passes or fails normally, the fee is refunded to the issuer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the proposal fails, we currently refund the 500 from the proposal fee without the LostProposalFee so only if the proposal passes, the entire fee is refunded.
|
|
||
| The votes will be added for each category (**Yes**, **No**, **Abstain** and **Veto**). The vote is computed as `vote = total_staked_value` for each address that cast a vote. | ||
| ### Voting | ||
| - The voting starts from the provided starting epoch and lasts exactly *10 days*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lasts at most 10 days
it should have been exactly, but it was implement with 1-10 days.
| - There are four vote types: **Yes**, **No**, **Abstain**, and **Veto**. | ||
| - Voting consumes gas (approx. 6 million units). | ||
| - Voting power is derived from staked and delegated EGLD. | ||
| - Delegation and liquid staking () contracts can cast votes on behalf of users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need the () ?
can cast votes on behalf of users -> can forward user votes.
can cast votes on behalf sounds like the users can't/don't have to to anything.
|
|
||
| The quorum in this case will be a value `(2000+3000+4000+1500) * 10^18 = 10500 * 10^18`. | ||
| ### Closing and cleanup | ||
| - Proposals can only be closed after the end epoch has passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be closed also before the voting period has started, but only by the issuer.
Anyone can close them after the voting period ended.
| - There are four vote types: **Yes**, **No**, **Abstain**, and **Veto**. | ||
| - Voting consumes gas (approx. 6 million units). | ||
| - Voting power is derived from staked and delegated EGLD. | ||
| - Delegation and liquid staking () contracts can cast votes on behalf of users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the parentheses can be removed
| Value: 500 EGLD | ||
| GasLimit: 51000000 | ||
| Data: "proposal" + | ||
| "@<identifier>" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think a better name would be commit_hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also specify than length is mandatory to be exactly 40 chars
|
|
||
| The value parameter represents the mandatory proposal submission deposit of 500 EGLD. | ||
|
|
||
| The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this is a bit more accurate:
The proposal identifier is a hex string containing exactly 40 characters. This is the git commit hash on which the proposal is made.
| >**Note:** When providing the starting epoch, it should be taken into consideration that the governance contract enforcing a configured maximum gap of 30 epochs between the current epoch and the proposal’s starting epoch. | ||
| After issuing the proposal, there is a log event generated having the `proposal` identifier that will contain the following encoded topics: | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace identifier with commit hash bellow
| ```json | ||
| { | ||
| "returnData": [ | ||
| "NjXJrcXeoAAA", (proposal locked amount: 1000 EGLD denominated = 1000 * 10^18) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's change the example to use 500 EGLD
| Value: 500 EGLD | ||
| GasLimit: 51000000 | ||
| Data: "proposal" + | ||
| "@<identifier>" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and also specify than length is mandatory to be exactly 40 chars
| - `delta`: staked value **1500 EGLD** that vote **No** | ||
|
|
||
| The totals are: | ||
| - Quorum = `(2000+3000+4000+1500) = 10,500 EGLD` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the quorum: it would be nice to clarify that it is calculated as 33% of the total staked EGLD, where total means the sum of Direct stake + Staking Providers + Legacy Staking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @raduchis
| The proposal identifier is a hex string containing exactly 40 characters. Usually, this can be a git commit hash on which the proposal is made but can be any other identifier string. | ||
|
|
||
| The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame the votes can be cast. | ||
| The starting & ending epochs should be an even-length hex string containing the starting epoch and the ending epoch. During this time frame, lasting 10 days, the votes can be cast. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename days to Unbound Period duration, which is 10 Epochs on Mainnet
elvisboghiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following view methods are nnot documented: viewVotingPower, viewConfig.
You can find more information in governance contract.
https://github.com/multiversx/mx-chain-go/blob/master/vm/systemSmartContracts/governance.go
|
Merged the PR to LE: This is the PR: #1148. |
Description of the pull request (what is new / what has changed)
Did you test the changes locally ?
Which category (categories) does this pull request belong to?