Skip to content
Merged
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
74 changes: 24 additions & 50 deletions runtimes/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ parameter_types! {
pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons =
WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE);
/// Deposits per byte
pub const ByteDeposit: Balance = deposit(0, 1);
pub const ByteDeposit: Balance = 0;
/// Index Pallet. Deposit taken for an account index
pub const IndicesDeposit: Balance = deposit(1, MAX_INDICES_BYTE_LENGTH);
pub const IndicesDeposit: Balance = 0;
/// CType Pallet. Per byte fee for a ctype.
pub const CtypeFee: Balance = MILLI_KILT;
pub const CtypeFee: Balance = 0;
}

pub mod attestation {
use super::*;

/// The size is checked in the runtime by a test.
pub const MAX_ATTESTATION_BYTE_LENGTH: u32 = 179;
pub const ATTESTATION_DEPOSIT: Balance = deposit(2, MAX_ATTESTATION_BYTE_LENGTH);
pub const ATTESTATION_DEPOSIT: Balance = 0;

parameter_types! {
pub const MaxDelegatedAttestations: u32 = 1000;
Expand All @@ -163,11 +163,8 @@ pub mod bonded_coins {

/// The size is checked in the runtime by a test.
pub const MAX_POOL_BYTE_LENGTH: u32 = 987;
pub const BASE_DEPOSIT: Balance = deposit(1, MAX_POOL_BYTE_LENGTH);
const ASSET_ID_BYTE_LENGTH: u32 = 8;
/// https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/assets/src/types.rs#L188
const ASSET_METADATA_BYTE_LENGTH: u32 = 26;
pub const DEPOSIT_PER_CURRENCY: Balance = deposit(1, ASSET_ID_BYTE_LENGTH + (2 * ASSET_METADATA_BYTE_LENGTH));
pub const BASE_DEPOSIT: Balance = 0;
pub const DEPOSIT_PER_CURRENCY: Balance = 0;
pub const MAX_CURRENCIES: u32 = 50;
pub const MAX_DENOMINATION: u8 = 15;
pub const MAX_STRING_LENGTH: u32 = crate::constants::bonded_assets::STRING_LIMIT;
Expand Down Expand Up @@ -210,7 +207,7 @@ pub mod delegation {

use super::*;

pub const DELEGATION_DEPOSIT: Balance = KILT;
pub const DELEGATION_DEPOSIT: Balance = 0;
pub const MAX_SIGNATURE_BYTE_LENGTH: u16 = 64;
pub const MAX_PARENT_CHECKS: u32 = 5;
pub const MAX_REVOCATIONS: u32 = 5;
Expand All @@ -224,7 +221,7 @@ pub mod delegation {
pub const MaxRemovals: u32 = MAX_REMOVALS;
#[derive(Clone, TypeInfo)]
pub const MaxChildren: u32 = MAX_CHILDREN;
pub const DelegationDeposit: Balance = DELEGATION_DEPOSIT;
pub const DelegationDeposit: Balance = 0;
}
}

Expand All @@ -241,7 +238,7 @@ pub mod dip_provider {
pub const MAX_LINKED_ACCOUNTS: u32 = 10;
// Commitment are 32-byte hashes.
pub const MAX_COMMITMENT_BYTE_LENGTH: u32 = 32;
pub const COMMITMENT_DEPOSIT: Balance = deposit(1, MAX_COMMITMENT_BYTE_LENGTH);
pub const COMMITMENT_DEPOSIT: Balance = 0;
}

pub mod staking {
Expand Down Expand Up @@ -404,8 +401,8 @@ pub mod multisig {

parameter_types! {
pub const MaxSignitors: u32 = 64;
pub const DepositBase: Balance = DEPOSIT_STORAGE_ITEM;
pub const DepositFactor: Balance = DEPOSIT_STORAGE_BYTE;
pub const DepositBase: Balance = 0;
pub const DepositFactor: Balance = 0;
}
}

Expand Down Expand Up @@ -441,11 +438,11 @@ pub mod did {
+ MAX_NUMBER_OF_URLS_PER_SERVICE * MAX_SERVICE_URL_LENGTH
+ 8;

pub const DID_BASE_DEPOSIT: Balance = 2 * KILT;
pub const KEY_DEPOSIT: Balance = deposit(0, MAX_KEY_LENGTH);
pub const SERVICE_ENDPOINT_DEPOSIT: Balance = deposit(1, MAX_SERVICE_ENDPOINT_BYTE_LENGTH);
pub const DID_BASE_DEPOSIT: Balance = 0;
pub const KEY_DEPOSIT: Balance = 0;
pub const SERVICE_ENDPOINT_DEPOSIT: Balance = 0;

pub const DID_FEE: Balance = 50 * MILLI_KILT;
pub const DID_FEE: Balance = 0;
pub const MAX_KEY_AGREEMENT_KEYS: u32 = 10;
// This has been reduced from the previous 100, but it might still need
// fine-tuning depending on our needs.
Expand Down Expand Up @@ -488,7 +485,7 @@ pub mod did_lookup {

/// The size is checked in the runtime by a test.
pub const MAX_CONNECTION_BYTE_LENGTH: u32 = 80;
pub const DID_CONNECTION_DEPOSIT: Balance = deposit(1, MAX_CONNECTION_BYTE_LENGTH);
pub const DID_CONNECTION_DEPOSIT: Balance = 0;

parameter_types! {
pub const DidLookupDeposit: Balance = DID_CONNECTION_DEPOSIT;
Expand Down Expand Up @@ -516,12 +513,12 @@ pub mod proxy {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = deposit(1, 8);
pub const ProxyDepositBase: Balance = 0;
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = deposit(0, 33);
pub const ProxyDepositFactor: Balance = 0;
pub const MaxProxies: u16 = 10;
pub const AnnouncementDepositBase: Balance = deposit(1, 8);
pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
pub const AnnouncementDepositBase: Balance = 0;
pub const AnnouncementDepositFactor: Balance = 0;
pub const MaxPending: u16 = 10;
}
}
Expand All @@ -534,30 +531,7 @@ pub mod web3_names {

/// The size is checked in the runtime by a test.
pub const MAX_NAME_BYTE_LENGTH: u32 = 121;
pub const DEPOSIT: Balance = deposit(2, MAX_NAME_BYTE_LENGTH);

parameter_types! {
pub const Web3NameDeposit: Balance = DEPOSIT;
pub const MinNameLength: u32 = MIN_LENGTH;
pub const MaxNameLength: u32 = MAX_LENGTH;
}
}

pub mod dot_names {
use super::*;

const MIN_NAME_LENGTH: u32 = 3;
const MAX_NAME_LENGTH: u32 = 28;

pub const DOT_NAME_SUFFIX: &str = ".dot";
#[allow(clippy::as_conversions)]
pub const MIN_LENGTH: u32 = MIN_NAME_LENGTH + DOT_NAME_SUFFIX.len() as u32;
#[allow(clippy::as_conversions)]
pub const MAX_LENGTH: u32 = MAX_NAME_LENGTH + DOT_NAME_SUFFIX.len() as u32;

/// The size is checked in the runtime by a test.
pub const MAX_NAME_BYTE_LENGTH: u32 = 121;
pub const DEPOSIT: Balance = deposit(2, MAX_NAME_BYTE_LENGTH);
pub const DEPOSIT: Balance = 0;

parameter_types! {
pub const Web3NameDeposit: Balance = DEPOSIT;
Expand All @@ -569,7 +543,7 @@ pub mod dot_names {
pub mod preimage {
use super::*;
parameter_types! {
pub const PreimageBaseDeposit: Balance = deposit(2, 64);
pub const PreimageBaseDeposit: Balance = 0;
}
}

Expand All @@ -583,7 +557,7 @@ pub mod tips {
pub const MaximumReasonLength: u32 = MAXIMUM_REASON_LENGTH;
pub const TipCountdown: BlockNumber = DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(0);
pub const TipReportDepositBase: Balance = deposit(1, 1);
pub const TipReportDepositBase: Balance = 1;
pub const MaxTipAmount: Balance = 100_000 * KILT;
}
}
Expand All @@ -608,7 +582,7 @@ pub mod public_credentials {
/// The size is checked in the runtime by a test.
pub const MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH: u32 = 419;
// Each credential would have a different deposit, so no multiplier here
pub const PUBLIC_CREDENTIAL_DEPOSIT: Balance = deposit(1, MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH);
pub const PUBLIC_CREDENTIAL_DEPOSIT: Balance = 0;

parameter_types! {
pub const Deposit: Balance = PUBLIC_CREDENTIAL_DEPOSIT;
Expand Down
7 changes: 3 additions & 4 deletions runtimes/peregrine/src/benchmarks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use xcm::v4::{Asset, Assets, Fungibility, Location};
use crate::{
xcm::XcmConfig, AllPalletsWithSystem, AssetSwitchPool1, Attestation, Balances, BondedCurrencies, BondedFungibles,
Collators, Council, Ctype, Delegation, Democracy, DepositStorage, Did, DidLookup, DipProvider, Fungibles, Indices,
Inflation, MessageQueue, Migration, Multisig, ParachainStaking, ParachainSystem, Preimage, Proxy,
PublicCredentials, Runtime, RuntimeEvent, Scheduler, Sudo, System, TechnicalCommittee, TechnicalMembership,
Timestamp, Tips, TipsMembership, Treasury, Utility, Vesting, Web3Names,
MessageQueue, Migration, Multisig, ParachainStaking, ParachainSystem, Preimage, Proxy, PublicCredentials, Runtime,
RuntimeEvent, Scheduler, Sudo, System, TechnicalCommittee, TechnicalMembership, Timestamp, Tips, TipsMembership,
Treasury, Utility, Vesting, Web3Names,
};

pub(crate) mod asset_switch;
Expand Down Expand Up @@ -81,7 +81,6 @@ define_benchmarks!(
[attestation, Attestation]
[delegation, Delegation]
[did, Did]
[pallet_inflation, Inflation]
[public_credentials, PublicCredentials]
[pallet_xcm, pallet_xcm::benchmarking::Pallet::<Runtime>]
[pallet_migration, Migration]
Expand Down
2 changes: 1 addition & 1 deletion runtimes/peregrine/src/governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl pallet_democracy::Config for Runtime {

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const Burn: Permill = Permill::zero();
pub const Burn: Permill = Permill::from_percent(100);
pub TreasuryAccount: AccountId = Treasury::account_id();
}

Expand Down
12 changes: 2 additions & 10 deletions runtimes/peregrine/src/kilt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use runtime_common::{
NativeAndForeignAssets as NativeAndForeignAssetsType, TargetFromLeft,
},
deposits::DepositNamespace,
AccountId, Balance, SendDustAndFeesToTreasury,
AccountId, Balance,
};
use sp_core::{crypto::ByteArray, ConstU128, ConstU32, ConstU8};
use sp_runtime::AccountId32;
Expand Down Expand Up @@ -69,20 +69,12 @@ impl parachain_staking::Config for Runtime {
type MaxUnstakeRequests = constants::staking::MaxUnstakeRequests;
type NetworkRewardRate = constants::staking::NetworkRewardRate;
type NetworkRewardStart = constants::staking::NetworkRewardStart;
type NetworkRewardBeneficiary = SendDustAndFeesToTreasury<Runtime>;
type NetworkRewardBeneficiary = ();
type WeightInfo = weights::parachain_staking::WeightInfo<Runtime>;

const BLOCKS_PER_YEAR: BlockNumberFor<Self> = constants::BLOCKS_PER_YEAR;
}

impl pallet_inflation::Config for Runtime {
type Currency = Balances;
type InitialPeriodLength = constants::treasury::InitialPeriodLength;
type InitialPeriodReward = constants::treasury::InitialPeriodReward;
type Beneficiary = SendDustAndFeesToTreasury<Runtime>;
type WeightInfo = weights::pallet_inflation::WeightInfo<Runtime>;
}

parameter_types! {
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
}
Expand Down
2 changes: 1 addition & 1 deletion runtimes/peregrine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ construct_runtime! {
Delegation: delegation = 63,
Did: did = 64,
// DELETED: CrowdloanContributors = 65,
Inflation: pallet_inflation = 66,
// DELETED: Inflation: pallet_inflation = 66,
DidLookup: pallet_did_lookup = 67,
Web3Names: pallet_web3_names = 68,
PublicCredentials: public_credentials = 69,
Expand Down
8 changes: 2 additions & 6 deletions runtimes/peregrine/src/migrations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ use runtime_common::constants;
use crate::{weights, Balances, Runtime, RuntimeEvent};

parameter_types! {
pub const DmpPalletName: &'static str = "DmpQueue";
pub const DotNames: &'static str = "DotNames";
pub const UniqueLinking: &'static str = "UniqueLinking";
pub const Inflation: &'static str = "Inflation";
}

pub type RuntimeMigrations = (
pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,
frame_support::migrations::RemovePallet<DmpPalletName, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<DotNames, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<UniqueLinking, <Runtime as frame_system::Config>::DbWeight>,
frame_support::migrations::RemovePallet<Inflation, <Runtime as frame_system::Config>::DbWeight>,
pallet_bonded_coins::migrations::v1::MigrateV0ToV1<Runtime>,
);

Expand Down
1 change: 0 additions & 1 deletion runtimes/peregrine/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ pub mod pallet_deposit_storage;
pub mod pallet_did_lookup;
pub mod pallet_dip_provider;
pub mod pallet_indices;
pub mod pallet_inflation;
pub mod pallet_membership;
pub mod pallet_message_queue;
pub mod pallet_migration;
Expand Down
88 changes: 0 additions & 88 deletions runtimes/peregrine/src/weights/pallet_inflation.rs

This file was deleted.

9 changes: 4 additions & 5 deletions runtimes/spiritnet/src/benchmarks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ use xcm::v4::{Asset, Assets, Fungibility, Location};

use crate::{
xcm::XcmConfig, AllPalletsWithSystem, AssetSwitchPool1, Attestation, Balances, Collators, Council, Ctype,
Delegation, Democracy, DepositStorage, Did, DidLookup, DipProvider, Fungibles, Indices, Inflation, MessageQueue,
Migration, Multisig, ParachainStaking, ParachainSystem, Preimage, Proxy, PublicCredentials, Runtime, RuntimeEvent,
Scheduler, System, TechnicalCommittee, TechnicalMembership, Timestamp, Tips, TipsMembership, Treasury, Utility,
Vesting, Web3Names,
Delegation, Democracy, DepositStorage, Did, DidLookup, DipProvider, Fungibles, Indices, MessageQueue, Migration,
Multisig, ParachainStaking, ParachainSystem, Preimage, Proxy, PublicCredentials, Runtime, RuntimeEvent, Scheduler,
System, TechnicalCommittee, TechnicalMembership, Timestamp, Tips, TipsMembership, Treasury, Utility, Vesting,
Web3Names,
};

pub(crate) mod asset_switch;
Expand Down Expand Up @@ -79,7 +79,6 @@ define_benchmarks!(
[attestation, Attestation]
[delegation, Delegation]
[did, Did]
[pallet_inflation, Inflation]
[public_credentials, PublicCredentials]
[pallet_xcm, pallet_xcm::benchmarking::Pallet::<Runtime>]
[pallet_migration, Migration]
Expand Down
Loading
Loading