Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Short epoch from ENV #170

Merged
merged 2 commits into from
Aug 29, 2024
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
3 changes: 3 additions & 0 deletions cumulus/parachains/runtimes/testing/penpal/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ pub const ASSET_HUB_ID: u32 = 1000;
parameter_types! {
/// The location that this chain recognizes as the Relay network's Asset Hub.
pub SystemAssetHubLocation: Location = Location::new(1, [Parachain(ASSET_HUB_ID)]);
/// Bridged Assets Prefx
pub BridgedAssetPrefix: Location = Location::new(2, Here);
// the Relay Chain's Asset Hub's Assets pallet index
pub SystemAssetHubAssetsPalletLocation: Location =
Location::new(1, [Parachain(ASSET_HUB_ID), PalletInstance(ASSETS_PALLET_ID)]);
Expand Down Expand Up @@ -308,6 +310,7 @@ pub type TrustedReserves = (
AssetsFrom<SystemAssetHubLocation>,
NativeAssetFrom<SystemAssetHubLocation>,
AssetPrefixFrom<CustomizableAssetFromSystemAssetHub, SystemAssetHubLocation>,
AssetPrefixFrom<BridgedAssetPrefix, SystemAssetHubLocation>,
Comment on lines 312 to +313
Copy link
Author

@yrong yrong Aug 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alistair-singh
FYI CustomizableAssetFromSystemAssetHub is actually a configurable storage which can be configured with a System.set_storage as any location like Ethereum.

But I'm also fine with the change here.

);
pub type TrustedTeleporters =
(AssetFromChain<LocalTeleportableToAssetHub, SystemAssetHubLocation>,);
Expand Down
6 changes: 5 additions & 1 deletion polkadot/runtime/westend/constants/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ pub mod time {

pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES);

frame_support::parameter_types! {
pub EpochDurationInSlots: BlockNumber =
prod_or_fast!(1 * HOURS, 2 * MINUTES, "EPOCH_DURATION");
}

// These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
Expand Down
13 changes: 7 additions & 6 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,13 @@ impl pallet_preimage::Config for Runtime {
}

parameter_types! {
pub const EpochDuration: u64 = prod_or_fast!(
EPOCH_DURATION_IN_SLOTS as u64,
2 * MINUTES as u64
pub EpochDuration: u64 = prod_or_fast!(
EpochDurationInSlots::get() as u64,
2 * MINUTES as u64,
"EPOCH_DURATION"
);
pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK;
pub const ReportLongevity: u64 =
pub ReportLongevity: u64 =
BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get();
}

Expand Down Expand Up @@ -544,11 +545,11 @@ impl Get<u32> for MaybeSignedPhase {
parameter_types! {
// phase durations. 1/4 of the last session for each.
pub SignedPhase: u32 = prod_or_fast!(
EPOCH_DURATION_IN_SLOTS / 4,
EpochDurationInSlots::get() / 4,
(1 * MINUTES).min(EpochDuration::get().saturated_into::<u32>() / 2)
);
pub UnsignedPhase: u32 = prod_or_fast!(
EPOCH_DURATION_IN_SLOTS / 4,
EpochDurationInSlots::get() / 4,
(1 * MINUTES).min(EpochDuration::get().saturated_into::<u32>() / 2)
);

Expand Down
Loading