Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

a contract suicide test case fail on ethermint #864

Closed
yihuang opened this issue Dec 31, 2021 · 3 comments
Closed

a contract suicide test case fail on ethermint #864

yihuang opened this issue Dec 31, 2021 · 3 comments

Comments

@yihuang
Copy link
Contributor

yihuang commented Dec 31, 2021

System info: ethermint main

Steps to reproduce:

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;

contract Inner {
    function destroy() public {
        selfdestruct(payable(msg.sender));
    }
}

contract Outer {
    function codesize_after_suicide(Inner inner) public {
        address addr = address(inner);
        inner.destroy();
        uint _size = 0;
        assembly {
            _size := extcodesize(addr)
        }
        require(_size > 0);
    }
}
  • deploy Inner and Outer
  • call outer.codesize_after_suicide(inner), check the result
  • it success on go-ethereum, but fail in ethermint.

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Additional info: [Include gist of relevant config, logs, etc.]

@yihuang
Copy link
Contributor Author

yihuang commented Dec 31, 2021

BTW, it's fixed in statedb-refactoring, but maybe good to fix in main too, if the refactoring is not merged anytime soon.

@fedekunze
Copy link
Contributor

we can add the test after #729 is merged

@crypto-facs
Copy link
Contributor

I am going to close this issue as it was solved #729 was merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants