HomeEIPs
EIPsEIP-1482
EIP-1482

Define a maximum block timestamp drift

StagnantStandards Track: Core
Created: 2018-10-09
Maurelian (@Maurelian)
DiscussionsOriginal linkEdit
1 min read

EIP-1482 is a proposal to define a maximum block timestamp drift in the Ethereum protocol specification. Currently, there is a lack of clarity about how accurate timestamps in the block header must be, which can cause confusion and differing interpretations of what is considered a "reasonable" timestamp. This can create a risk of consensus failures.

To address this issue, EIP-1482 suggests including an explicit definition of the acceptable timestamp drift in the protocol specification. Specifically, the yellow paper should define a timestamp as a scalar value equal to the output of Unix's time() at the block's inception, and for the purpose of block validation, it must be greater than the previous block's timestamp and no more than 15 seconds greater than system time.

This proposal aims to establish a de facto standard for timestamp validation requirements, which is currently implemented by both Geth and Parity. By making this standard explicit in the reference specification, it can help prevent confusion and ensure that smart contract developers can safely use the TIMESTAMP opcode without risking consensus failures.

Overall, EIP-1482 is a proposal to improve the clarity and consistency of timestamp validation in the Ethereum protocol, which can help ensure the stability and reliability of the network.

Video
Anyone may contribute to propose contents.
Go propose
Original

Simple Summary

Include an explicit definition of the acceptable timestamp drift in the protocol specification.

Abstract

On the basis that both Geth and Parity implement the same timestamp validation requirements, this should be written into the reference specification.

Motivation

There is a lack of clarity about how accurate timestamps in the block header must be. The yellow paper describes the timestamp as

A scalar value equal to the reasonable output of Unix’s time() at this block’s inception

This causes confusion about the safe use of the TIMESTAMP opcode (solidity's block.timestamp or now) in smart contract development.

Differing interpretations of 'reasonable' may create a risk of consenus failures.

Specification

The yellow paper should define a timestamp as:

A scalar value equal to the output of Unix’s time() at this block’s inception. For the purpose of block validation, it must be greater than the previous block's timestamp, and no more than 15 seconds greater than system time.

Rationale

Both Geth and Parity reject blocks with timestamp more than 15 seconds in the future. This establishes a defacto standard, which should be made explicit in the reference specification.

Backwards Compatibility

It may be necessary to relax this requirement for blocks which were mined early in the main chain's history, if they would be considered invalid.

Test Cases

These would be important to have.

Implementation

_The implementations must be completed before any EIP is given status "Final", but it need not be completed before the EIP is accepted. While there is merit to the approach of reaching consensus on the specification and rationale before writing code, the principle of "rough consensus and running code" is still useful when it comes to resolving many discussions of API details. _

Copyright and related rights waived via CC0.

Further reading
Anyone may contribute to propose contents.
Go propose
Adopted by projects
Anyone may contribute to propose contents.
Go propose

Not miss a beat of EIPs' update?

Subscribe EIPs Fun to receive the latest updates of EIPs Good for Buidlers to follow up.

View all
Serve Ethereum Builders, Scale the Community.
Resources
GitHub
Supported by