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

no-std cumulus-primitives-timestamp

Provides timestamp related functionality for parachains

17 breaking releases

new 0.18.0 Jan 22, 2025
0.16.0 Sep 25, 2024
0.15.0 Jul 18, 2024
0.10.0 Mar 18, 2024
0.0.0 Nov 21, 2022

#499 in Magic Beans

Download history 324/week @ 2024-10-07 303/week @ 2024-10-14 234/week @ 2024-10-21 297/week @ 2024-10-28 381/week @ 2024-11-04 20275/week @ 2024-11-11 24654/week @ 2024-11-18 27639/week @ 2024-11-25 22275/week @ 2024-12-02 27079/week @ 2024-12-09 21587/week @ 2024-12-16 5319/week @ 2024-12-23 11472/week @ 2024-12-30 20631/week @ 2025-01-06 33370/week @ 2025-01-13 26480/week @ 2025-01-20

92,576 downloads per month
Used in 16 crates (6 directly)

Apache-2.0 and GPL-3.0-only

7KB

Release

Polkadot SDK Stable 2412


lib.rs:

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

~23–36MB
~609K SLoC