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

Add Governance Configuration and Chopsticks setup #6

Merged
merged 18 commits into from
Feb 29, 2024

Conversation

clangenb
Copy link
Contributor

@clangenb clangenb commented Feb 28, 2024

This PR adds the governance config, namely it adds the technical committee including its membership pallet instance, and adds the democracy pallet. I decided to add the membership pallet after all because during the polkadot update there was a new EnsureSignedBy origin check introduced in substrate. This struct made my manual implementation to ensure that the submit proposal origin is a council member obsolete. However, it works only with the membership pallet.

Note: This PR also fixes the pallet-preimage configuration. Submitting a preimage was broken before.

Chopsticks tests

Fork of the current network and do:

  • Check that council and technical committee members are empty
  • Set collective members via a sudo call:
    • councilMembership.resetMembers(Alice, Bob, Charlie)
    • technicalCommitteeMembership.resetMembers(Alice, Bob, Charlie)
  • Set the prime of the council via the regular council proposal flow:
    • Council tab -> prose motion councilMembership.setPrime(Alice)
    • Vote yes with two members and close motion: tests that > 50% council origin works.
  • Fast track some proposal that needs root origin:
    • register preimage via preimage tab: balances.forceSetBalance(Charlie, 1000000000000)
    • propose it as an external motion so it can be fast tracked: council.proposeExternal(preimageHash, preimageLength)
    • Fast track it with voting period 10, and delay 5 (random small numbers).
    • go to the developer tap of polkadot.js and run api.rpc('dev_newBlock', { count: 10 })
    • check that the referendum has been executed and create another few blocks to execute the scheduled task api.rpc('dev_newBlock', { count: 5})
  • check that a non-council origin can't submit a proposal

The governance stuff is pretty complex, and more things can be tested, but the above tests are the most crucial things to ensure that we don't lock ourselves out of the system.

@clangenb clangenb marked this pull request as draft February 28, 2024 03:03
@clangenb clangenb changed the title Add Governance Add Governance Configuration and Chopsticks setup Feb 28, 2024
@@ -940,21 +918,23 @@ extern crate frame_benchmarking;
#[cfg(feature = "runtime-benchmarks")]
mod benches {
define_benchmarks!(
[cumulus_pallet_xcmp_queue, XcmpQueue]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorted the substrate pallet entries here and added the membership benchmarks.

@@ -429,7 +436,7 @@ impl pallet_balances::Config for Runtime {
type ReserveIdentifier = [u8; 8];
type FreezeIdentifier = ();
type MaxFreezes = ();
type RuntimeHoldReason = ();
type RuntimeHoldReason = RuntimeHoldReason;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This broke submitting preimages .

Comment on lines +763 to +768
type Consideration = HoldConsideration<
AccountId,
Balances,
PreimageHoldReason,
LinearStoragePrice<PreimageBaseDeposit, PreimageByteDeposit, Balance>,
>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same config as kusama

@clangenb clangenb marked this pull request as ready for review February 28, 2024 05:53
Copy link
Contributor

@darkfriend77 darkfriend77 left a comment

Choose a reason for hiding this comment

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

good!

@darkfriend77
Copy link
Contributor

Let's move this in place then, for a runtime upgrade.

@clangenb clangenb merged commit 67c9206 into develop Feb 29, 2024
5 checks passed
@clangenb clangenb deleted the cl/add-governace branch February 29, 2024 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants