I know the Clock and Slothashes sysvars return a current timestamp and history of slot hashes, but my question is where this data comes from? Is this the timestamp that correlates to the latest blockhash embedded in the TX (e.g. the most recent slot hash in the slot hashes history would be the one sent with the tx), or is it the most current time and slot hash at time of execution on the leader node?
1 Answer
All sysvars come directly from the Solana runtime, similar to how you can make a syscall in any other platform.
And the provided sysvars are the most current time and slot hash at time of execution.
You can read more about the concepts and available sysvars at https://docs.solana.com/developing/runtime-facilities/sysvars