Why do testnet blocks have future timestamp?

2

I am playing experiments with testnet blockchain, and it seems like the best block is always set about 2 hours into the future.

For example, now, the block has timestamp 90 minutes into the future. I am not linking the block itself since it will be quickly outdated anyway, but you can look at https://testnet.blockexplorer.com and the newest block will always be into the future.

How is that possible? Shoudln't the network check the timestamps, if they are sensible? Also, if anyone can fake the timestamps, do they have any reason to exist at all?

This extends both to mainnet and testnet; however, I haven't seen it happen on mainnet. Why?

Karel Bílek

Posted 2016-10-06T11:35:42.050

Reputation: 2 197

1

That "timestamp" varies depending on from where you access the website. If I access https://testnet.blockexplorer.com/block/0000000051b24881f7ab79c2f80e2706fa38e62da4279f9f297f76c0297233c3 from Germany, it says "Oct 7, 2016 1:13:20 AM". However, If I access it from France, it says "Oct 6, 2016 11:13:20 PM".

UTF-8 2016-10-06T21:52:10.710

@UTF-8 it should always tell local time. It's strange, because - as far as I know - Germany and France have the same timezone.Karel Bílek 2016-10-10T11:48:42.700

1Germany and France do share the same time zone. To test whether my statement is correct, just connect to a VPN or use to Tor or something. I find it strange in general to use localized time on an international website (but that might be due to my general dislike of localization). If localization of time is used (which it shouldn't!), the used time zone should be stated next to it.UTF-8 2016-10-10T19:38:15.260

@UTF-8 yeah, it's not great. But it's not really the issue I asked; if I try to look at the actual unix timestamps of the blocks, they are still 90 minutes in the future. You can report the time issue to bitpay on their github - https://github.com/bitpay/insight-ui

Karel Bílek 2016-10-11T11:09:31.180

Answers

3

Testnet is frequently attacked, abused, due to the complete lack of value and proof of work. A piece of code which is intended to allow a difficulty 1 block is none has been found in 20 minutes also enables a person to "warp" forward and mine multiple in a row. If this is exploited over the difficulty adjustment, the entire chain difficulty is reset to difficulty 1.

The result is that it is trivial to make forks hundreds of thousands of blocks long, with insane timestamps that only vaguely match reality within the consensus rules. They're never going to make a lot of sense as a result. This doesn't happen on mainnet because the difficulty reset code doesn't exist there.

Anonymous

Posted 2016-10-06T11:35:42.050

Reputation: 10 054

Ok, I understand that. Is there any plan to add difficulty to testnet ? Such behavior makes test environment quite far from reality. Also adding auto adjustable difficulty would make block times more stable, wouldn't it?Pavel Niedoba 2016-11-04T18:45:11.840

Note the temporary difficulty adjustment on testnet after 20 minutes of no block being found isn't the same as a time warp attack where miners try to create blocks with the earliest-possible time stamps for every block but the last block in a difficulty period (giving that block the latest possible time stamp).David A. Harding 2018-05-23T00:27:45.280