🚧 本 EIP 至少有6个月没有活动。

EIP-1482: Define a maximum block timestamp drift Source

作者 Maurelian
讨论-To https://ethereum-magicians.org/t/define-a-maximum-block-timestamp-drift/1556
状态 Stagnant
类型 Standards Track
分类 Core
创建日期 2018-10-09
英文版 https://eips.ethereum.org/EIPS/eip-1482

简述

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

摘要

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

动机

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.

规范

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.

基本原理

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.

向后兼容性

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.

测试用例

These would be important to have.

实现

_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.

参考文献

Please cite this document as:

Maurelian, "EIP-1482: Define a maximum block timestamp drift [DRAFT]," Ethereum Improvement Proposals, no. 1482, October 2018. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1482.