I have readed an ethereum post from 2015 where it states that miners can manipulate the block timestamp up to 900 seconds. Can they in 2021 still do it and, if yes, can users see this and did this happen in the past? Would i.e. Etherscan show the manipulated timestamp too?
1 Answer
When verifying the block header, the Geth client runs the following check:
// Verify the header's timestamp
if !uncle {
if header.Time > uint64(unixNow+allowedFutureBlockTimeSeconds) {
return consensus.ErrFutureBlock
}
}
allowedFutureBlockTimeSeconds
is defined as:
allowedFutureBlockTimeSeconds = int64(15)
So 15 seconds in the future, otherwise a consensus error is raised.
There are game theoretic reasons why a miner would want to keep the timestamp as close to the current time as possible.
-
Thanks alot! This is helpful. What if in that 15 seconds no block is mined?– dkbCommented May 21, 2021 at 22:27