fix invalid opcodes bug, GST +1

This commit is contained in:
andri lim 2019-03-18 13:44:22 +07:00
parent 4f6f564626
commit 739e20253a
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
4 changed files with 12 additions and 8 deletions

View File

@ -183,7 +183,7 @@ OK: 50/79 Fail: 0/79 Skip: 29/79
+ createInitFailBadJumpDestination.json OK + createInitFailBadJumpDestination.json OK
+ createInitFailStackSizeLargerThan1024.json OK + createInitFailStackSizeLargerThan1024.json OK
+ createInitFailStackUnderflow.json OK + createInitFailStackUnderflow.json OK
createInitFailUndefinedInstruction.json Skip + createInitFailUndefinedInstruction.json OK
+ createInitFail_OOGduringInit.json OK + createInitFail_OOGduringInit.json OK
+ createInitOOGforCREATE.json OK + createInitOOGforCREATE.json OK
+ createJS_ExampleContract.json OK + createJS_ExampleContract.json OK
@ -193,7 +193,7 @@ OK: 50/79 Fail: 0/79 Skip: 29/79
+ createNameRegistratorPreStore1NotEnoughGas.json OK + createNameRegistratorPreStore1NotEnoughGas.json OK
+ createNameRegistratorendowmentTooHigh.json OK + createNameRegistratorendowmentTooHigh.json OK
``` ```
OK: 19/39 Fail: 0/39 Skip: 20/39 OK: 20/39 Fail: 0/39 Skip: 19/39
## stCallDelegateCodesCallCodeHomestead ## stCallDelegateCodesCallCodeHomestead
```diff ```diff
callcallcallcode_001.json Skip callcallcallcode_001.json Skip
@ -2520,4 +2520,4 @@ OK: 0/133 Fail: 0/133 Skip: 133/133
OK: 0/130 Fail: 0/130 Skip: 130/130 OK: 0/130 Fail: 0/130 Skip: 130/130
---TOTAL--- ---TOTAL---
OK: 1310/2334 Fail: 0/2334 Skip: 1024/2334 OK: 1311/2334 Fail: 0/2334 Skip: 1023/2334

View File

@ -160,6 +160,11 @@ proc applyMessage(computation: var BaseComputation, opCode: static[Op]): bool =
debug "EVMError applyMessage failed", debug "EVMError applyMessage failed",
msg = computation.error.info, msg = computation.error.info,
depth = computation.msg.depth depth = computation.msg.depth
except ValueError:
snapshot.revert(true)
debug "ValueError applyMessage failed",
msg = computation.error.info,
depth = computation.msg.depth
result = not computation.isError result = not computation.isError

View File

@ -283,7 +283,7 @@
"0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000060" "0000000000000000000000000000000000000000000000000000000000000060"
], ],
"error": "Invalid instruction, received an opcode not implemented in the current fork." "error": ""
} }
], ],
"stateDiff": { "stateDiff": {
@ -704,7 +704,7 @@
"0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000060" "0000000000000000000000000000000000000000000000000000000000000060"
], ],
"error": "Invalid instruction, received an opcode not implemented in the current fork." "error": ""
} }
] ]
}, },

View File

@ -81,7 +81,6 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
# Frontier failed test cases # Frontier failed test cases
"callcallcallcode_001_OOGMAfter_1.json", "callcallcallcode_001_OOGMAfter_1.json",
"callcallcallcode_001_OOGMAfter_2.json", "callcallcallcode_001_OOGMAfter_2.json",
"createInitFailUndefinedInstruction.json",
"callcallcodecall_010_OOGMAfter.json", "callcallcodecall_010_OOGMAfter.json",
# Failed in homestead but OK in Frontier # Failed in homestead but OK in Frontier