fix callcode insufficient funds, GST +6
This commit is contained in:
parent
990bc44c65
commit
d0822c26d1
|
@ -445,14 +445,14 @@ OK: 7/34 Fail: 0/34 Skip: 27/34
|
||||||
CreateAndGasInsideCreate.json Skip
|
CreateAndGasInsideCreate.json Skip
|
||||||
DelegateCallOnEIP.json Skip
|
DelegateCallOnEIP.json Skip
|
||||||
ExecuteCallThatAskForeGasThenTrabsactionHas.json Skip
|
ExecuteCallThatAskForeGasThenTrabsactionHas.json Skip
|
||||||
NewGasPriceForCodes.json Skip
|
+ NewGasPriceForCodes.json OK
|
||||||
SuicideToExistingContract.json Skip
|
SuicideToExistingContract.json Skip
|
||||||
SuicideToNotExistingContract.json Skip
|
SuicideToNotExistingContract.json Skip
|
||||||
Transaction64Rule_d64e0.json Skip
|
Transaction64Rule_d64e0.json Skip
|
||||||
Transaction64Rule_d64m1.json Skip
|
Transaction64Rule_d64m1.json Skip
|
||||||
Transaction64Rule_d64p1.json Skip
|
Transaction64Rule_d64p1.json Skip
|
||||||
```
|
```
|
||||||
OK: 0/13 Fail: 0/13 Skip: 13/13
|
OK: 1/13 Fail: 0/13 Skip: 12/13
|
||||||
## stEIP150singleCodeGasPrices
|
## stEIP150singleCodeGasPrices
|
||||||
```diff
|
```diff
|
||||||
+ RawBalanceGas.json OK
|
+ RawBalanceGas.json OK
|
||||||
|
@ -592,9 +592,9 @@ OK: 46/46 Fail: 0/46 Skip: 0/46
|
||||||
+ CreateAndGasInsideCreateWithMemExpandingCalls.json OK
|
+ CreateAndGasInsideCreateWithMemExpandingCalls.json OK
|
||||||
+ DelegateCallOnEIPWithMemExpandingCalls.json OK
|
+ DelegateCallOnEIPWithMemExpandingCalls.json OK
|
||||||
+ ExecuteCallThatAskMoreGasThenTransactionHasWithMemExpandingCalls.jsonOK
|
+ ExecuteCallThatAskMoreGasThenTransactionHasWithMemExpandingCalls.jsonOK
|
||||||
NewGasPriceForCodesWithMemExpandingCalls.json Skip
|
+ NewGasPriceForCodesWithMemExpandingCalls.json OK
|
||||||
```
|
```
|
||||||
OK: 7/8 Fail: 0/8 Skip: 1/8
|
OK: 8/8 Fail: 0/8 Skip: 0/8
|
||||||
## stMemoryStressTest
|
## stMemoryStressTest
|
||||||
```diff
|
```diff
|
||||||
CALLCODE_Bounds.json Skip
|
CALLCODE_Bounds.json Skip
|
||||||
|
@ -713,7 +713,7 @@ OK: 67/67 Fail: 0/67 Skip: 0/67
|
||||||
+ NonZeroValue_CALL.json OK
|
+ NonZeroValue_CALL.json OK
|
||||||
+ NonZeroValue_CALLCODE.json OK
|
+ NonZeroValue_CALLCODE.json OK
|
||||||
+ NonZeroValue_CALLCODE_ToEmpty.json OK
|
+ NonZeroValue_CALLCODE_ToEmpty.json OK
|
||||||
NonZeroValue_CALLCODE_ToNonNonZeroBalance.json Skip
|
+ NonZeroValue_CALLCODE_ToNonNonZeroBalance.json OK
|
||||||
+ NonZeroValue_CALLCODE_ToOneStorageKey.json OK
|
+ NonZeroValue_CALLCODE_ToOneStorageKey.json OK
|
||||||
+ NonZeroValue_CALL_ToEmpty.json OK
|
+ NonZeroValue_CALL_ToEmpty.json OK
|
||||||
+ NonZeroValue_CALL_ToNonNonZeroBalance.json OK
|
+ NonZeroValue_CALL_ToNonNonZeroBalance.json OK
|
||||||
|
@ -735,7 +735,7 @@ OK: 67/67 Fail: 0/67 Skip: 0/67
|
||||||
+ NonZeroValue_TransactionCALLwithData_ToNonNonZeroBalance.json OK
|
+ NonZeroValue_TransactionCALLwithData_ToNonNonZeroBalance.json OK
|
||||||
+ NonZeroValue_TransactionCALLwithData_ToOneStorageKey.json OK
|
+ NonZeroValue_TransactionCALLwithData_ToOneStorageKey.json OK
|
||||||
```
|
```
|
||||||
OK: 23/24 Fail: 0/24 Skip: 1/24
|
OK: 24/24 Fail: 0/24 Skip: 0/24
|
||||||
## stPreCompiledContracts
|
## stPreCompiledContracts
|
||||||
```diff
|
```diff
|
||||||
identity_to_bigger.json Skip
|
identity_to_bigger.json Skip
|
||||||
|
@ -1099,7 +1099,7 @@ OK: 0/16 Fail: 0/16 Skip: 16/16
|
||||||
+ randomStatetest245.json OK
|
+ randomStatetest245.json OK
|
||||||
+ randomStatetest246.json OK
|
+ randomStatetest246.json OK
|
||||||
+ randomStatetest247.json OK
|
+ randomStatetest247.json OK
|
||||||
randomStatetest248.json Skip
|
+ randomStatetest248.json OK
|
||||||
+ randomStatetest249.json OK
|
+ randomStatetest249.json OK
|
||||||
+ randomStatetest25.json OK
|
+ randomStatetest25.json OK
|
||||||
+ randomStatetest250.json OK
|
+ randomStatetest250.json OK
|
||||||
|
@ -1284,7 +1284,7 @@ OK: 0/16 Fail: 0/16 Skip: 16/16
|
||||||
+ randomStatetest97.json OK
|
+ randomStatetest97.json OK
|
||||||
+ randomStatetest98.json OK
|
+ randomStatetest98.json OK
|
||||||
```
|
```
|
||||||
OK: 317/327 Fail: 0/327 Skip: 10/327
|
OK: 318/327 Fail: 0/327 Skip: 9/327
|
||||||
## stRandom2
|
## stRandom2
|
||||||
```diff
|
```diff
|
||||||
+ 201503110226PYTHON_DUP6.json OK
|
+ 201503110226PYTHON_DUP6.json OK
|
||||||
|
@ -1609,10 +1609,10 @@ OK: 34/37 Fail: 0/37 Skip: 3/37
|
||||||
RevertOpcodeDirectCall.json Skip
|
RevertOpcodeDirectCall.json Skip
|
||||||
RevertOpcodeInCallsOnNonEmptyReturnData.json Skip
|
RevertOpcodeInCallsOnNonEmptyReturnData.json Skip
|
||||||
+ RevertOpcodeInCreateReturns.json OK
|
+ RevertOpcodeInCreateReturns.json OK
|
||||||
RevertOpcodeInInit.json Skip
|
+ RevertOpcodeInInit.json OK
|
||||||
RevertOpcodeMultipleSubCalls.json Skip
|
RevertOpcodeMultipleSubCalls.json Skip
|
||||||
RevertOpcodeReturn.json Skip
|
RevertOpcodeReturn.json Skip
|
||||||
RevertOpcodeWithBigOutputInInit.json Skip
|
+ RevertOpcodeWithBigOutputInInit.json OK
|
||||||
RevertPrecompiledTouch.json Skip
|
RevertPrecompiledTouch.json Skip
|
||||||
RevertPrecompiledTouchCC.json Skip
|
RevertPrecompiledTouchCC.json Skip
|
||||||
RevertPrecompiledTouchDC.json Skip
|
RevertPrecompiledTouchDC.json Skip
|
||||||
|
@ -1632,7 +1632,7 @@ OK: 34/37 Fail: 0/37 Skip: 3/37
|
||||||
+ TouchToEmptyAccountRevert2.json OK
|
+ TouchToEmptyAccountRevert2.json OK
|
||||||
+ TouchToEmptyAccountRevert3.json OK
|
+ TouchToEmptyAccountRevert3.json OK
|
||||||
```
|
```
|
||||||
OK: 31/43 Fail: 0/43 Skip: 12/43
|
OK: 33/43 Fail: 0/43 Skip: 10/43
|
||||||
## stShift
|
## stShift
|
||||||
```diff
|
```diff
|
||||||
sar00.json Skip
|
sar00.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: 1239/2334 Fail: 0/2334 Skip: 1095/2334
|
OK: 1245/2334 Fail: 0/2334 Skip: 1089/2334
|
||||||
|
|
|
@ -112,7 +112,7 @@ proc commit*(snapshot: var ComputationSnapshot) {.inline.} =
|
||||||
proc dispose*(snapshot: var ComputationSnapshot) {.inline.} =
|
proc dispose*(snapshot: var ComputationSnapshot) {.inline.} =
|
||||||
snapshot.snapshot.dispose()
|
snapshot.snapshot.dispose()
|
||||||
|
|
||||||
proc transferBalance(computation: var BaseComputation) =
|
proc transferBalance(computation: var BaseComputation, opCode: static[Op]) =
|
||||||
if computation.msg.depth >= MaxCallDepth:
|
if computation.msg.depth >= MaxCallDepth:
|
||||||
raise newException(StackDepthError, "Stack depth limit reached")
|
raise newException(StackDepthError, "Stack depth limit reached")
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ proc transferBalance(computation: var BaseComputation) =
|
||||||
raise newException(InsufficientFunds,
|
raise newException(InsufficientFunds,
|
||||||
&"Insufficient funds: {senderBalance} < {computation.msg.value}")
|
&"Insufficient funds: {senderBalance} < {computation.msg.value}")
|
||||||
|
|
||||||
|
when opCode in {Call, Create}:
|
||||||
computation.vmState.mutateStateDb:
|
computation.vmState.mutateStateDb:
|
||||||
db.subBalance(computation.msg.sender, computation.msg.value)
|
db.subBalance(computation.msg.sender, computation.msg.value)
|
||||||
db.addBalance(computation.msg.storageAddress, computation.msg.value)
|
db.addBalance(computation.msg.storageAddress, computation.msg.value)
|
||||||
|
@ -131,9 +132,9 @@ proc applyMessage(computation: var BaseComputation, opCode: static[Op]): bool =
|
||||||
var snapshot = computation.snapshot()
|
var snapshot = computation.snapshot()
|
||||||
defer: snapshot.dispose()
|
defer: snapshot.dispose()
|
||||||
|
|
||||||
when opCode in {Call, Create}:
|
when opCode in {CallCode, Call, Create}:
|
||||||
try:
|
try:
|
||||||
computation.transferBalance()
|
computation.transferBalance(opCode)
|
||||||
except VMError:
|
except VMError:
|
||||||
snapshot.revert()
|
snapshot.revert()
|
||||||
debug "transferBalance failed", msg = computation.error.info
|
debug "transferBalance failed", msg = computation.error.info
|
||||||
|
|
|
@ -50,14 +50,11 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
|
||||||
"randomStatetest14.json",
|
"randomStatetest14.json",
|
||||||
"randomStatetest184.json",
|
"randomStatetest184.json",
|
||||||
"randomStatetest85.json",
|
"randomStatetest85.json",
|
||||||
"randomStatetest248.json",
|
|
||||||
"RevertOpcodeCalls.json",
|
"RevertOpcodeCalls.json",
|
||||||
"RevertOpcodeDirectCall.json",
|
"RevertOpcodeDirectCall.json",
|
||||||
"RevertOpcodeInCallsOnNonEmptyReturnData.json",
|
"RevertOpcodeInCallsOnNonEmptyReturnData.json",
|
||||||
"RevertOpcodeInInit.json",
|
|
||||||
"RevertOpcodeMultipleSubCalls.json",
|
"RevertOpcodeMultipleSubCalls.json",
|
||||||
"RevertOpcodeReturn.json",
|
"RevertOpcodeReturn.json",
|
||||||
"RevertOpcodeWithBigOutputInInit.json",
|
|
||||||
"tx_e1c174e2.json",
|
"tx_e1c174e2.json",
|
||||||
"suicideCoinbase.json",
|
"suicideCoinbase.json",
|
||||||
"Opcodes_TransactionInit.json",
|
"Opcodes_TransactionInit.json",
|
||||||
|
@ -72,9 +69,6 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
|
||||||
"randomStatetest101.json",
|
"randomStatetest101.json",
|
||||||
"randomStatetest7.json",
|
"randomStatetest7.json",
|
||||||
# 2019-02-17:
|
# 2019-02-17:
|
||||||
"NewGasPriceForCodes.json",
|
|
||||||
"NewGasPriceForCodesWithMemExpandingCalls.json",
|
|
||||||
"NonZeroValue_CALLCODE_ToNonNonZeroBalance.json",
|
|
||||||
"pairingTest.json",
|
"pairingTest.json",
|
||||||
"pointAdd.json",
|
"pointAdd.json",
|
||||||
"pointAddTrunc.json",
|
"pointAddTrunc.json",
|
||||||
|
|
Loading…
Reference in New Issue