You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some of the pallets migrating from the Relay Chain to the Asset Hub require a more deterministic clock than what a parachain can provide. To address this, the decision was made to adapt these pallets to use a configurable block number provider, which can be set to the Relay Chain’s block number provider for greater determinism. (For more details, see the discussions at #3268). This approach will also simplify the migration of pallets' state from the Relay Chain to the Asset Hub since, in most cases, block numbers won’t require mapping.
Task:
Adapt BlockNumberProvider for the pallets migrating to the Asset Hub:
Introduce a BlockNumberProvider configuration parameter and use its current_block_number function as the time reference instead of System::<T>::block_number().
Ensure pallet hooks like on_initialize(n) are compatible with the BlockNumberProvider and can handle cases when the hook isn’t called on every tick (e.g., adapt conditions that rely on exact matches like compilation_time == BlockNumberProvider::current_block_number()).
Review all instances of generic block number types, ensuring they reference the correct type (e.g., BlockNumberProvider::BlockNumber when migrated to BlockNumberProvider).
Update documentation for calls with block number parameters, configuration settings like BountyUpdatePeriod, and storage fields. Documentation should clarify for users that block numbers refer to those from Config::BlockNumberProvider, which may come from either the local parachain or the Relay Chain.
Some of the pallets migrating from the Relay Chain to the Asset Hub require a more deterministic clock than what a parachain can provide. To address this, the decision was made to adapt these pallets to use a configurable block number provider, which can be set to the Relay Chain’s block number provider for greater determinism. (For more details, see the discussions at #3268). This approach will also simplify the migration of pallets' state from the Relay Chain to the Asset Hub since, in most cases, block numbers won’t require mapping.
Task:
Adapt
BlockNumberProvider
for the pallets migrating to the Asset Hub:BlockNumberProvider
configuration parameter and use itscurrent_block_number
function as the time reference instead ofSystem::<T>::block_number()
.on_initialize(n)
are compatible with theBlockNumberProvider
and can handle cases when the hook isn’t called on every tick (e.g., adapt conditions that rely on exact matches likecompilation_time == BlockNumberProvider::current_block_number()
).BlockNumberProvider::BlockNumber
when migrated to BlockNumberProvider).BountyUpdatePeriod
, and storage fields. Documentation should clarify for users that block numbers refer to those fromConfig::BlockNumberProvider
, which may come from either the local parachain or the Relay Chain.Reference PR: #3970
Pallet list:
(when you start to work on a pallet, pul your name next to it or leave a comment)
BlockNumberProvider
#6446The text was updated successfully, but these errors were encountered: