-
Notifications
You must be signed in to change notification settings - Fork 772
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
Collision tests are failing (consensus bug) #232
Comments
That overwriting behavior will change when https://github.com/ethereum/EIPs/pull/208/files#diff-95b306e6e6d2d6dbb0c5fd3ac4ea45c4R27 is activated, but this EIP was postponed to Constantinople or later. |
@pirapira Ah, thanks so much! |
@pirapira ah, maybe as an addition: what are the differences then? Are there any differences in gas costs compared to a normal |
There should be no differences in gas consumption (overwriting = newly deploying). I'm just trying up to conjure up the relevant YP page in my head though. |
And the existing nonce (as well as the code) should be just forgotten. |
@holgerd77 I think these tests are passing now? |
@axic Hmm, these tests are currently commented out in the test runner, what makes you assume that they are passing now? I once had a somewhat deeper look into this, I assumed that this would need some significant changes in the contract creation code in |
I didn't know they were commented out, but since we pass the "almost latest" tests repo I assumed they would be working. |
For an updated test setup: tested the single test case from above by creating a custom CreateCollisionToEmpty.json file just leaving the selected test value combination in the { "Byzantium" : [
{
"hash" : "0x5bfb8ec11eebda3c851a62b9923bac77e93819fa4f09898300c61ed4a7871dee",
"indexes" : {
"data" : 2,
"gas" : 0,
"value" : 0
},
"logs" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
} This can be run on node tests/tester -s --customStateTest='./CreateCollisionToEmpty.json' --data=2 --gas=0 --value=0 --jsontrace producing the following stack trace:
Result from geth by running: evm --json --nomemory statetest CreateCollisionToEmpty.json {"pc":0,"op":96,"gas":"0x8d4f8","gasCost":"0x3","memory":"0x","memSize":0,"stack":[],"depth":1,"opName":"PUSH1","error":""}
{"pc":2,"op":96,"gas":"0x8d4f5","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0"],"depth":1,"opName":"PUSH1","error":""}
{"pc":4,"op":96,"gas":"0x8d4f2","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0"],"depth":1,"opName":"PUSH1","error":""}
{"pc":6,"op":96,"gas":"0x8d4ef","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0"],"depth":1,"opName":"PUSH1","error":""}
{"pc":8,"op":96,"gas":"0x8d4ec","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0","0x0"],"depth":1,"opName":"PUSH1","error":""}
{"pc":10,"op":96,"gas":"0x8d4e9","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0"],"depth":1,"opName":"PUSH1","error":""}
{"pc":12,"op":53,"gas":"0x8d4e6","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0x0"],"depth":1,"opName":"CALLDATALOAD","error":""}
{"pc":13,"op":98,"gas":"0x8d4e3","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0x3000000000000000000000000000000000000000"],"depth":1,"opName":"PUSH3","error":""}
{"pc":17,"op":241,"gas":"0x8d4e0","gasCost":"0x13b3c","memory":"0x","memSize":0,"stack":["0x0","0x0","0x0","0x0","0x0","0x3000000000000000000000000000000000000000","0x13880"],"depth":1,"opName":"CALL","error":""}
{"pc":0,"op":100,"gas":"0x13880","gasCost":"0x3","memory":"0x","memSize":0,"stack":[],"depth":2,"opName":"PUSH5","error":""}
{"pc":6,"op":96,"gas":"0x1387d","gasCost":"0x3","memory":"0x","memSize":0,"stack":["0x6001600155"],"depth":2,"opName":"PUSH1","error":""}
{"pc":8,"op":82,"gas":"0x1387a","gasCost":"0x6","memory":"0x","memSize":32,"stack":["0x6001600155","0x0"],"depth":2,"opName":"MSTORE","error":""}
{"pc":9,"op":96,"gas":"0x13874","gasCost":"0x3","memory":"0x","memSize":32,"stack":[],"depth":2,"opName":"PUSH1","error":""}
{"pc":11,"op":96,"gas":"0x13871","gasCost":"0x3","memory":"0x","memSize":32,"stack":["0x5"],"depth":2,"opName":"PUSH1","error":""}
{"pc":13,"op":96,"gas":"0x1386e","gasCost":"0x3","memory":"0x","memSize":32,"stack":["0x5","0x1b"],"depth":2,"opName":"PUSH1","error":""}
{"pc":15,"op":240,"gas":"0x1386b","gasCost":"0x7d00","memory":"0x","memSize":32,"stack":["0x5","0x1b","0x0"],"depth":2,"opName":"CREATE","error":""}
{"pc":16,"op":96,"gas":"0x2ed","gasCost":"0x3","memory":"0x","memSize":32,"stack":["0x0"],"depth":2,"opName":"PUSH1","error":""}
{"pc":18,"op":85,"gas":"0x2ea","gasCost":"0x1388","memory":"0x","memSize":32,"stack":["0x0","0x1"],"depth":2,"opName":"SSTORE","error":"out of gas"}
{"pc":18,"op":0,"gas":"0x799a4","gasCost":"0x0","memory":"0x","memSize":0,"stack":["0x0"],"depth":1,"opName":"STOP","error":""}
{"output":"","gasUsed":"0x13b54","time":1625727}
{"stateRoot": "5bfb8ec11eebda3c851a62b9923bac77e93819fa4f09898300c61ed4a7871dee"}
[
{
"name": "CreateCollisionToEmpty",
"pass": true,
"fork": "Byzantium"
}
] So gas values after the |
Fixed (on the sideline 😄) by #329, will close. |
Description
The testing team recently added collision tests, testing the (unlikely but possible case) that a
CREATE
call is trying to create a contract on an existing address (hence: (address) collision).These tests are still failing in the vm, failing tests cases:
CreateCollisionToEmpty
(test | filler)TransactionCollisionToEmptyButCode
TransactionCollisionToEmptyButNonce
Work Status
What I've got so far:
There has to be some additional check for account existence in
runCall.js
in theloadToAccount
function in the form of:I'm just not sure, what the semantics are here. Should the
CREATE
call just return and do nothing? Or throwing an OOG error? Some (detailed) hint on that would be helpful.Reproduce
The following command produces a stack trace for a failing
CreateCollisionToEmpty
test:Here is a gist with the succeeding stack trace from pyethereum.
The text was updated successfully, but these errors were encountered: