-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
EIP-3540: Clarify contract creation failure #5878
Conversation
All tests passed; auto-merging...(pass) eip-3540.md
|
What is the motivation that all gas has to be consumed? |
If you consider the initcode validation is part of initcode execution then this is consistent (because any other failure in initcode execution fails the contract creation and consumes all gas provided). |
For the reference, the EIP-3670: EOF - Code Validation has this situation clarified and it proposes not consuming all the gas. I wasn't aware of this when proposing this change. Nevertheless, we should discuss it and pick better variant. |
There is also performance aspect of this: for initcode execution we need to validate the code and "load" it into internal representation. It may be more efficient to do both in single pass. This do not prevent implementing it with "light" failure, but is strong indicator that initcode validation is part of execution. |
It was originally motivated by suggestions in 3860 discussion, for failures in case initcode larger than limit: ethereum/tests#990 (comment) So I think arguments in favor not consuming gas for invalid initcode were like:
|
Abandoned. We decided to do it the old way, so not functional change is needed. |
See #5907 |
Clarify that in case of any of the new contract creation failure conditions all gas provided to the create instruction/transaction is consumed.
Current implementations do not consume all gas for the first condition but do for the second so this is a functional change.