-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address Collision of Contract Address Causes Exceptional Halt #689
Merged
+48
−0
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dd1949a
Add an EIP about making contract creation fail on address collision
pirapira a8253ad
Use 689
pirapira 7ea0415
Adjust formats
pirapira 7e0dedc
Cleanups by @Arachnid
pirapira 762d03f
Merge branch 'master' into address-collision
Arachnid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add an EIP about making contract creation fail on address collision
- Loading branch information
commit dd1949a87d3793c42bb989e5f52e40781a56558f
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
## Preamble | ||
|
||
EIP: <to be assigned> | ||
Title: Address Collision of Contract Address Causes Exceptional Halt | ||
Author: Yoichi Hirai <[email protected]> | ||
Type: Standard Track | ||
Category: Core | ||
Status: Draft | ||
Created: 2017-08-15 | ||
Requires: none | ||
Replaces: none | ||
|
||
|
||
## 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](https://github.com/ethereum/EIPs/pull/208) 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 releaves 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 unpractical 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 | ||
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 689, and move this file to EIPS/eip-689.md