10

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?

11

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.

4

The miner could cheat in the timestamp by a tolerance of 900 seconds. so if you check outside this intervall you are safe.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.