Skip to content

Commit

Permalink
align staking params & fix MAXIMUM_BLOCK_WEIGHT
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszaaa committed Mar 15, 2023
1 parent e310b9e commit 0debf26
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
22 changes: 11 additions & 11 deletions runtime/mangata-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ impl_opaque_keys! {
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("mangata-parachain"),
impl_name: create_runtime_str!("mangata-parachain"),
authoring_version: 14,
spec_version: 14,
authoring_version: 15,
spec_version: 15,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 14,
transaction_version: 15,
state_version: 0,
};

Expand All @@ -174,10 +174,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("mangata-parachain"),
impl_name: create_runtime_str!("mangata-parachain"),
authoring_version: 15,
spec_version: 2800,
spec_version: 2900,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2800,
transaction_version: 2900,
state_version: 0,
};

Expand Down Expand Up @@ -229,10 +229,10 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.5 of a second of compute with a 12 second average block time.
/// NOTE: reduced by half comparing to origin impl as we want to fill block only up to 50%
/// so there is room for new extrinsics in the next block
// const MAXIMUM_BLOCK_WEIGHT: Weight =
// WEIGHT_PER_SECOND.saturating_div(4).set_proof_size((cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64).saturating_div(2));
const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX);
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_div(4),
cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64,
);

/// The version information used to identify this runtime when compiled natively.
#[cfg(feature = "std")]
Expand Down Expand Up @@ -1355,7 +1355,7 @@ parameter_types! {
/// Minimum collators selected per round, default at genesis and minimum forever after
pub const MinSelectedCandidates: u32 = 25;
/// Maximum collator candidates allowed
pub const MaxCollatorCandidates: u32 = 35;
pub const MaxCollatorCandidates: u32 = 50;
/// Maximum delegators allowed per candidate
pub const MaxTotalDelegatorsPerCandidate: u32 = 25;
/// Maximum delegators counted per candidate
Expand All @@ -1367,7 +1367,7 @@ parameter_types! {
/// Minimum stake required to become a collator
pub const MinCollatorStk: u128 = 10 * DOLLARS;
/// Minimum stake required to be reserved to be a candidate
pub const MinCandidateStk: u128 = 1 * DOLLARS;
pub const MinCandidateStk: u128 = 1_500_000 * DOLLARS;
/// Minimum stake required to be reserved to be a delegator
pub const MinDelegatorStk: u128 = 1 * CENTS;
}
Expand Down
23 changes: 11 additions & 12 deletions runtime/mangata-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ impl_opaque_keys! {
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("mangata-parachain"),
impl_name: create_runtime_str!("mangata-parachain"),
authoring_version: 13,
spec_version: 13,
authoring_version: 14,
spec_version: 14,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
transaction_version: 14,
state_version: 0,
};

Expand All @@ -173,12 +173,11 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("mangata-parachain"),
impl_name: create_runtime_str!("mangata-parachain"),

authoring_version: 14,
spec_version: 2800,
spec_version: 2900,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2800,
transaction_version: 2900,
state_version: 0,
};

Expand Down Expand Up @@ -230,10 +229,10 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// We allow for 0.5 of a second of compute with a 12 second average block time.
/// NOTE: reduced by half comparing to origin impl as we want to fill block only up to 50%
/// so there is room for new extrinsics in the next block
// const MAXIMUM_BLOCK_WEIGHT: Weight =
// WEIGHT_PER_SECOND.saturating_div(4).set_proof_size((cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64).saturating_div(2));
const MAXIMUM_BLOCK_WEIGHT: Weight =
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), u64::MAX);
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_div(4),
cumulus_primitives_core::relay_chain::v2::MAX_POV_SIZE as u64,
);

/// The version information used to identify this runtime when compiled natively.
#[cfg(feature = "std")]
Expand Down Expand Up @@ -1347,7 +1346,7 @@ parameter_types! {
/// Minimum collators selected per round, default at genesis and minimum forever after
pub const MinSelectedCandidates: u32 = 25;
/// Maximum collator candidates allowed
pub const MaxCollatorCandidates: u32 = 35;
pub const MaxCollatorCandidates: u32 = 50;
/// Maximum delegators allowed per candidate
pub const MaxTotalDelegatorsPerCandidate: u32 = 25;
/// Maximum delegators counted per candidate
Expand All @@ -1359,7 +1358,7 @@ parameter_types! {
/// Minimum stake required to become a collator
pub const MinCollatorStk: u128 = 10 * DOLLARS;
/// Minimum stake required to be reserved to be a candidate
pub const MinCandidateStk: u128 = 1 * DOLLARS;
pub const MinCandidateStk: u128 = 1_500_000 * DOLLARS;
/// Minimum stake required to be reserved to be a delegator
pub const MinDelegatorStk: u128 = 1 * CENTS;
}
Expand Down

0 comments on commit 0debf26

Please # to comment.