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 identiry and increase fee coefficient #223

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified parachain-gen/src/bytes/parachain_metadata.scale
Binary file not shown.
2 changes: 2 additions & 0 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch
pallet-scheduler = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.38", default-features = false }
pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.38", default-features = false }

# Cumulus dependencies
cumulus-pallet-aura-ext = { git = 'https://github.com/paritytech/cumulus', branch = 'polkadot-v0.9.38', default-features = false }
Expand Down Expand Up @@ -169,6 +170,7 @@ std = [
"pallet-transaction-payment/std",
"pallet-xcm/std",
"pallet-utility/std",
"pallet-identity/std",
"parachain-info/std",
"polkadot-parachain/std",
"polkadot-runtime-common/std",
Expand Down
31 changes: 30 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl WeightToFeePolynomial for WeightToFee {
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT:
// in our template, we map to 1/10 of that, or 1/10 MILLIUNIT
let p = MILLIUNIT / 10;
let p = MILLIUNIT * 10_000_000;
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
smallvec![WeightToFeeCoefficient {
degree: 1,
Expand Down Expand Up @@ -848,6 +848,10 @@ parameter_types! {
pub type TechnicalCollective = pallet_collective::Instance1;
pub type CouncilCollective = pallet_collective::Instance2;

type MoreThanHalfCouncil = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureProportionMoreThan<AccountId, CouncilCollective, 1, 2>,
>;
type AtLeastHalfCouncil = EitherOfDiverse<
pallet_collective::EnsureProportionAtLeast<AccountId, CouncilCollective, 1, 2>,
EnsureRoot<AccountId>,
Expand Down Expand Up @@ -1029,6 +1033,30 @@ impl pallet_utility::Config for Runtime {
type PalletsOrigin = OriginCaller;
}

parameter_types! {
pub const BasicDeposit: Balance = 1_0000_0000_0000_0000;
pub const FieldDeposit: Balance = 1_0000_0000_0000_0000;
pub const SubAccountDeposit: Balance = 1_0000_0000_0000_0000;
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const MaxRegistrars: u32 = 20;
}

impl pallet_identity::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
type SubAccountDeposit = SubAccountDeposit;
type MaxSubAccounts = MaxSubAccounts;
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type Slashed = ();
type ForceOrigin = MoreThanHalfCouncil;
type RegistrarOrigin = MoreThanHalfCouncil;
type WeightInfo = ();
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Expand Down Expand Up @@ -1091,6 +1119,7 @@ construct_runtime!(
Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event<T>} = 114,
ElectionsPhragmen: pallet_elections_phragmen::{Pallet, Call, Storage, Event<T>, Config<T>} = 115,
Utility: pallet_utility::{Pallet, Call, Event} = 116,
Identity: pallet_identity::{Pallet, Call, Storage, Event<T>} = 117,

#[cfg(any(feature = "rococo", feature = "alphanet"))]
XCMAppSudoWrapper: xcm_app_sudo_wrapper::{Pallet, Call, Storage, Event<T>} = 150,
Expand Down