3

A contract can reference the currently being mined contract's timestamp. This means that changing the timestamp of an in-progress to be mined block requires executing all contracts referencing that timestamp. How exactly does Ethereum avoid miners being incentivized to keep old (inaccurate) timestamps within their blocks due to this? Or am I misunderstanding how contracts and blocks tend to interact?

3

The timestamps are saved into the blockheader. They don't get updated but they are part of the consensus and can't get altered after mined.

We can't consider the timestamp exact at all, but the information you get out of the timestamp is not super interesting. "When exactly was this block mined?" A question with limited practical use, given that they must fall into a limited interval.
Important is that the sequence of blocks is not messed up and that the block height is correlated with a certain time so that on average we have linear block times.

  • My specific question is about contracts making use of that block time in a block that's still not mined. What incentive is there for a miner to update the timestamp from when they first start trying to mine a block, since otherwise changing the timestamp will require reevaluating at least some contracts that make use of that timestamp – Earlz Oct 24 '16 at 18:23
  • As said, there is no incentive, there is a decentive: the hash would not be valid anymore and all the mining was for nothing. Updating the timestamp: it will not happen. – Roland Kofler Oct 24 '16 at 18:29
  • I guess for the short block times with ethereum, it's not as much of a problem compared to other blockchains too though.. – Earlz Oct 25 '16 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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