EIP-1482 Specifying a bound on block timestamp drift (Define a maximum block timestamp drift)
No call decision · Consensus & staking · EIP status Stagnant · created 2018-10-09
A proposal to formally state in the spec that a block header's timestamp must be greater than the previous block's and must not exceed the current system time by more than 15 seconds.
Why it is needed
The Ethereum Yellow Paper defines the block timestamp only as "a reasonable output of Unix time()". The spec does not say exactly what "reasonable" means, which left smart contract developers unsure how much they could trust the TIMESTAMP opcode (Solidity's block.timestamp, now). More seriously, if different client implementations interpret this vague criterion differently, their block validity judgments could diverge, risking a consensus failure. In practice, both Geth and Parity had already implemented the same rule rejecting blocks whose timestamp exceeds the future by more than 15 seconds, but this rule was not reflected in the reference spec.
What changes
Today
- The Yellow Paper vaguely defines the timestamp only as "a reasonable output of time()"
- No tolerance figure is given in the spec, leaving room for differing interpretations
- Geth and Parity each implemented a 15-second rule, but it was undocumented
After EIP-1482
- States explicitly that the timestamp must be greater than the previous block's and must not exceed system time by more than 15 seconds
- Reduces the risk of consensus failure caused by differing interpretations across client implementations
- Developers using block.timestamp/now can clearly know the tolerance range they can rely on
Who is affected
- Client teams: Provides grounds to codify the already-implemented 15-second validation rule into the official spec.
- Smart contract developers: Lets you confirm in the spec the tolerance allowed when using block.timestamp (now).
- Miners and validators: Clarifies the criterion for setting the timestamp when producing a block.
In depth
Background of the proposal
The Yellow Paper defines the timestamp as "a scalar value equal to a reasonable output of Unix time() at this block's inception", and the word "reasonable" is vague, causing confusion over the safe usage range of the TIMESTAMP opcode. This proposal starts from the observation that differing interpretations could create a risk of consensus failure.
Spec change content
The proposal suggests replacing the Yellow Paper's definition with the following wording: "A scalar value equal to the output of Unix time() at this block's inception. For block validation, this value must be greater than the previous block's timestamp and must not exceed the system time by more than 15 seconds." In other words, it explicitly adds two conditions: that the value must be greater than the previous block's, and that it must not exceed 15 seconds into the future.
Rationale: an already-implemented de facto standard
Both Geth and Parity have code that rejects blocks whose timestamp exceeds the future by more than 15 seconds. The proposer explains that since this is already functioning as a de facto standard, it should be explicitly reflected in the reference spec as well.
Backward compatibility considerations
Applying this rule retroactively could cause some blocks mined early in the mainchain's history to be judged invalid under the new criterion. The source notes that the rule may need to be relaxed for such past blocks.
Test cases and implementation
The source only notes that test cases are important and does not present specific tests. The implementation section is also empty, meaning no actual code changes or tests have been written.
Current status
This EIP's status is Stagnant. That is, discussion proceeded and then stopped, and it was never actually reflected in the Yellow Paper. No fork-inclusion decision has been confirmed in the call records.