[Ethereum] Is block.timestamp safe for longer time periods

schedulingserenitysoliditytimerstimestamp

I would like to set a timer like

uint timeout = now + 1 year;

Is it possible that a miner cheats the timestamp of the block that it's included more then let's say a month.

So if I need roughly 1 year until timeout (+/- one month) would that be safe?

And is block.timestamp serenity-proof?

Best Answer

Yes, you can guarantee long run time accuracy. Miners can't cheat that much to change the timestamp over days. Blocktime is adjusted to be constant within certain error margins, and timestamps is guaranteed to be rejected if they are excessive. Serenity and PoS 'proven' until core team decides otherwise. It is very very unlikely to happen, what reason could they possibly have? Its a feature not a bug.

Related Topic