fix byzantium contract creation OOG

This commit is contained in:
andri lim 2019-05-02 13:39:55 +07:00 committed by zah
parent fd8a649df3
commit 2f08a6bc0e
3 changed files with 5 additions and 6 deletions

View File

@ -440,14 +440,14 @@ OK: 11/44 Fail: 0/44 Skip: 33/44
+ CreateOOGafterInitCodeReturndata.json OK
+ CreateOOGafterInitCodeReturndata2.json OK
+ CreateOOGafterInitCodeReturndata3.json OK
CreateOOGafterInitCodeReturndataSize.json Skip
+ CreateOOGafterInitCodeReturndataSize.json OK
+ CreateOOGafterInitCodeRevert.json OK
+ CreateOOGafterInitCodeRevert2.json OK
+ TransactionCollisionToEmpty.json OK
+ TransactionCollisionToEmptyButCode.json OK
+ TransactionCollisionToEmptyButNonce.json OK
```
OK: 29/30 Fail: 0/30 Skip: 1/30
OK: 30/30 Fail: 0/30 Skip: 0/30
## stDelegatecallTestHomestead
```diff
Call1024BalanceTooLow.json Skip
@ -2645,4 +2645,4 @@ OK: 133/133 Fail: 0/133 Skip: 0/133
OK: 130/130 Fail: 0/130 Skip: 0/130
---TOTAL---
OK: 2255/2447 Fail: 0/2447 Skip: 192/2447
OK: 2256/2447 Fail: 0/2447 Skip: 191/2447

View File

@ -146,7 +146,7 @@ proc writeContract*(computation: BaseComputation, fork: Fork): bool {.gcsafe.} =
db.setCode(storageAddr, contractCode.toRange)
result = true
else:
if fork < FkHomestead: computation.output = @[]
if fork < FkHomestead or fork >= FkByzantium: computation.output = @[]
result = false
proc transferBalance(computation: BaseComputation, opCode: static[Op]) =
@ -199,7 +199,7 @@ proc applyMessage*(computation: BaseComputation, opCode: static[Op]) =
when opCode == Create:
if computation.getFork >= FkSpurious:
computation.vmState.mutateStateDb:
db.incNonce(computation.msg.storageAddress)
db.incNonce(computation.msg.storageAddress)
if computation.getFork >= FkByzantium:
# RevertInCreateInInit.json
db.setStorageRoot(computation.msg.storageAddress, emptyRlpHash)

View File

@ -13,7 +13,6 @@
# being mostly used for short-term regression prevention.
func allowedFailingGeneralStateTest*(folder, name: string): bool =
let allowedFailingGeneralStateTests = @[
"CreateOOGafterInitCodeReturndataSize.json",
"modexp.json",
# all these tests below actually pass