From 587c8cfd35179970c1a3b08a3821b00858a3cd21 Mon Sep 17 00:00:00 2001 From: Xavier Lau Date: Fri, 20 Sep 2024 03:26:33 +0800 Subject: [PATCH] DIP-7, 8 --- DIPs/dip-0.md | 4 +- DIPs/dip-1.md | 4 +- DIPs/dip-4.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++ DIPs/dip-5.md | 2 +- DIPs/dip-6.md | 6 +-- DIPs/dip-7.md | 2 +- DIPs/dip-8.md | 31 +++++++++++++++ README.md | 2 +- 8 files changed, 144 insertions(+), 10 deletions(-) create mode 100644 DIPs/dip-4.md create mode 100644 DIPs/dip-8.md diff --git a/DIPs/dip-0.md b/DIPs/dip-0.md index 04557b3..adab8ca 100644 --- a/DIPs/dip-0.md +++ b/DIPs/dip-0.md @@ -3,7 +3,7 @@ dip: 0 title: Staking Power Specification authors: Darwinia Network (@AurevoirXavier, @hackfisher) discussions-to: None -relate-to: DIP-5 +relate-to: [DIP-5](dip-5.md) status: Superseded type: Economic created: 2023-11-28 @@ -13,7 +13,7 @@ created: 2023-11-28 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! Replaced by [DIP-5](dip-5.md) !!! +!!! Superseded by [DIP-5](dip-5.md) !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/DIPs/dip-1.md b/DIPs/dip-1.md index 763c34a..c40ca45 100644 --- a/DIPs/dip-1.md +++ b/DIPs/dip-1.md @@ -3,7 +3,7 @@ dip: 1 title: Staking Commission Specification authors: Darwinia Network (@AurevoirXavier, @hackfisher, @hujw77, @xiaoch05) discussions-to: https://github.com/orgs/darwinia-network/discussions/1238, https://github.com/orgs/darwinia-network/discussions/1272 -relate-to: DIP-6 +relate-to: [DIP-6](dip-6.md) status: Superseded type: Economic created: 2023-11-27 @@ -13,7 +13,7 @@ created: 2023-11-27 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! Replaced by [DIP-6](dip-6.md) !!! +!!! Superseded by [DIP-6](dip-6.md) !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/DIPs/dip-4.md b/DIPs/dip-4.md new file mode 100644 index 0000000..d56b799 --- /dev/null +++ b/DIPs/dip-4.md @@ -0,0 +1,103 @@ +--- +dip: 4 +title: Governance V2 +authors: Darwinia Network (@AurevoirXavier) +discussions-to: None +relate-to: [DIP-8](dip-8.md) +status: Final +type: Governance +created: 2024-09-18 +--- + +# DIP-4 + +## Abstract + +This DIP proposes the introduction of GovernanceV2, also known as OpenGov, to the Darwinia Network. + +For more information, please refer to the official OpenGov [wiki](https://wiki.polkadot.network/docs/learn-polkadot-opengov). + +## Rationale + +**In V1:** +- Only one proposal could be voted on at a time, which is inconvenient for a community-driven project like the Darwinia Network. A more flexible governance system is needed to support multiple simultaneous proposals. +- The council holds excessive power in the governance process. A more decentralized governance system is required to enhance community involvement in decision-making. +- The technical committee has limited functionality within the current governance framework. A more comprehensive governance system is necessary to increase the technical committee's effectiveness. + +**With V2:** +- Multiple proposals across different tracks can be voted on simultaneously, enhancing the efficiency and flexibility of the governance process. +- The introduction of tracks allows for more granular control over pass requirements. +- The council can be removed, and its responsibilities delegated to different tracks, thereby ensuring a more decentralized governance structure. +- The technical committee can function similarly to a fellowship within Polkadot, enabling it to whitelist proposals and expedite the governance process. + +## Specification + +Seven tracks will be configured for the Darwinia Network. + +The first one is `Root`, which remains essentially the same as in V1. Every passed proposal will be executed with the root origin. + +The remaining tracks are defined as follows: + +```rs +pub enum Origin { + /// Origin able to dispatch a whitelisted call. + WhitelistedCaller, + /// General admin + GeneralAdmin, + /// Origin able to cancel referenda. + ReferendumCanceller, + /// Origin able to kill referenda. + ReferendumKiller, + /// Origin able to spend up to 4M RING from the treasury at once. + MediumSpender, + /// Origin able to spend up to 20M RING from the treasury at once. + BigSpender, +} +``` + +The specific spending limits are implemented through the following code: + +```rs +macro_rules! decl_ensure { + ( + $vis:vis type $name:ident: EnsureOrigin { + $( $item:ident = $success:expr, )* + } + ) => { + $vis struct $name; + impl> + From> + EnsureOrigin for $name + { + type Success = $success_type; + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + $( + Origin::$item => Ok($success), + )* + r => Err(O::from(r)), + }) + } + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + // By convention the more privileged origins go later, so for greatest chance + // of success, we want the last one. + let _result: Result = Err(()); + $( + let _result: Result = Ok(O::from(Origin::$item)); + )* + _result + } + } + } +} +decl_ensure! { + pub type Spender: EnsureOrigin { + MediumSpender = 4_000_000 * UNIT, + BigSpender = 20_000_000 * UNIT, + } +} +``` + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE). diff --git a/DIPs/dip-5.md b/DIPs/dip-5.md index b093e8c..8bcf640 100644 --- a/DIPs/dip-5.md +++ b/DIPs/dip-5.md @@ -3,7 +3,7 @@ dip: 5 title: KTON Staking authors: Darwinia Network (@AurevoirXavier, @hackfisher, @hujw77) discussions-to: https://github.com/orgs/darwinia-network/discussions/1393 -relate-to: DIP-0 +relate-to: [DIP-0](dip-0.md) status: Final type: Economic created: 2024-01-29 diff --git a/DIPs/dip-6.md b/DIPs/dip-6.md index d2c46bf..e305cf9 100644 --- a/DIPs/dip-6.md +++ b/DIPs/dip-6.md @@ -3,7 +3,7 @@ dip: 6 title: Flexible and Secure Staking System authors: Darwinia Network (@AurevoirXavier, @hackfisher) discussions-to: https://github.com/orgs/darwinia-network/discussions/1455 -relate-to: DIP-7 +relate-to: [DIP-7](dip-7.md) status: Superseded type: Economic created: 2024-04-10 @@ -13,7 +13,7 @@ created: 2024-04-10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!!! Replaced by [DIP-7](dip-7.md) !!! +!!! Superseded by [DIP-7](dip-7.md) !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -27,7 +27,7 @@ Restrict the rate of entry and exit in collator staking while eliminating the un security is upheld by validators on the relaychain side. Collators are solely responsible for block collection; therefore, the original mechanism for maintaining network security should be updated accordingly. 2. Currently, there is no staking slash mechanism in place, rendering the unbonding duration largely irrelevant. - This should be replaced by a different mechanism. However, should a staking slashing mechanism be implemented in the future, + This should be superseded by a different mechanism. However, should a staking slashing mechanism be implemented in the future, reintroduction of the unbonding duration should be reconsidered. 3. Introducing a rate-limited mechanism can mitigate potential instability in token prices affecting network stability if the unbonding duration is removed. Other factors also play a role. Similar mechanisms are employed by Ethereum to maintain network stability. diff --git a/DIPs/dip-7.md b/DIPs/dip-7.md index c990971..7f4a4b6 100644 --- a/DIPs/dip-7.md +++ b/DIPs/dip-7.md @@ -3,7 +3,7 @@ dip: 7 title: EVM Staking authors: Darwinia Network (@AurevoirXavier, @hackfisher, @hujw77) discussions-to: https://github.com/orgs/darwinia-network/discussions/1481 -relate-to: DIP-6 +relate-to: [DIP-6](dip-6.md) status: Final type: Core created: 2024-06-30 diff --git a/DIPs/dip-8.md b/DIPs/dip-8.md new file mode 100644 index 0000000..bfd4273 --- /dev/null +++ b/DIPs/dip-8.md @@ -0,0 +1,31 @@ +--- +dip: 8 +title: Governance V3 +authors: Darwinia Network (@AurevoirXavier, @hujw77, @HackFisher) +discussions-to: None +relate-to: [DIP-4](dip-4.md) +status: Approved +type: Governance +created: 2024-09-18 +--- + +# DIP-8 + +## Abstract + +This DIP aims to enhance the flexibility and efficiency of Darwinia Network's governance. Since the Darwinia Network is based on the EVM, and OpenGov was designed for Polkadot, it is not ideally suited for Darwinia Network's specific requirements. + +## Rationale + +The objectives of this DIP are as follows: + +- **Improve User Experience:** Allow users to vote directly using EVM-compatible wallets without the need to interact with Polkadot.js. +- **Enable Staking Tokens for Voting:** Permit the use of general staking tokens for voting. In the current OpenGov system, the Polkadot SDK's account balance lock model does not allow these tokens to be utilized for voting. + +## Specification + +TODO. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE). diff --git a/README.md b/README.md index 1392a2c..ed93f08 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Each DIP goes through several stages during its lifecycle. Below are the common - **Final**: The DIP has been merged and the necessary engineering work has been completed. - **Deferred**: The DIP has been postponed for future consideration. - **Rejected**: The DIP has been rejected and will not be implemented. -- **Superseded**: The DIP has been replaced by a newer DIP. +- **Superseded**: The DIP has been superseded by a newer DIP. - **Deprecated**: The DIP is no longer relevant and has been marked as deprecated. The status of a DIP is updated as it moves through the proposal process, ensuring clear communication of its current state.