Currently we just use System::block_number() in many pallet and derive a timestamp from it. This will not work anymore when parachains have changing block times, either from async backing or coretime.
Possible Solution
(the naming here are just placeholders)
- Create a new system config item:
BlockNumberProvider which can then either be configured to RelaychainDataProvider when its a parachain runtime or () for relay runtimes.
- Add a function
System::provided_block_number() -> Number
- Add a function
System::local_block_number() -> Number (for migrations and to avoid ambiguity)
- Deprecate
System::block_number()
We then need to adapt a ton of pallets and check whether their storage needs to be migrated.
Currently we just use
System::block_number()in many pallet and derive a timestamp from it. This will not work anymore when parachains have changing block times, either from async backing or coretime.Possible Solution
(the naming here are just placeholders)
BlockNumberProviderwhich can then either be configured toRelaychainDataProviderwhen its a parachain runtime or()for relay runtimes.System::provided_block_number() -> NumberSystem::local_block_number() -> Number(for migrations and to avoid ambiguity)System::block_number()We then need to adapt a ton of pallets and check whether their storage needs to be migrated.