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

VM: If a create call fails due to insufficient gas, it should return status=false #186

Closed
orogvany opened this issue Jul 4, 2019 · 5 comments
Labels
discussion Requires discussion

Comments

@orogvany
Copy link
Collaborator

orogvany commented Jul 4, 2019

Currently create a new contract, and it fails due to insufficient gas, but the status is success.

This seems off.

@semuxgo
Copy link
Contributor

semuxgo commented Jul 4, 2019

Could you reproduce this with a unit test?

@semuxgo semuxgo added the bug Something isn't working label Jul 4, 2019
@orogvany
Copy link
Collaborator Author

orogvany commented Jul 4, 2019

Yes. Incoming

orogvany added a commit to orogvany/semux-core that referenced this issue Jul 4, 2019
the transaction is marked as successful create, but it was not stored
and contract not returned in return data.
@orogvany orogvany changed the title If a create call fails due to insufficient gas, it should return status=false VM: If a create call fails due to insufficient gas, it should return status=false Jul 4, 2019
@orogvany orogvany added the VM label Jul 4, 2019
@orogvany
Copy link
Collaborator Author

orogvany commented Jul 5, 2019

For posterity sake,

This is due to the createEmptyContractOnOOG() config. The remaining gas is not enough to cover the cost for the contract code deposit, so

    if createEmptyContractOnOOG() == true, create an empty contract and return a success;
    otherwise, return a failure.

I need the check how the latest ethereum set this flag.

Related code:
https://github.com/semuxproject/evm/blob/de88e39aa01be079c555f268953725076b151d85/src/main/java/org/ethereum/vm/client/TransactionExecutor.java#L264-L285

Will leave issue open, but remove bug tag. May revisit if it becomes an issue.

@orogvany orogvany added discussion Requires discussion and removed bug Something isn't working labels Jul 5, 2019
@semuxgo semuxgo removed the VM label Jul 6, 2019
@semuxgo
Copy link
Contributor

semuxgo commented Jul 19, 2019

See #229

@semuxgo semuxgo closed this as completed Jul 19, 2019
@orogvany
Copy link
Collaborator Author

👍

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

No branches or pull requests

2 participants