Skip to content

Commit c56a94b

Browse files
muharemggwpez
andauthored
Asset Hub: Block Provider Setup (#813)
Asset Hub: Block Provider Setup As Asset Hub migrates to async backing and later to elastic scaling, it’s necessary to configure appropriate block providers for pallets that depend on block timing. Pallet-specific block provider configuration: - vesting: no change — continues to use the Relay Chain block provider. - multisig: uses the current block number and extrinsic index to ensure uniqueness of each multisig. Local block provider is used to support uniqueness. - proxy: relies on block provider to handle delayed proxy announcements, where the user can specify a delay before activation. Relay Chain block provider is preferred here for real-time alignment and predictability. - nfts: uses block numbers to define `mint.start_block` and `mint.end_block` for collections. Relay Chain block provider is chosen to ensure accurate timing for mint periods. These changes do not require storage migration, as: - no proxy announcements currently exist. - no NFT collections with start_block or end_block are present on either chain. --------- Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
1 parent 089c589 commit c56a94b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313
### Changed
1414

1515
- Add foreign-consensus cousin Asset Hub as trusted aliaser to allow XCMv5 origin preservation for foreign-consensus parachains [polkadot-fellows/runtimes/pull/794](https://github.com/polkadot-fellows/runtimes/pull/794))
16+
- Configure block providers for pallets requiring block context ([polkadot-fellows/runtimes/pull/813](https://github.com/polkadot-fellows/runtimes/pull/813)):
17+
- vesting: keep using Relay Chain block provider
18+
- multisig: switch to local block provider (for unique multisig IDs)
19+
- proxy: use Relay Chain block provider (for delayed announcements)
20+
- nfts: use Relay Chain block provider (for minting start/end blocks)
1621

1722
## [1.6.1] 24.06.2025
1823

system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use assets_common::{
3939
matching::FromSiblingParachain,
4040
AssetIdForTrustBackedAssetsConvert,
4141
};
42-
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
42+
use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider};
4343
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
4444
use kusama_runtime_constants::time::MINUTES as RC_MINUTES;
4545
use pallet_proxy::ProxyDefinition;
@@ -268,7 +268,7 @@ impl pallet_vesting::Config for Runtime {
268268
/// block number of the Relay Chain, not the parachain. This is because with Coretime and Async
269269
/// Backing, parachain block numbers may not be a good proxy for time. Vesting schedules should
270270
/// be set accordingly.
271-
type BlockNumberProvider = cumulus_pallet_parachain_system::RelaychainDataProvider<Runtime>;
271+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
272272
const MAX_VESTING_SCHEDULES: u32 = 28;
273273
}
274274

@@ -682,7 +682,7 @@ impl pallet_proxy::Config for Runtime {
682682
type CallHasher = BlakeTwo256;
683683
type AnnouncementDepositBase = AnnouncementDepositBase;
684684
type AnnouncementDepositFactor = AnnouncementDepositFactor;
685-
type BlockNumberProvider = System;
685+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
686686
}
687687

688688
parameter_types! {
@@ -957,7 +957,7 @@ impl pallet_nfts::Config for Runtime {
957957
type WeightInfo = weights::pallet_nfts::WeightInfo<Runtime>;
958958
#[cfg(feature = "runtime-benchmarks")]
959959
type Helper = ();
960-
type BlockNumberProvider = System;
960+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
961961
}
962962

963963
/// XCM router instance to BridgeHub with bridging capabilities for `Polkadot` global

system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ use assets_common::{
7474
matching::{FromNetwork, FromSiblingParachain},
7575
AssetIdForTrustBackedAssetsConvert,
7676
};
77-
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
77+
use cumulus_pallet_parachain_system::{RelayNumberMonotonicallyIncreases, RelaychainDataProvider};
7878
use cumulus_primitives_core::{AggregateMessageOrigin, ParaId};
7979
use sp_api::impl_runtime_apis;
8080
use sp_core::{crypto::KeyTypeId, ConstU128, OpaqueMetadata};
@@ -290,7 +290,7 @@ impl pallet_vesting::Config for Runtime {
290290
/// block number of the Relay Chain, not the parachain. This is because with Coretime and Async
291291
/// Backing, parachain block numbers may not be a good proxy for time. Vesting schedules should
292292
/// be set accordingly.
293-
type BlockNumberProvider = cumulus_pallet_parachain_system::RelaychainDataProvider<Runtime>;
293+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
294294
const MAX_VESTING_SCHEDULES: u32 = 28;
295295
}
296296

@@ -612,7 +612,7 @@ impl pallet_proxy::Config for Runtime {
612612
type CallHasher = BlakeTwo256;
613613
type AnnouncementDepositBase = AnnouncementDepositBase;
614614
type AnnouncementDepositFactor = AnnouncementDepositFactor;
615-
type BlockNumberProvider = System;
615+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
616616
}
617617

618618
parameter_types! {
@@ -861,7 +861,7 @@ impl pallet_nfts::Config for Runtime {
861861
type WeightInfo = weights::pallet_nfts::WeightInfo<Runtime>;
862862
#[cfg(feature = "runtime-benchmarks")]
863863
type Helper = ();
864-
type BlockNumberProvider = System;
864+
type BlockNumberProvider = RelaychainDataProvider<Runtime>;
865865
}
866866

867867
/// XCM router instance to BridgeHub with bridging capabilities for `Kusama` global

0 commit comments

Comments
 (0)