I am working on a piece of code, but require to know the timestamp in best case milliseconds, and worst case seconds, at which a specific slot number was executed.
is there historical data onchain that I can tap into?
You can't. The highest resolution on-chain wall timestamp available today is one second and available in the unix_timestamp
field of the Clock
sysvar.
Sampling theory states, via Nyquist, that there is nothing to be gained by sampling higher than twice a signal's period. Given that the (target) slot rate of the cluster is 400ms and that slots are essentially samples, attempting to resolve below 800ms fraught at best