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

Test wanted: CREATE properly clears dirty return data #993

Closed
chfast opened this issue Nov 24, 2021 · 0 comments · Fixed by #994
Closed

Test wanted: CREATE properly clears dirty return data #993

chfast opened this issue Nov 24, 2021 · 0 comments · Fixed by #994
Assignees

Comments

@chfast
Copy link
Member

chfast commented Nov 24, 2021

Scenario:

  1. At depth 0 we execute CREATE or CREATE2 instruction.
  2. Inside the "create" we invoke somethings what produces non-empty return data. Can be a call to other contract, reverting create, call to a precompile. After this the RETURNDATASIZE != 0.
  3. Initial "create" finishes successfully.
  4. After "create" check if correctly RETURNDATASIZE == 0.

This is tested for CREATE but only the case when a precompile is called. None of this is tested for CREATE2.

These are state test failures for broken CREATE / CREATE2 implementations:

--- FAIL: TestState (0.09s)                                                                                                                                                                                                       
    --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json#01 (0.04s)                                                                                                                                     
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json#01/Byzantium/0/trie (0.00s)                                                                                                                
            state_test.go:111: post state root mismatch: got 419ed9a6ea4a6904cdfebbca21180ba566e13a15b1f0e6e78b02aad8ecc2997b, want f95f692cdefb7ca2b20723b7cbd2d9380c31d3a721d45860bc962f96b08411ca                              
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json#01/Constantinople/0/trie (0.00s)
            state_test.go:111: post state root mismatch: got 419ed9a6ea4a6904cdfebbca21180ba566e13a15b1f0e6e78b02aad8ecc2997b, want f95f692cdefb7ca2b20723b7cbd2d9380c31d3a721d45860bc962f96b08411ca
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json#01/ConstantinopleFix/0/trie (0.00s)
            state_test.go:111: post state root mismatch: got 419ed9a6ea4a6904cdfebbca21180ba566e13a15b1f0e6e78b02aad8ecc2997b, want f95f692cdefb7ca2b20723b7cbd2d9380c31d3a721d45860bc962f96b08411ca
    --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json (0.01s)
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json/Berlin/0/trie (0.00s)
            state_test.go:111: post state root mismatch: got b7b627184ef7d7cdb990b7509e7c2cba862b7f3babb6451b211f9052b79a3712, want 2f794e9dcccbe9d8d666a820290f95854bc4bcf59c160e6f176a77b1812eb2f9
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json/Istanbul/0/trie (0.00s)
            state_test.go:111: post state root mismatch: got deb6ba13531d5df25a25c7adcdccca9d3eb1487ea279b9ec8f2a68fc0d1945a5, want cc4849540f9cceb64090f3b036048a589bed422026b552427e5d553360883bd9
        --- FAIL: TestState/stReturnDataTest/create_callprecompile_returndatasize.json/London/0/trie (0.00s)
            state_test.go:111: post state root mismatch: got 3c8191d2894f18d6f2bb0826713ae2024b6397a5656593f61c910912db281c31, want 64a71565b1394a321a424f8901648d468c5e8cb0268da3ebb556e153cf23b026
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 a pull request may close this issue.

2 participants