Skip to content

[FRAME] Prepare pallets for dynamic block durations #3268

@ggwpez

Description

@ggwpez

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Done
Status
Completed
Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions