Skip to content

Commit

Permalink
chrose(pop-network): paseo feature works properly
Browse files Browse the repository at this point in the history
  • Loading branch information
al3mart committed Mar 26, 2024
1 parent bc708a8 commit c1516ad
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
10 changes: 5 additions & 5 deletions runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;

/// Relay chain slot duration, in milliseconds.
// Value is 6000 millisecs. If `MILLISECS_PER_BLOCK` changes this needs addressing.
const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
pub const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;

// Time is measured by number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
Expand Down Expand Up @@ -62,7 +62,7 @@ pub const MILLIUNIT: Balance = UNIT / 1_000;
pub const MICROUNIT: Balance = UNIT / 1_000_000;

// Deposits
pub(crate) const fn deposit(items: u32, bytes: u32) -> Balance {
pub const fn deposit(items: u32, bytes: u32) -> Balance {
(items as Balance * UNIT + (bytes as Balance) * (5 * MILLIUNIT / 100)) / 10
}
/// The existential deposit. Set to 1/1_000 of the Connected Relay Chain.
Expand All @@ -72,10 +72,10 @@ pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT;
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
#[cfg(not(feature = "paseo"))]
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
#[cfg(feature = "paseo")]
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;

/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
const BLOCK_PROCESSING_VELOCITY: u32 = 1;
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
1 change: 1 addition & 0 deletions runtime/devnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,4 @@ try-runtime = [
]

experimental = ["pallet-aura/experimental"]
paseo = ["pop-runtime-common/paseo"]
13 changes: 5 additions & 8 deletions runtime/devnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub use pop_runtime_common::{
AuraId, Balance, BlockNumber, Hash, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS,
MAXIMUM_BLOCK_WEIGHT, MILLISECS_PER_BLOCK, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
UNIT, MILLIUNIT, MICROUNIT, EXISTENTIAL_DEPOSIT, UNINCLUDED_SEGMENT_CAPACITY, BLOCK_PROCESSING_VELOCITY, deposit,
RELAY_CHAIN_SLOT_DURATION_MILLIS,
};
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin};
Expand Down Expand Up @@ -432,18 +433,14 @@ impl pallet_session::Config for Runtime {
type WeightInfo = ();
}

parameter_types! {
#[cfg(feature = "paseo")]
AllowMultipleBlocksPerSlot = ConstBool<false>;
#[cfg(not(feature = "paseo"))]
AllowMultipleBlocksPerSlot = ConstBool<true>;
}

impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = AllowMultipleBlocksPerSlot;
#[cfg(not(feature = "paseo"))]
type AllowMultipleBlocksPerSlot = ConstBool<true>;
#[cfg(feature = "paseo")]
type AllowMultipleBlocksPerSlot = ConstBool<false>;
#[cfg(feature = "experimental")]
type SlotDuration = ConstU64<SLOT_DURATION>;
}
Expand Down
1 change: 1 addition & 0 deletions runtime/testnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,4 @@ try-runtime = [
]

experimental = ["pallet-aura/experimental"]
paseo = ["pop-runtime-common/paseo"]
13 changes: 5 additions & 8 deletions runtime/testnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub use pop_runtime_common::{
AuraId, Balance, BlockNumber, Hash, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS,
MAXIMUM_BLOCK_WEIGHT, MILLISECS_PER_BLOCK, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
UNIT, MILLIUNIT, MICROUNIT, EXISTENTIAL_DEPOSIT, UNINCLUDED_SEGMENT_CAPACITY, BLOCK_PROCESSING_VELOCITY, deposit,
RELAY_CHAIN_SLOT_DURATION_MILLIS,
};
pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{RelayLocation, XcmOriginToTransactDispatchOrigin};
Expand Down Expand Up @@ -432,18 +433,14 @@ impl pallet_session::Config for Runtime {
type WeightInfo = ();
}

parameter_types! {
#[cfg(feature = "paseo")]
AllowMultipleBlocksPerSlot = ConstBool<false>;
#[cfg(not(feature = "paseo"))]
AllowMultipleBlocksPerSlot = ConstBool<true>;
}

impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = ConstU32<100_000>;
type AllowMultipleBlocksPerSlot = AllowMultipleBlocksPerSlot;
#[cfg(not(feature = "paseo"))]
type AllowMultipleBlocksPerSlot = ConstBool<true>;
#[cfg(feature = "paseo")]
type AllowMultipleBlocksPerSlot = ConstBool<false>;
#[cfg(feature = "experimental")]
type SlotDuration = ConstU64<SLOT_DURATION>;
}
Expand Down

0 comments on commit c1516ad

Please sign in to comment.