-
Notifications
You must be signed in to change notification settings - Fork 74
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
new(tests): EIP-7069: Different RETURNDATACOPY oob #614
Conversation
I admit #595 went completely under my radar. But this PR here adds a test which I intended to test a specific edge case - that the RETURNDATACOPY OOB behavior is correct regardless of the caller frame being legacy or eof, that is:
In other words, that the correctness of OOB RETURNDATACOPY execution doesn't depend on the outside frame being eof/legacy. @marioevz @shemnon let me know how you see incorporating this edge case (maybe I'm missing that #595 does cover all 4 of these? I think it doesn't b/c entry point is always legacy) |
It's true but then the legacy code makes a call to a contract that can be either EOF or legacy, and that is the one that contains the |
Correct, but I specifically want to check if part under test is independent of the "outside", which is the caller context, i.e. RETURNDATACOPY logic correctly changes on the eof-legacy boundary, both ways. This is so far our only opcode where EOF and legacy behavior differs, so I want to give it a little extra attention. WDYT? |
Makes sense, seems to me though that we could add another execution-spec-tests/tests/prague/eip7692_eof_v1/eip7069_extcall/test_returndataload.py Line 74 in eee1625
execution-spec-tests/tests/prague/eip7692_eof_v1/eip7069_extcall/test_returndataload.py Line 103 in eee1625
EXT*CALL or *CALL , which would make it EOF or legacy.
Although, it would create a big amount of tests, but it might be necessary. |
I'm not understanding how any rational implementation would have different handling of returndatacopy if the called contract was EOF or legacy. It's a byte array in the frame context, not caring nor knowing how it was generated. This brings us into the realm of testing hypothetical implementation strategies. |
yea, I was wondering that this is better, once we have
I'm not sure about rational, but buggy or misunderstood - yes: one where eof/legacy-ness-flag of the RETURNDATACOPY is set once per transaction and/or then incorrectly modified when creating a new frame. |
Yes I think having a separate function, even if it has much of the code in |
I can look into trimming the returndata test to representative values, the cartesian join gets big quick. |
tests/prague/eip7692_eof_v1/eip7069_returndatacopy/test_returndatacopy_execution.py
Outdated
Show resolved
Hide resolved
Now I'm also worried about the complexity of the resulting test function, if we combine them, not only # of generated tests. Let me make the first step of moving the new test into the existing file and aligning conventions, and then we can see if we like it or not. |
70c5447
to
95ab812
Compare
I reworked the test, adding it under the existing test file. I think it is better not to overload the existing function, it takes a long time to fill already, and that would double it. |
🗒️ Description
Simple test case covering the updated out-of-bounds behavior of RETURNDATACOPY accross legacy and EOF contracts.
I'm not sure whether to place this new test in the existing
7069_extcall
subdir or in its own, please advise.🔗 Related Issues
Related update to the spec ethereum/EIPs#8617. Update to evmone ethereum/evmone#909
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.