-
Notifications
You must be signed in to change notification settings - Fork 22
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
CREATE's with failure condition #866
Comments
I don't think it gets to invoke the child frame because in the case of e.g. invalid init contract code, an empty item would be put on the operand stack signaling failure and not a new frame. Another example would be if the code is too large a halt state would be returned back. So there's some validation of the code before the child frame gets to execute from what I see, which would fall into your criteria I believe? The child frame is only spawned here and then we re-enter the process cycle again to run the init code and |
Thanks @lu-pinto. WRT The code size issue if (code != null && code.getSize() > maxInitcodeSize) { ... }
|
What do you mean by that ? Also for info: everything in Linea is done with respect to the London EVM. So any EIP's beyond London don't apply. |
This snippet of code you point to preceding the nonce update if (value.compareTo(account.getBalance()) > 0
|| frame.getDepth() >= 1024
|| account.getNonce() == -1
|| code == null
|| code.getEofVersion() != frame.getCode().getEofVersion()) {
fail(frame);
} relates to what the issue calls aborted CREATE's. In the present issue we are concerned with what we have called CREATE's raising a failure condition. And the link you provide suggests that CREATE's that aren't aborted (and may therefore still raise a failure condition) actually spawn a child context. |
Sidenote (for myself) I recognize either || account.getNonce() == -1 @letypequividelespoubelles pointed out that the nonce restriction is likely related to java's This condition is I guess some Besu stuff. || code == null Note. We are not enforcing the nonce to be a uint64 ... This may lead to some reference tests breaking. |
I see... I don't remember hearing that until now. I'll have another look keeping that in mind.
Maybe I'm missing something but I don't see that this check is configurable through any settings specifically to the London hardfork. Currently the besu code that Linea is running on is built on a fairly recent version of the besu client. delivery-26 is built from backport of besu@529bd33 git hash. Maybe the condition doesn't trigger with a london genesis file but it's not explicitly apparent that is the case. |
I had another thorough look at unit tests that seem to confirm what I mentioned for Regarding the invalid init contract code case, when code is loaded before execution, you are right that only EVMs with EOF V1 spec are impacted (not london). There is only a tiny case when |
Regarding:
I don't see anything else other than the contract account validation after loading the child frame on the stack, inside |
Our definition of Failure condition:
Preliminary Conclusion. The link you provide suggests that CREATE's that aren't aborted (and may therefore still raise a failure condition) actually spawn a child context.
Note. This would be easy to test by the way. Just attempt to CREATE2 with the same init code and salt two times in a row. The second CREATE2 will raise a failure condition.
@lu-pinto and @daniellehrner: could you confirm the above interpretation ?
The text was updated successfully, but these errors were encountered: