主页EIPs
EIPsEIP-689
EIP-689

Address Collision of Contract Address Causes Exceptional Halt

StagnantStandards Track: Core
创建时间: 2017-08-15
Yoichi Hirai <i@yoichihirai.com>
原文链接编辑
1 分钟了解

相关视频
欢迎补充好内容
去提交
正文

Simple Summary

This EIP proposes to make contract creation fail on an account with nonempty code or non-zero nonce.

Abstract

Some test cases in the consensus test suite try to deploy a contract at an address already with nonempty code. Although such cases can virtually never happen on the main network before the Constantinople fork block, the test cases detected discrepancies in clients' behavior. Currently, the Yellow Paper says that the contract creation starts with the empty code and the initial nonce even in the case of address collisions. To simplify the semantics, this EIP proposes that address collisions cause failures of contract creation.

Motivation

This EIP has no practical relevance to the main net history, but simplifies testing and reasoning.

This EIP has no effects after Constantinople fork because EIP-86 contains the changes proposed in this EIP. Even before the Constantinople fork, this EIP has no practical relevance because the change is visible only in case of a hash collision of keccak256.

Regarding testing, this EIP relieves clients from supporting reversion of code overwriting.

Regarding reasoning, this EIP establishes an invariant that non-empty code is never modified.

Specification

If block.number >= 0, when a contract creation is on an account with non-zero nonce or non-empty code, the creation fails as if init code execution resulted in an exceptional halt. This applies to contract creation triggered by a contract creation transaction and by CREATE instruction.

Rationale

It seems impractical to implement never-used features just for passing tests. Client implementations will be simpler with this EIP.

Backwards Compatibility

This EIP is backwards compatible on the main network.

Test Cases

At least the BlockchainTest called createJS\_ExampleContract\_d0g0v0\_EIP158 will distinguish clients that implement this EIP.

Implementation

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
聚集 EIP 贡献者, 扩展以太坊
资源
GitHub
支持社区