Are the timestamps of blocks for Ethereum only accepted when they are monotonically increasing? If yes, why? And why other blockchains like Bitcoin and other blockchains with shorter block time can have more tolerance on timestamps (by setting a window and can accept blocks with timestamps within that window)?.
1 Answer
I'm not sure what you mean with tolerance but here's how it approximately works on Ethereum:
- A block has a timestamp
- A miner assign a timestamp to a block but the timestamp may not be before the previous block's timestamp and not too much in the future
So, yes, the timestamps have to be increasing block by block but the miners have some influence on what exactly the timestamp is. You can read more about this for example here: Can a contract safely rely on block.timestamp?
In a sense Ethereum also includes a "time window" within which blocks are accepted. If a miner uses timestamp too far back the block is ignored by other miners. And the same thing if a miner uses timestamp too far in the future.
-
Thank you very much. Where can I find more information about the "time window" for Ethereum?– ShulaiAug 20, 2019 at 13:16
-
There is no strict "time window" except that the time has to be after the previous block. In theory otherwise everything is acceptable - client implementations probably ignore blocks which are too much "in the future". The link I provided has some info. Aug 20, 2019 at 13:38