#timestamp #inherent #parachain #primitive #slot #relay #chain

no-std cumulus-primitives-timestamp

Provides timestamp related functionality for parachains. (polkadot v1.10.0)

13 releases (breaking)

new 0.11.0 Apr 8, 2024
0.10.0 Mar 18, 2024
0.9.0 Feb 26, 2024
0.6.0 Dec 12, 2023
0.0.0 Nov 21, 2022

#1776 in Magic Beans

Download history 22/week @ 2023-12-20 58/week @ 2023-12-27 223/week @ 2024-01-03 356/week @ 2024-01-10 265/week @ 2024-01-17 378/week @ 2024-01-24 203/week @ 2024-01-31 534/week @ 2024-02-07 692/week @ 2024-02-14 1140/week @ 2024-02-21 229/week @ 2024-02-28 208/week @ 2024-03-06 403/week @ 2024-03-13 426/week @ 2024-03-20 590/week @ 2024-03-27 343/week @ 2024-04-03

1,794 downloads per month
Used in 8 crates (5 directly)

Apache-2.0 and GPL-3.0-only

7KB

Cumulus timestamp related primitives.

Provides a InherentDataProvider that should be used in the validation phase of the parachain. It will be used to create the inherent data and that will be used to check the inherents inside the parachain block (in this case the timestamp inherent). As we don't have access to any clock from the runtime the timestamp is always passed as an inherent into the runtime. To check this inherent when validating the block, we will use the relay chain slot. As the relay chain slot is derived from a timestamp, we can easily convert it back to a timestamp by multiplying it with the slot duration. By comparing the relay chain slot derived timestamp with the timestamp we can ensure that the parachain timestamp is reasonable.

Dependencies

~20–32MB
~518K SLoC