Skip to content

Commit

Permalink
doc(pallet-dao): missing documentation (#984)
Browse files Browse the repository at this point in the history
  • Loading branch information
renauter authored Jul 8, 2024
1 parent 65c2de3 commit 54805ca
Show file tree
Hide file tree
Showing 12 changed files with 98 additions and 62 deletions.
9 changes: 6 additions & 3 deletions docs/architecture/0015-duplicate-veto.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/858) for more details.
See [here](https://github.com/threefoldtech/tfchain/issues/858) for more
details.

## Decision

Since we don't want a council member to veto a DAO proposal alone by being able to submit its veto more than once we need to prevent duplicate veto.
In `pallet-dao`, `veto()` extrinsic should return an appropriate error while this situation occures.
Since we don't want a council member to veto a DAO proposal alone by being able
to submit its veto more than once we need to prevent duplicate veto. In
`pallet-dao`, `veto()` extrinsic should return an appropriate error while this
situation occures.

This file was deleted.

19 changes: 19 additions & 0 deletions docs/architecture/0016-rework-dao-voting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 16. Add condition to DAO motion approval

Date: 2023-11-07

## Status

Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/803) for more
details.

## Decision

Stick to specs initial idea by adding new condition
`number of votes >= threshold` for proposal to be approved. If by the end of the
vote the minimal amount of votes is not reached, the proposal fails due to
insufficient interest.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 17. Add Source account ID to BurnTransaction and BurnTransactionExpired

Date: 2023-11-14

## Status

Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/883) for more
details.

## Decision

Add `Source` account ID to `BurnTransaction` storage type and
`BurnTransactionExpired` event and migrate previous `BurnTransactions` and
`ExecutedBurnTransactions` storages
16 changes: 0 additions & 16 deletions docs/architecture/0017-rework_cancel_contracts.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/architecture/0018-allow-renting-standby-node.md

This file was deleted.

19 changes: 19 additions & 0 deletions docs/architecture/0018-rework_cancel_contracts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 18. Allow collective approval to cancel contracts

Date: 2023-11-06

## Status

Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/884) for more
details.

## Decision

In `pallet-smart-contract`, add `cancel_contract_collective()` extrinsic to
allow a collective approval (council or farmers) to cancel a contract. For this
purpose we also add a new entry `CanceledByCollective` in `Cause` enum to better
qualify the cancelation cause.
27 changes: 27 additions & 0 deletions docs/architecture/0019-allow-renting-standby-node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 19. Allow renting standby node

Date: 2024-01-09

## Status

Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/923) for more
details.

## Decision

We want to be able to create a rent contract on node even if it is in standby
phase. Moreover, user should be billed for this contract only during online
periods.

In `pallet-smart-contract`:

- Remove the `node_power.is_down()` restriction when trying to create a rent
contract in `create_rent_contract()` extrinsic. restriction

- Modify rent contract billing logic by allowing billing only if the node is
online (`PowerState` = `Up`). To skip the billing during the standby period we
update the contract lock when the node power state is switched to `Up`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 19. Rework change power target on node
# 20. Rework change power target on node

Date: 2024-01-09

Expand All @@ -8,8 +8,10 @@ Accepted

## Context

See [here](https://github.com/threefoldtech/tfchain/issues/924) for more details.
See [here](https://github.com/threefoldtech/tfchain/issues/924) for more
details.

## Decision

Make sure that node has no active contracts on it to be able to change its `PowerTarget` to `Down` when calling `change_power_target()` extrinsic.
Make sure that node has no active contracts on it to be able to change its
`PowerTarget` to `Down` when calling `change_power_target()` extrinsic.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 20. Harden closing of a DAO motion voting
# 21. Harden closing of a DAO motion voting

Date: 2024-05-02

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 21. Allow 'only hdd' nodes to register on chain
# 22. Allow 'only hdd' nodes to register on chain

Date: 2024-05-22

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Open the Polkadot JS UI in your browser:

The proposal must include the following arguments:

* `threshold`: minimal number of farmer votes required to be able to close proposal before its end. should be at least 5 or more.
* `threshold`: minimal number of farmer votes required to be able to close proposal before its end and to approve the proposal (should be set to at least 5 votes).
* `action`: call/extrinsic to execute on chain. If there is no call to be executed (which is usually the case) then `system` -> `remark()` should be set.
* `description`: a small description of what the proposal is about.
* `link`: a link to a more elaborate explanation of the proposal.
Expand Down Expand Up @@ -52,7 +52,7 @@ After the proposal ends or, before it, if number of votes reached `threshold`, i
## Approval

Once closed the proposal is removed from list and the action, if any, is executed on chain in case of approval.
Since each farmer vote is weighted by the corresponding farm capacity (`weight = 2 * (sum of CU of all nodes) + (sum of SU of all nodes)`), approval is obtained when `Yes` votes quantity is strictly greater than `No` votes quantity.
Since each farmer vote is weighted by the corresponding farm capacity (`weight = 2 * (sum of CU of all nodes) + (sum of SU of all nodes)`), approval is obtained when `Yes` votes quantity is strictly greater than `No` votes quantity **and** total number of votes reached `threshold` value.

## Check proposal

Expand Down

0 comments on commit 54805ca

Please sign in to comment.