-
Notifications
You must be signed in to change notification settings - Fork 323
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
Refund Reset #1111
Refund Reset #1111
Conversation
Here is an edge case with EthereumJS found which is not covered by tests (and also not by this PR). It can only happen on Frontier.
Our bug happens because in (4) we clear out the storage refunds and the selfdestruct, but this should not happen |
This transaction caused the consensus bug: https://etherscan.io/tx/0xbb59b675291237985bc558b6f66f8c701890cc84aea6604500c50f1a23e58605 This PR fixed the bug; |
So it matters exactly where in the CREATE process the OOG happens, just having OOG in the constructor is useless. Let me see how I can get that. Since it's the final stage, I assume that if |
@jochem-brouwer , can you check if the latest test (https://github.com/ethereum/tests/blob/aa7a5b466ad73919995c63e01c80dc34ebe99af6/src/GeneralStateTestsFiller/stRefundTest/refundResetFrontierFiller.yml) covers this corner case? Also, does did it happen only on Frontier, or also on other versions? |
I just checked (and might have missed this before, if that is the case - sorry!) - test It only happens on Frontier. This bug is caused by: there is enough gas to pay for execution for creating a contract, but not enough to pay the final deposit fee. Per Homestead (first hardfork, right after Frontier): https://eips.ethereum.org/EIPS/eip-2, quote; Thanks for writing these tests 😄 |
Yay! ready to merge? |
It depends. Do we want to generalize it to other similar (not identical) problems? Or is this the kind of rare fluke we don't expect to ever happen again, so we shouldn't look for variants on the theme of refund counter after a failed call. |
Lets merge this one, the rest can be smth to think about for the future testccases. |
Sure, it's ready to merge. |
make an issue in case you would want to return to this topic to write more scenarios. about refund reset in different context |
Check if the refund amount (for
sstore(<cell>, 0)
) resets when various things happen.