Skip to content

Commit

Permalink
Disable democracy
Browse files Browse the repository at this point in the history
  • Loading branch information
0xrjman committed Dec 29, 2024
1 parent 9f8b381 commit e0960d2
Show file tree
Hide file tree
Showing 9 changed files with 323 additions and 323 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ jobs:
fields: repo,message,commit,author,eventName,ref,workflow
if: always()

postrelease:
needs: srtool
runs-on: ${{ needs.start-runner.outputs.label }}
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Get GIT Tag
id: git_tag
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: parallel-release-bot
DISCORD_AVATAR: https://avatars.githubusercontent.com/u/79623569
uses: Ilshidur/action-discord@master
with:
args: "Parallel ${{ steps.git_tag.outputs.tag }} has just been released! Go check it out: https://github.com/${{ github.repository }}/releases/tag/${{ steps.git_tag.outputs.tag }}"
# postrelease:
# needs: srtool
# runs-on: ${{ needs.start-runner.outputs.label }}
# if: startsWith(github.ref, 'refs/tags/')
# steps:
# - name: Get GIT Tag
# id: git_tag
# run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
# - name: Discord notification
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
# DISCORD_USERNAME: parallel-release-bot
# DISCORD_AVATAR: https://avatars.githubusercontent.com/u/79623569
# uses: Ilshidur/action-discord@master
# with:
# args: "Parallel ${{ steps.git_tag.outputs.tag }} has just been released! Go check it out: https://github.com/${{ github.repository }}/releases/tag/${{ steps.git_tag.outputs.tag }}"
12 changes: 6 additions & 6 deletions node/parallel/src/chain_spec/heiko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
use heiko_runtime::SudoConfig;
use heiko_runtime::{
opaque::SessionKeys, BalancesConfig, BaseFeeConfig, BridgeMembershipConfig,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, DemocracyConfig, EVMConfig,
GeneralCouncilConfig, GeneralCouncilMembershipConfig, GenesisConfig,
LiquidStakingAgentsMembershipConfig, LiquidStakingConfig, OracleMembershipConfig,
ParachainInfoConfig, ParallelPrecompilesType, PolkadotXcmConfig, SessionConfig, SystemConfig,
TechnicalCommitteeMembershipConfig, VestingConfig, WASM_BINARY,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, EVMConfig, GeneralCouncilConfig,
GeneralCouncilMembershipConfig, GenesisConfig, LiquidStakingAgentsMembershipConfig,
LiquidStakingConfig, OracleMembershipConfig, ParachainInfoConfig, ParallelPrecompilesType,
PolkadotXcmConfig, SessionConfig, SystemConfig, TechnicalCommitteeMembershipConfig,
VestingConfig, WASM_BINARY,
};
use primitives::*;
use sc_service::ChainType;
Expand Down Expand Up @@ -183,7 +183,7 @@ fn heiko_genesis(
exchange_rate: Rate::saturating_from_rational(100_u32, 100_u32), // 1
reserve_factor: Ratio::from_rational(1u32, 10_000u32), // 0.01%
},
democracy: DemocracyConfig::default(),
// democracy: DemocracyConfig::default(),
general_council: GeneralCouncilConfig::default(),
general_council_membership: GeneralCouncilMembershipConfig {
members: council.try_into().unwrap(),
Expand Down
12 changes: 6 additions & 6 deletions node/parallel/src/chain_spec/kerria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

use kerria_runtime::{
opaque::SessionKeys, BalancesConfig, BaseFeeConfig, BridgeMembershipConfig,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, DemocracyConfig, EVMConfig,
GeneralCouncilConfig, GeneralCouncilMembershipConfig, GenesisConfig,
LiquidStakingAgentsMembershipConfig, LiquidStakingConfig, OracleMembershipConfig,
ParachainInfoConfig, ParallelPrecompilesType, PolkadotXcmConfig, SessionConfig, SudoConfig,
SystemConfig, TechnicalCommitteeMembershipConfig, VestingConfig, WASM_BINARY,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, EVMConfig, GeneralCouncilConfig,
GeneralCouncilMembershipConfig, GenesisConfig, LiquidStakingAgentsMembershipConfig,
LiquidStakingConfig, OracleMembershipConfig, ParachainInfoConfig, ParallelPrecompilesType,
PolkadotXcmConfig, SessionConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig,
VestingConfig, WASM_BINARY,
};
use primitives::{network::NetworkType, *};
use sc_service::ChainType;
Expand Down Expand Up @@ -203,7 +203,7 @@ fn kerria_genesis(
exchange_rate: Rate::saturating_from_rational(100u32, 100u32), // 1
reserve_factor: Ratio::from_rational(5u32, 10_000u32), // 0.05%
},
democracy: DemocracyConfig::default(),
// democracy: DemocracyConfig::default(),
general_council: GeneralCouncilConfig::default(),
general_council_membership: GeneralCouncilMembershipConfig {
members: council.try_into().unwrap(),
Expand Down
12 changes: 6 additions & 6 deletions node/parallel/src/chain_spec/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
use parallel_runtime::SudoConfig;
use parallel_runtime::{
opaque::SessionKeys, BalancesConfig, BaseFeeConfig, BridgeMembershipConfig,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, DemocracyConfig, EVMConfig,
GeneralCouncilConfig, GeneralCouncilMembershipConfig, GenesisConfig,
LiquidStakingAgentsMembershipConfig, LiquidStakingConfig, OracleMembershipConfig,
ParachainInfoConfig, ParallelPrecompilesType, PolkadotXcmConfig, SessionConfig, SystemConfig,
TechnicalCommitteeMembershipConfig, VestingConfig, WASM_BINARY,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, EVMConfig, GeneralCouncilConfig,
GeneralCouncilMembershipConfig, GenesisConfig, LiquidStakingAgentsMembershipConfig,
LiquidStakingConfig, OracleMembershipConfig, ParachainInfoConfig, ParallelPrecompilesType,
PolkadotXcmConfig, SessionConfig, SystemConfig, TechnicalCommitteeMembershipConfig,
VestingConfig, WASM_BINARY,
};
use primitives::{network::NetworkType, *};
use sc_service::ChainType;
Expand Down Expand Up @@ -179,7 +179,7 @@ fn parallel_genesis(
exchange_rate: Rate::saturating_from_rational(100_u32, 100_u32), // 1
reserve_factor: Ratio::from_rational(5u32, 10_000u32), //0.05%
},
democracy: DemocracyConfig::default(),
// democracy: DemocracyConfig::default(),
general_council: GeneralCouncilConfig::default(),
general_council_membership: GeneralCouncilMembershipConfig {
members: council.try_into().unwrap(),
Expand Down
12 changes: 6 additions & 6 deletions node/parallel/src/chain_spec/vanilla.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use sp_runtime::{traits::Zero, FixedPointNumber};
use std::{collections::BTreeMap, str::FromStr};
use vanilla_runtime::{
opaque::SessionKeys, BalancesConfig, BaseFeeConfig, BridgeMembershipConfig,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, DemocracyConfig, EVMConfig,
GeneralCouncilConfig, GeneralCouncilMembershipConfig, GenesisConfig,
LiquidStakingAgentsMembershipConfig, LiquidStakingConfig, OracleMembershipConfig,
ParachainInfoConfig, ParallelPrecompilesType, PolkadotXcmConfig, SessionConfig, SudoConfig,
SystemConfig, TechnicalCommitteeMembershipConfig, VestingConfig, WASM_BINARY,
CollatorSelectionConfig, CrowdloansAutomatorsMembershipConfig, EVMConfig, GeneralCouncilConfig,
GeneralCouncilMembershipConfig, GenesisConfig, LiquidStakingAgentsMembershipConfig,
LiquidStakingConfig, OracleMembershipConfig, ParachainInfoConfig, ParallelPrecompilesType,
PolkadotXcmConfig, SessionConfig, SudoConfig, SystemConfig, TechnicalCommitteeMembershipConfig,
VestingConfig, WASM_BINARY,
};

use crate::chain_spec::{
Expand Down Expand Up @@ -257,7 +257,7 @@ fn vanilla_genesis(
exchange_rate: Rate::saturating_from_rational(100u32, 100u32), // 1
reserve_factor: Ratio::from_rational(1u32, 10_000u32), // 0.01%
},
democracy: DemocracyConfig::default(),
// democracy: DemocracyConfig::default(),
general_council: GeneralCouncilConfig::default(),
general_council_membership: GeneralCouncilMembershipConfig {
members: council.try_into().unwrap(),
Expand Down
144 changes: 72 additions & 72 deletions runtime/heiko/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("heiko"),
impl_name: create_runtime_str!("heiko"),
authoring_version: 1,
spec_version: 209,
spec_version: 312,
impl_version: 33,
apis: RUNTIME_API_VERSIONS,
transaction_version: 17,
Expand Down Expand Up @@ -262,7 +262,7 @@ impl Contains<RuntimeCall> for WhiteListFilter {
RuntimeCall::Assets(pallet_assets::Call::force_transfer { .. }) |
// Governance
RuntimeCall::Sudo(_) |
RuntimeCall::Democracy(_) |
// RuntimeCall::Democracy(_) |
RuntimeCall::GeneralCouncil(_) |
RuntimeCall::TechnicalCommittee(_) |
RuntimeCall::Treasury(_) |
Expand Down Expand Up @@ -994,8 +994,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
ProxyType::Governance => {
matches!(
c,
RuntimeCall::Democracy(..)
| RuntimeCall::Preimage(..)
// RuntimeCall::Democracy(..) |
RuntimeCall::Preimage(..)
| RuntimeCall::GeneralCouncil(..)
| RuntimeCall::TechnicalCommittee(..)
| RuntimeCall::Treasury(..)
Expand Down Expand Up @@ -1490,71 +1490,71 @@ type EnsureRootOrMoreThanHalfGeneralCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, GeneralCouncilCollective, 1, 2>,
>;
type EnsureRootOrAllTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
>;

parameter_types! {
pub const LaunchPeriod: BlockNumber = 1 * DAYS;
pub const VotingPeriod: BlockNumber = 5 * DAYS;
pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS;
pub const InstantAllowed: bool = true;
pub const MinimumDeposit: Balance = 20_000 * DOLLARS;
pub const EnactmentPeriod: BlockNumber = 1 * DAYS;
pub const CooloffPeriod: BlockNumber = 7 * DAYS;
// One cent: $10,000 / MB
pub const MaxVotes: u32 = 100;
pub const MaxProposals: u32 = 100;
}

impl pallet_democracy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type EnactmentPeriod = EnactmentPeriod;
type LaunchPeriod = LaunchPeriod;
type VotingPeriod = VotingPeriod;
type MinimumDeposit = MinimumDeposit;
/// A straight majority of the council can decide what their next motion is.
type ExternalOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 1, 2>;
/// A super-majority can have the next scheduled referendum be a straight majority-carries vote.
type ExternalMajorityOrigin =
pallet_collective::EnsureProportionMoreThan<AccountId, GeneralCouncilCollective, 1, 2>;
/// A unanimous council can have the next scheduled referendum be a straight default-carries
/// (NTB) vote.
type ExternalDefaultOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 1, 1>;
/// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
/// be tabled immediately and with a shorter voting/enactment period.
type FastTrackOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
type InstantOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>;
type InstantAllowed = InstantAllowed;
type FastTrackVotingPeriod = FastTrackVotingPeriod;
// To cancel a proposal which has been passed, 2/3 of the council must agree to it.
type CancellationOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 2, 3>;
// To cancel a proposal before it has been passed, the technical committee must be unanimous or
// Root must agree.
type CancelProposalOrigin = EnsureRootOrAllTechnicalCommittee;
type BlacklistOrigin = EnsureRoot<AccountId>;
// Any single technical committee member may veto a coming council proposal, however they can
// only do it once and it lasts only for the cool-off period.
type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
type CooloffPeriod = CooloffPeriod;
type Slash = Treasury;
type Scheduler = Scheduler;
type PalletsOrigin = OriginCaller;
type MaxVotes = MaxVotes;
type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
type MaxProposals = MaxProposals;
type VoteLockingPeriod = EnactmentPeriod;
type Preimages = Preimage;
type MaxDeposits = ConstU32<100>;
type MaxBlacklisted = ConstU32<100>;
}
// type EnsureRootOrAllTechnicalCommittee = EitherOfDiverse<
// EnsureRoot<AccountId>,
// pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>,
// >;

// parameter_types! {
// pub const LaunchPeriod: BlockNumber = 1 * DAYS;
// pub const VotingPeriod: BlockNumber = 5 * DAYS;
// pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS;
// pub const InstantAllowed: bool = true;
// pub const MinimumDeposit: Balance = 20_000 * DOLLARS;
// pub const EnactmentPeriod: BlockNumber = 1 * DAYS;
// pub const CooloffPeriod: BlockNumber = 7 * DAYS;
// // One cent: $10,000 / MB
// pub const MaxVotes: u32 = 100;
// pub const MaxProposals: u32 = 100;
// }

// impl pallet_democracy::Config for Runtime {
// type RuntimeEvent = RuntimeEvent;
// type Currency = Balances;
// type EnactmentPeriod = EnactmentPeriod;
// type LaunchPeriod = LaunchPeriod;
// type VotingPeriod = VotingPeriod;
// type MinimumDeposit = MinimumDeposit;
// /// A straight majority of the council can decide what their next motion is.
// type ExternalOrigin =
// pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 1, 2>;
// /// A super-majority can have the next scheduled referendum be a straight majority-carries vote.
// type ExternalMajorityOrigin =
// pallet_collective::EnsureProportionMoreThan<AccountId, GeneralCouncilCollective, 1, 2>;
// /// A unanimous council can have the next scheduled referendum be a straight default-carries
// /// (NTB) vote.
// type ExternalDefaultOrigin =
// pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 1, 1>;
// /// Two thirds of the technical committee can have an ExternalMajority/ExternalDefault vote
// /// be tabled immediately and with a shorter voting/enactment period.
// type FastTrackOrigin =
// pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
// type InstantOrigin =
// pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 1>;
// type InstantAllowed = InstantAllowed;
// type FastTrackVotingPeriod = FastTrackVotingPeriod;
// // To cancel a proposal which has been passed, 2/3 of the council must agree to it.
// type CancellationOrigin =
// pallet_collective::EnsureProportionAtLeast<AccountId, GeneralCouncilCollective, 2, 3>;
// // To cancel a proposal before it has been passed, the technical committee must be unanimous or
// // Root must agree.
// type CancelProposalOrigin = EnsureRootOrAllTechnicalCommittee;
// type BlacklistOrigin = EnsureRoot<AccountId>;
// // Any single technical committee member may veto a coming council proposal, however they can
// // only do it once and it lasts only for the cool-off period.
// type VetoOrigin = pallet_collective::EnsureMember<AccountId, TechnicalCollective>;
// type CooloffPeriod = CooloffPeriod;
// type Slash = Treasury;
// type Scheduler = Scheduler;
// type PalletsOrigin = OriginCaller;
// type MaxVotes = MaxVotes;
// type WeightInfo = weights::pallet_democracy::WeightInfo<Runtime>;
// type MaxProposals = MaxProposals;
// type VoteLockingPeriod = EnactmentPeriod;
// type Preimages = Preimage;
// type MaxDeposits = ConstU32<100>;
// type MaxBlacklisted = ConstU32<100>;
// }

parameter_types! {
pub const GeneralCouncilMotionDuration: BlockNumber = 3 * DAYS;
Expand Down Expand Up @@ -1979,7 +1979,7 @@ construct_runtime!(

// Governance
Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 10,
Democracy: pallet_democracy::{Pallet, Call, Storage, Config<T>, Event<T>} = 11,
// Democracy: pallet_democracy::{Pallet, Call, Storage, Config<T>, Event<T>} = 11,
GeneralCouncil: pallet_collective::<Instance1>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 12,
TechnicalCommittee: pallet_collective::<Instance2>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 13,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 14,
Expand Down Expand Up @@ -2499,7 +2499,7 @@ impl_runtime_apis! {
list_benchmark!(list, extra, pallet_utility, Utility);
list_benchmark!(list, extra, cumulus_pallet_xcmp_queue, XcmpQueue);
list_benchmark!(list, extra, pallet_identity, Identity);
list_benchmark!(list, extra, pallet_democracy, Democracy);
// list_benchmark!(list, extra, pallet_democracy, Democracy);
list_benchmark!(list, extra, pallet_collective, TechnicalCommittee);
list_benchmark!(list, extra, pallet_preimage, Preimage);
list_benchmark!(list, extra, pallet_scheduler, Scheduler);
Expand Down Expand Up @@ -2558,7 +2558,7 @@ impl_runtime_apis! {
add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, cumulus_pallet_xcmp_queue, XcmpQueue);
add_benchmark!(params, batches, pallet_identity, Identity);
add_benchmark!(params, batches, pallet_democracy, Democracy);
// add_benchmark!(params, batches, pallet_democracy, Democracy);
add_benchmark!(params, batches, pallet_collective, TechnicalCommittee);
add_benchmark!(params, batches, pallet_preimage, Preimage);
add_benchmark!(params, batches, pallet_scheduler, Scheduler);
Expand Down
Loading

0 comments on commit e0960d2

Please sign in to comment.