Skip to content
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

Contract creation on non-empty code or non-zero nonce throws an exception #323

Merged
merged 2 commits into from
Jun 14, 2021

Conversation

pirapira
Copy link
Member

@pirapira pirapira commented Aug 4, 2017

This implements a protocol change which is very hard to hit anyway. The idea is to avoid overwriting contracts even when the calculated address coincides with existing something. Here "existing something" is an account with non-zero nonce or non-empty code. This is consistent with EIP86 planned in Constantinople.

There have been some test failures happening only on the address-collision cases, but most probably the time spent there is wasted because keccak256 collisions cause far bigger problems anyway. It makes sense to make the protocol specification simpler for the address collision case.

@pirapira
Copy link
Member Author

This implements ethereum/EIPs#684

@fulldecent
Copy link
Contributor

Is there any more discussion on this. This is something I wondered too when reading the spec.

Copy link
Contributor

@livnev livnev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be merged.

Paper.tex Outdated
@@ -760,7 +760,7 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{}
1 & \text{otherwise}
\end{cases} \\
\nonumber \text{where} \\
F &\equiv \big((\boldsymbol{\sigma}^{**} = \varnothing \ \wedge\ \mathbf{o} = \varnothing) \vee\ g^{**} < c \ \vee\ |\mathbf{o}| > 24576\big)
F \equiv &\big(\boldsymbol{\sigma}[a]_c \neq \texttt{\small KEC}\big(()\big) \ \vee\ \boldsymbol{\sigma}[a]_n \neq 0 \ \vee\ (\boldsymbol{\sigma}^{**} = \varnothing \ \wedge\ \mathbf{o} = \varnothing) \\\nonumber & \vee\ g^{**} < c \ \vee\ |\mathbf{o}| > 24576\big)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be merged. I know that the yellow paper hasn't caught up to Constantinople yet but this would be a start.

@ytrezq
Copy link

ytrezq commented Jul 3, 2019

@pirapira since this is now activated on mainnet, maybe the tag is no longer relavant., isn t it?

@yperbasis
Copy link
Member

For reference: geth implementation

@yperbasis yperbasis merged commit 98ad373 into ethereum:master Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants