mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
This is read from the BABE pre-digest when converting from a SubstrateHeader. This causes the genesis block to have time 0 and all blocks produced with BABE to have a time of the slot time. While the slot time is in 6-second intervals (due to our target block time), defining in milliseconds preserves the ABI for long-term goals (sub-second blocks). Usage of the slot time deduplicates this field with BABE, and leaves the only possible manipulation to propose during a slot or to not propose during a slot. The actual reason this was implemented this way is because the Header trait is overly restrictive and doesn't allow definition with new fields. Even if we wanted to express the timestamp within the SubstrateHeader, we can't without replacing Header::new and making a variety of changes to the polkadot-sdk accordingly. Those aren't worth it at this moment compared to the solution implemented.