Skip to content
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

Local/Shibuya v1 governance integration #1260

Merged
merged 31 commits into from
Jul 2, 2024
Merged

Conversation

Dinonard
Copy link
Member

@Dinonard Dinonard commented Jun 11, 2024

Governance v1 Integration - Local & Shibuya

This PR integrates the governance v1 logic into local & shibuya runtimes.
New specialized pallet is added, as well as some modifications to the dApp staking logic.

dApp Staking

  • added 2 new associated types for configuring register and unregister origins
    • the purpose of this is to help community council with registration, but don't allow unregister
  • two new extrinsic calls for claiming staker rewards on behalf of another account
    • this is safe to do since the only reward recipient is the actual account
    • needed in order to improve UX of the reward claiming for multisig/collective controlled accounts

Collective Proxy

  • similar to proxy pallet but allows aliasing of collective origin to an account
  • useful in case collective controls an address and they want to lock/stake funds
  • pallet logic is simple, mirroring that of the proxy pallet with minor additions

Primitives

  • defined governance-related pallet instances & collective proportions for easier re-use

Governance

  • 3 separate collective/memberships defined
    • General Council
    • Technical Committee
    • Community Council
  • 2 instances of pallet treasury to handle general treasury & community treasury
  • democracy pallet to integrate Gov v1 logic
  • 2 instances of treasury pallet - one to cover on-chain treasury, the other one to cover community treasury
  • collective proxy pallet allows the community council to utilize dApp staking on behalf of the community treasury

Init Config

  • for the sake of simplicity & flexibility, initial membership can be set using the sudo call

Check list

  • claim reward for call
  • integration tests
  • collective proxy benchmarks

@Dinonard Dinonard added shibuya related to shibuya runtime This PR/Issue is related to the topic “runtime”. labels Jun 26, 2024
@Dinonard Dinonard self-assigned this Jun 26, 2024
@Dinonard Dinonard marked this pull request as ready for review June 26, 2024 15:57
ermalkaleci
ermalkaleci previously approved these changes Jun 28, 2024
Copy link
Member

@PierreOssun PierreOssun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean for me. Just commented on some nitpicks I found

pallets/dapp-staking-v3/src/lib.rs Outdated Show resolved Hide resolved
@@ -1557,7 +1431,7 @@ pub mod pallet {
#[pallet::weight(T::WeightInfo::force())]
pub fn force(origin: OriginFor<T>, forcing_type: ForcingType) -> DispatchResult {
Self::ensure_pallet_enabled()?;
T::ManagerOrigin::ensure_origin(origin)?;
ensure_root(origin)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we still have the possibility to dispatch root calls on live env ? Will Manager still be relevant ?
Also please update the fn description

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, via democracy pallet.

And of course, sudo 🙂

PierreOssun
PierreOssun previously approved these changes Jul 2, 2024
@Dinonard
Copy link
Member Author

Dinonard commented Jul 2, 2024

/bench shibuya-dev pallet-collective-proxy

Copy link

github-actions bot commented Jul 2, 2024

Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/9760180110.
Please wait for a while.
Branch: feat/governance-shibuya
SHA: 463b29d

Copy link

github-actions bot commented Jul 2, 2024

Benchmarks have been finished.
You can download artifacts if exists https://github.com/AstarNetwork/Astar/actions/runs/9760180110.

Copy link

github-actions bot commented Jul 2, 2024

Code Coverage

Package Line Rate Branch Rate Health
precompiles/dapp-staking-v3/src/test 0% 0%
precompiles/xcm/src 73% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
pallets/dapp-staking-v3/src/test 0% 0%
pallets/dapp-staking-v3/src/benchmarking 98% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
precompiles/dispatch-lockdrop/src 86% 0%
precompiles/assets-erc20/src 81% 0%
primitives/src/xcm 64% 0%
precompiles/substrate-ecdsa/src 74% 0%
pallets/xvm/src 54% 0%
pallets/price-aggregator/src 72% 0%
pallets/collective-proxy/src 86% 0%
chain-extensions/pallet-assets/src 56% 0%
chain-extensions/types/unified-accounts/src 0% 0%
chain-extensions/xvm/src 0% 0%
pallets/dapp-staking-v3/rpc/runtime-api/src 0% 0%
precompiles/xvm/src 75% 0%
precompiles/unified-accounts/src 100% 0%
pallets/unified-accounts/src 86% 0%
pallets/static-price-provider/src 52% 0%
chain-extensions/types/xvm/src 0% 0%
precompiles/dapp-staking-v3/src 90% 0%
primitives/src 62% 0%
precompiles/sr25519/src 64% 0%
pallets/xc-asset-config/src 64% 0%
pallets/dapp-staking-migration/src 0% 0%
pallets/inflation/src 83% 0%
chain-extensions/types/assets/src 0% 0%
pallets/ethereum-checked/src 79% 0%
pallets/collator-selection/src 91% 0%
pallets/dapp-staking-v3/src 90% 0%
pallets/astar-xcm-benchmarks/src 88% 0%
pallets/dynamic-evm-base-fee/src 89% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/oracle-benchmarks/src 0% 0%
Summary 77% (3673 / 4766) 0% (0 / 0)

Minimum allowed line rate is 50%

@Dinonard Dinonard merged commit dc58446 into master Jul 2, 2024
8 of 9 checks passed
@Dinonard Dinonard deleted the feat/governance-shibuya branch July 2, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime This PR/Issue is related to the topic “runtime”. shibuya related to shibuya
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants