mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-11 12:54:13 +00:00
Activate logging, sha3, arith tests (#51)
* Activate the tests * Use 3 params in memExpansion gas costs, fix 31 log tests and 8 sha3 tests * Activate Control Flow tests as well
This commit is contained in:
parent
8d76cab46a
commit
05275f9773
430
VMTests.md
430
VMTests.md
@ -23,7 +23,7 @@ VMTests
|
||||
+ addmodDivByZero1.json OK
|
||||
+ addmodDivByZero2.json OK
|
||||
+ addmodDivByZero3.json OK
|
||||
arith1.json Skip
|
||||
+ arith1.json OK
|
||||
+ div1.json OK
|
||||
+ divBoostBug.json OK
|
||||
+ divByNonZero0.json OK
|
||||
@ -198,7 +198,7 @@ VMTests
|
||||
+ sub3.json OK
|
||||
+ sub4.json OK
|
||||
```
|
||||
OK: 193/195 Fail: 1/195 Skip: 1/195
|
||||
OK: 194/195 Fail: 1/195 Skip: 0/195
|
||||
## vmBitwiseLogicOperation
|
||||
```diff
|
||||
+ and0.json OK
|
||||
@ -337,203 +337,203 @@ OK: 12/12 Fail: 0/12 Skip: 0/12
|
||||
OK: 0/52 Fail: 0/52 Skip: 52/52
|
||||
## vmIOandFlowOperations
|
||||
```diff
|
||||
BlockNumberDynamicJump0_AfterJumpdest.json Skip
|
||||
BlockNumberDynamicJump0_AfterJumpdest3.json Skip
|
||||
BlockNumberDynamicJump0_foreverOutOfGas.json Skip
|
||||
BlockNumberDynamicJump0_jumpdest0.json Skip
|
||||
BlockNumberDynamicJump0_jumpdest2.json Skip
|
||||
BlockNumberDynamicJump0_withoutJumpdest.json Skip
|
||||
BlockNumberDynamicJump1.json Skip
|
||||
BlockNumberDynamicJumpInsidePushWithJumpDest.json Skip
|
||||
BlockNumberDynamicJumpInsidePushWithoutJumpDest.json Skip
|
||||
BlockNumberDynamicJumpi0.json Skip
|
||||
BlockNumberDynamicJumpi1.json Skip
|
||||
BlockNumberDynamicJumpi1_jumpdest.json Skip
|
||||
BlockNumberDynamicJumpiAfterStop.json Skip
|
||||
BlockNumberDynamicJumpiOutsideBoundary.json Skip
|
||||
BlockNumberDynamicJumpifInsidePushWithJumpDest.json Skip
|
||||
BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json Skip
|
||||
DyanmicJump0_outOfBoundary.json Skip
|
||||
DynamicJump0_AfterJumpdest.json Skip
|
||||
DynamicJump0_AfterJumpdest3.json Skip
|
||||
DynamicJump0_foreverOutOfGas.json Skip
|
||||
DynamicJump0_jumpdest0.json Skip
|
||||
DynamicJump0_jumpdest2.json Skip
|
||||
DynamicJump0_withoutJumpdest.json Skip
|
||||
DynamicJump1.json Skip
|
||||
DynamicJumpAfterStop.json Skip
|
||||
DynamicJumpInsidePushWithJumpDest.json Skip
|
||||
DynamicJumpInsidePushWithoutJumpDest.json Skip
|
||||
DynamicJumpJD_DependsOnJumps0.json Skip
|
||||
DynamicJumpJD_DependsOnJumps1.json Skip
|
||||
DynamicJumpPathologicalTest0.json Skip
|
||||
DynamicJumpPathologicalTest1.json Skip
|
||||
DynamicJumpPathologicalTest2.json Skip
|
||||
DynamicJumpPathologicalTest3.json Skip
|
||||
DynamicJumpStartWithJumpDest.json Skip
|
||||
DynamicJump_value1.json Skip
|
||||
DynamicJump_value2.json Skip
|
||||
DynamicJump_value3.json Skip
|
||||
DynamicJump_valueUnderflow.json Skip
|
||||
DynamicJumpi0.json Skip
|
||||
DynamicJumpi1.json Skip
|
||||
DynamicJumpi1_jumpdest.json Skip
|
||||
DynamicJumpiAfterStop.json Skip
|
||||
DynamicJumpiOutsideBoundary.json Skip
|
||||
DynamicJumpifInsidePushWithJumpDest.json Skip
|
||||
DynamicJumpifInsidePushWithoutJumpDest.json Skip
|
||||
JDfromStorageDynamicJump0_AfterJumpdest.json Skip
|
||||
JDfromStorageDynamicJump0_AfterJumpdest3.json Skip
|
||||
JDfromStorageDynamicJump0_foreverOutOfGas.json Skip
|
||||
JDfromStorageDynamicJump0_jumpdest0.json Skip
|
||||
JDfromStorageDynamicJump0_jumpdest2.json Skip
|
||||
JDfromStorageDynamicJump0_withoutJumpdest.json Skip
|
||||
JDfromStorageDynamicJump1.json Skip
|
||||
JDfromStorageDynamicJumpInsidePushWithJumpDest.json Skip
|
||||
JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json Skip
|
||||
JDfromStorageDynamicJumpi0.json Skip
|
||||
JDfromStorageDynamicJumpi1.json Skip
|
||||
JDfromStorageDynamicJumpi1_jumpdest.json Skip
|
||||
JDfromStorageDynamicJumpiAfterStop.json Skip
|
||||
JDfromStorageDynamicJumpiOutsideBoundary.json Skip
|
||||
JDfromStorageDynamicJumpifInsidePushWithJumpDest.json Skip
|
||||
JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json Skip
|
||||
bad_indirect_jump1.json Skip
|
||||
bad_indirect_jump2.json Skip
|
||||
byte1.json Skip
|
||||
+ BlockNumberDynamicJump0_AfterJumpdest.json OK
|
||||
+ BlockNumberDynamicJump0_AfterJumpdest3.json OK
|
||||
+ BlockNumberDynamicJump0_foreverOutOfGas.json OK
|
||||
- BlockNumberDynamicJump0_jumpdest0.json Fail
|
||||
- BlockNumberDynamicJump0_jumpdest2.json Fail
|
||||
+ BlockNumberDynamicJump0_withoutJumpdest.json OK
|
||||
+ BlockNumberDynamicJump1.json OK
|
||||
+ BlockNumberDynamicJumpInsidePushWithJumpDest.json OK
|
||||
+ BlockNumberDynamicJumpInsidePushWithoutJumpDest.json OK
|
||||
+ BlockNumberDynamicJumpi0.json OK
|
||||
+ BlockNumberDynamicJumpi1.json OK
|
||||
+ BlockNumberDynamicJumpi1_jumpdest.json OK
|
||||
- BlockNumberDynamicJumpiAfterStop.json Fail
|
||||
- BlockNumberDynamicJumpiOutsideBoundary.json Fail
|
||||
+ BlockNumberDynamicJumpifInsidePushWithJumpDest.json OK
|
||||
+ BlockNumberDynamicJumpifInsidePushWithoutJumpDest.json OK
|
||||
- DyanmicJump0_outOfBoundary.json Fail
|
||||
+ DynamicJump0_AfterJumpdest.json OK
|
||||
+ DynamicJump0_AfterJumpdest3.json OK
|
||||
+ DynamicJump0_foreverOutOfGas.json OK
|
||||
+ DynamicJump0_jumpdest0.json OK
|
||||
+ DynamicJump0_jumpdest2.json OK
|
||||
+ DynamicJump0_withoutJumpdest.json OK
|
||||
+ DynamicJump1.json OK
|
||||
- DynamicJumpAfterStop.json Fail
|
||||
+ DynamicJumpInsidePushWithJumpDest.json OK
|
||||
+ DynamicJumpInsidePushWithoutJumpDest.json OK
|
||||
+ DynamicJumpJD_DependsOnJumps0.json OK
|
||||
+ DynamicJumpJD_DependsOnJumps1.json OK
|
||||
- DynamicJumpPathologicalTest0.json Fail
|
||||
+ DynamicJumpPathologicalTest1.json OK
|
||||
+ DynamicJumpPathologicalTest2.json OK
|
||||
+ DynamicJumpPathologicalTest3.json OK
|
||||
+ DynamicJumpStartWithJumpDest.json OK
|
||||
+ DynamicJump_value1.json OK
|
||||
+ DynamicJump_value2.json OK
|
||||
+ DynamicJump_value3.json OK
|
||||
+ DynamicJump_valueUnderflow.json OK
|
||||
+ DynamicJumpi0.json OK
|
||||
+ DynamicJumpi1.json OK
|
||||
+ DynamicJumpi1_jumpdest.json OK
|
||||
- DynamicJumpiAfterStop.json Fail
|
||||
- DynamicJumpiOutsideBoundary.json Fail
|
||||
+ DynamicJumpifInsidePushWithJumpDest.json OK
|
||||
+ DynamicJumpifInsidePushWithoutJumpDest.json OK
|
||||
- JDfromStorageDynamicJump0_AfterJumpdest.json Fail
|
||||
- JDfromStorageDynamicJump0_AfterJumpdest3.json Fail
|
||||
- JDfromStorageDynamicJump0_foreverOutOfGas.json Fail
|
||||
- JDfromStorageDynamicJump0_jumpdest0.json Fail
|
||||
- JDfromStorageDynamicJump0_jumpdest2.json Fail
|
||||
- JDfromStorageDynamicJump0_withoutJumpdest.json Fail
|
||||
- JDfromStorageDynamicJump1.json Fail
|
||||
- JDfromStorageDynamicJumpInsidePushWithJumpDest.json Fail
|
||||
- JDfromStorageDynamicJumpInsidePushWithoutJumpDest.json Fail
|
||||
- JDfromStorageDynamicJumpi0.json Fail
|
||||
- JDfromStorageDynamicJumpi1.json Fail
|
||||
- JDfromStorageDynamicJumpi1_jumpdest.json Fail
|
||||
- JDfromStorageDynamicJumpiAfterStop.json Fail
|
||||
- JDfromStorageDynamicJumpiOutsideBoundary.json Fail
|
||||
- JDfromStorageDynamicJumpifInsidePushWithJumpDest.json Fail
|
||||
- JDfromStorageDynamicJumpifInsidePushWithoutJumpDest.json Fail
|
||||
+ bad_indirect_jump1.json OK
|
||||
+ bad_indirect_jump2.json OK
|
||||
+ byte1.json OK
|
||||
calldatacopyMemExp.json Skip
|
||||
codecopyMemExp.json Skip
|
||||
deadCode_1.json Skip
|
||||
dupAt51becameMload.json Skip
|
||||
extcodecopyMemExp.json Skip
|
||||
for_loop1.json Skip
|
||||
for_loop2.json Skip
|
||||
gas0.json Skip
|
||||
gas1.json Skip
|
||||
gasOverFlow.json Skip
|
||||
indirect_jump1.json Skip
|
||||
indirect_jump2.json Skip
|
||||
indirect_jump3.json Skip
|
||||
indirect_jump4.json Skip
|
||||
jump0_AfterJumpdest.json Skip
|
||||
jump0_AfterJumpdest3.json Skip
|
||||
jump0_foreverOutOfGas.json Skip
|
||||
jump0_jumpdest0.json Skip
|
||||
jump0_jumpdest2.json Skip
|
||||
jump0_outOfBoundary.json Skip
|
||||
jump0_withoutJumpdest.json Skip
|
||||
jump1.json Skip
|
||||
jumpAfterStop.json Skip
|
||||
jumpDynamicJumpSameDest.json Skip
|
||||
jumpHigh.json Skip
|
||||
jumpInsidePushWithJumpDest.json Skip
|
||||
jumpInsidePushWithoutJumpDest.json Skip
|
||||
jumpOntoJump.json Skip
|
||||
jumpTo1InstructionafterJump.json Skip
|
||||
jumpTo1InstructionafterJump_jumpdestFirstInstruction.json Skip
|
||||
jumpTo1InstructionafterJump_noJumpDest.json Skip
|
||||
jumpToUint64maxPlus1.json Skip
|
||||
jumpToUintmaxPlus1.json Skip
|
||||
jumpdestBigList.json Skip
|
||||
jumpi0.json Skip
|
||||
jumpi1.json Skip
|
||||
jumpi1_jumpdest.json Skip
|
||||
jumpiAfterStop.json Skip
|
||||
jumpiOutsideBoundary.json Skip
|
||||
jumpiToUint64maxPlus1.json Skip
|
||||
jumpiToUintmaxPlus1.json Skip
|
||||
jumpi_at_the_end.json Skip
|
||||
jumpifInsidePushWithJumpDest.json Skip
|
||||
jumpifInsidePushWithoutJumpDest.json Skip
|
||||
kv1.json Skip
|
||||
log1MemExp.json Skip
|
||||
loop_stacklimit_1020.json Skip
|
||||
loop_stacklimit_1021.json Skip
|
||||
memory1.json Skip
|
||||
mloadError0.json Skip
|
||||
mloadError1.json Skip
|
||||
mloadMemExp.json Skip
|
||||
mloadOutOfGasError2.json Skip
|
||||
msize0.json Skip
|
||||
msize1.json Skip
|
||||
msize2.json Skip
|
||||
msize3.json Skip
|
||||
mstore0.json Skip
|
||||
mstore1.json Skip
|
||||
mstore8MemExp.json Skip
|
||||
mstore8WordToBigError.json Skip
|
||||
mstore8_0.json Skip
|
||||
mstore8_1.json Skip
|
||||
mstoreMemExp.json Skip
|
||||
mstoreWordToBigError.json Skip
|
||||
mstore_mload0.json Skip
|
||||
pc0.json Skip
|
||||
pc1.json Skip
|
||||
pop0.json Skip
|
||||
pop1.json Skip
|
||||
return1.json Skip
|
||||
return2.json Skip
|
||||
sha3MemExp.json Skip
|
||||
sstore_load_0.json Skip
|
||||
sstore_load_1.json Skip
|
||||
sstore_load_2.json Skip
|
||||
sstore_underflow.json Skip
|
||||
stack_loop.json Skip
|
||||
stackjump1.json Skip
|
||||
swapAt52becameMstore.json Skip
|
||||
when.json Skip
|
||||
- codecopyMemExp.json Fail
|
||||
- deadCode_1.json Fail
|
||||
+ dupAt51becameMload.json OK
|
||||
- extcodecopyMemExp.json Fail
|
||||
- for_loop1.json Fail
|
||||
- for_loop2.json Fail
|
||||
+ gas0.json OK
|
||||
+ gas1.json OK
|
||||
+ gasOverFlow.json OK
|
||||
+ indirect_jump1.json OK
|
||||
+ indirect_jump2.json OK
|
||||
+ indirect_jump3.json OK
|
||||
+ indirect_jump4.json OK
|
||||
+ jump0_AfterJumpdest.json OK
|
||||
+ jump0_AfterJumpdest3.json OK
|
||||
+ jump0_foreverOutOfGas.json OK
|
||||
+ jump0_jumpdest0.json OK
|
||||
+ jump0_jumpdest2.json OK
|
||||
+ jump0_outOfBoundary.json OK
|
||||
+ jump0_withoutJumpdest.json OK
|
||||
+ jump1.json OK
|
||||
- jumpAfterStop.json Fail
|
||||
+ jumpDynamicJumpSameDest.json OK
|
||||
+ jumpHigh.json OK
|
||||
+ jumpInsidePushWithJumpDest.json OK
|
||||
+ jumpInsidePushWithoutJumpDest.json OK
|
||||
+ jumpOntoJump.json OK
|
||||
- jumpTo1InstructionafterJump.json Fail
|
||||
+ jumpTo1InstructionafterJump_jumpdestFirstInstruction.json OK
|
||||
+ jumpTo1InstructionafterJump_noJumpDest.json OK
|
||||
- jumpToUint64maxPlus1.json Fail
|
||||
+ jumpToUintmaxPlus1.json OK
|
||||
+ jumpdestBigList.json OK
|
||||
+ jumpi0.json OK
|
||||
+ jumpi1.json OK
|
||||
+ jumpi1_jumpdest.json OK
|
||||
- jumpiAfterStop.json Fail
|
||||
- jumpiOutsideBoundary.json Fail
|
||||
- jumpiToUint64maxPlus1.json Fail
|
||||
+ jumpiToUintmaxPlus1.json OK
|
||||
+ jumpi_at_the_end.json OK
|
||||
+ jumpifInsidePushWithJumpDest.json OK
|
||||
+ jumpifInsidePushWithoutJumpDest.json OK
|
||||
- kv1.json Fail
|
||||
+ log1MemExp.json OK
|
||||
+ loop_stacklimit_1020.json OK
|
||||
+ loop_stacklimit_1021.json OK
|
||||
- memory1.json Fail
|
||||
+ mloadError0.json OK
|
||||
- mloadError1.json Fail
|
||||
+ mloadMemExp.json OK
|
||||
+ mloadOutOfGasError2.json OK
|
||||
+ msize0.json OK
|
||||
+ msize1.json OK
|
||||
+ msize2.json OK
|
||||
+ msize3.json OK
|
||||
+ mstore0.json OK
|
||||
+ mstore1.json OK
|
||||
+ mstore8MemExp.json OK
|
||||
+ mstore8WordToBigError.json OK
|
||||
+ mstore8_0.json OK
|
||||
+ mstore8_1.json OK
|
||||
+ mstoreMemExp.json OK
|
||||
+ mstoreWordToBigError.json OK
|
||||
+ mstore_mload0.json OK
|
||||
+ pc0.json OK
|
||||
+ pc1.json OK
|
||||
+ pop0.json OK
|
||||
+ pop1.json OK
|
||||
+ return1.json OK
|
||||
- return2.json Fail
|
||||
+ sha3MemExp.json OK
|
||||
+ sstore_load_0.json OK
|
||||
+ sstore_load_1.json OK
|
||||
- sstore_load_2.json Fail
|
||||
+ sstore_underflow.json OK
|
||||
+ stack_loop.json OK
|
||||
+ stackjump1.json OK
|
||||
+ swapAt52becameMstore.json OK
|
||||
+ when.json OK
|
||||
```
|
||||
OK: 0/145 Fail: 0/145 Skip: 145/145
|
||||
OK: 103/145 Fail: 41/145 Skip: 1/145
|
||||
## vmLogTest
|
||||
```diff
|
||||
log0_emptyMem.json Skip
|
||||
log0_logMemStartTooHigh.json Skip
|
||||
log0_logMemsizeTooHigh.json Skip
|
||||
log0_logMemsizeZero.json Skip
|
||||
log0_nonEmptyMem.json Skip
|
||||
log0_nonEmptyMem_logMemSize1.json Skip
|
||||
log0_nonEmptyMem_logMemSize1_logMemStart31.json Skip
|
||||
log1_Caller.json Skip
|
||||
log1_MaxTopic.json Skip
|
||||
log1_emptyMem.json Skip
|
||||
log1_logMemStartTooHigh.json Skip
|
||||
log1_logMemsizeTooHigh.json Skip
|
||||
log1_logMemsizeZero.json Skip
|
||||
log1_nonEmptyMem.json Skip
|
||||
log1_nonEmptyMem_logMemSize1.json Skip
|
||||
log1_nonEmptyMem_logMemSize1_logMemStart31.json Skip
|
||||
log2_Caller.json Skip
|
||||
log2_MaxTopic.json Skip
|
||||
log2_emptyMem.json Skip
|
||||
log2_logMemStartTooHigh.json Skip
|
||||
log2_logMemsizeTooHigh.json Skip
|
||||
log2_logMemsizeZero.json Skip
|
||||
log2_nonEmptyMem.json Skip
|
||||
log2_nonEmptyMem_logMemSize1.json Skip
|
||||
log2_nonEmptyMem_logMemSize1_logMemStart31.json Skip
|
||||
log3_Caller.json Skip
|
||||
log3_MaxTopic.json Skip
|
||||
log3_PC.json Skip
|
||||
log3_emptyMem.json Skip
|
||||
log3_logMemStartTooHigh.json Skip
|
||||
log3_logMemsizeTooHigh.json Skip
|
||||
log3_logMemsizeZero.json Skip
|
||||
log3_nonEmptyMem.json Skip
|
||||
log3_nonEmptyMem_logMemSize1.json Skip
|
||||
log3_nonEmptyMem_logMemSize1_logMemStart31.json Skip
|
||||
log4_Caller.json Skip
|
||||
log4_MaxTopic.json Skip
|
||||
log4_PC.json Skip
|
||||
log4_emptyMem.json Skip
|
||||
log4_logMemStartTooHigh.json Skip
|
||||
log4_logMemsizeTooHigh.json Skip
|
||||
log4_logMemsizeZero.json Skip
|
||||
log4_nonEmptyMem.json Skip
|
||||
log4_nonEmptyMem_logMemSize1.json Skip
|
||||
log4_nonEmptyMem_logMemSize1_logMemStart31.json Skip
|
||||
log_2logs.json Skip
|
||||
+ log0_emptyMem.json OK
|
||||
- log0_logMemStartTooHigh.json Fail
|
||||
- log0_logMemsizeTooHigh.json Fail
|
||||
+ log0_logMemsizeZero.json OK
|
||||
+ log0_nonEmptyMem.json OK
|
||||
+ log0_nonEmptyMem_logMemSize1.json OK
|
||||
+ log0_nonEmptyMem_logMemSize1_logMemStart31.json OK
|
||||
+ log1_Caller.json OK
|
||||
+ log1_MaxTopic.json OK
|
||||
+ log1_emptyMem.json OK
|
||||
- log1_logMemStartTooHigh.json Fail
|
||||
- log1_logMemsizeTooHigh.json Fail
|
||||
+ log1_logMemsizeZero.json OK
|
||||
+ log1_nonEmptyMem.json OK
|
||||
+ log1_nonEmptyMem_logMemSize1.json OK
|
||||
+ log1_nonEmptyMem_logMemSize1_logMemStart31.json OK
|
||||
+ log2_Caller.json OK
|
||||
+ log2_MaxTopic.json OK
|
||||
+ log2_emptyMem.json OK
|
||||
- log2_logMemStartTooHigh.json Fail
|
||||
- log2_logMemsizeTooHigh.json Fail
|
||||
+ log2_logMemsizeZero.json OK
|
||||
+ log2_nonEmptyMem.json OK
|
||||
+ log2_nonEmptyMem_logMemSize1.json OK
|
||||
+ log2_nonEmptyMem_logMemSize1_logMemStart31.json OK
|
||||
+ log3_Caller.json OK
|
||||
+ log3_MaxTopic.json OK
|
||||
+ log3_PC.json OK
|
||||
+ log3_emptyMem.json OK
|
||||
- log3_logMemStartTooHigh.json Fail
|
||||
- log3_logMemsizeTooHigh.json Fail
|
||||
+ log3_logMemsizeZero.json OK
|
||||
+ log3_nonEmptyMem.json OK
|
||||
+ log3_nonEmptyMem_logMemSize1.json OK
|
||||
+ log3_nonEmptyMem_logMemSize1_logMemStart31.json OK
|
||||
+ log4_Caller.json OK
|
||||
+ log4_MaxTopic.json OK
|
||||
+ log4_PC.json OK
|
||||
+ log4_emptyMem.json OK
|
||||
- log4_logMemStartTooHigh.json Fail
|
||||
- log4_logMemsizeTooHigh.json Fail
|
||||
+ log4_logMemsizeZero.json OK
|
||||
+ log4_nonEmptyMem.json OK
|
||||
+ log4_nonEmptyMem_logMemSize1.json OK
|
||||
+ log4_nonEmptyMem_logMemSize1_logMemStart31.json OK
|
||||
+ log_2logs.json OK
|
||||
```
|
||||
OK: 0/46 Fail: 0/46 Skip: 46/46
|
||||
OK: 36/46 Fail: 10/46 Skip: 0/46
|
||||
## vmPerformance
|
||||
```diff
|
||||
ackermann31.json Skip
|
||||
@ -657,26 +657,26 @@ OK: 74/74 Fail: 0/74 Skip: 0/74
|
||||
OK: 0/17 Fail: 0/17 Skip: 17/17
|
||||
## vmSha3Test
|
||||
```diff
|
||||
sha3_0.json Skip
|
||||
sha3_1.json Skip
|
||||
sha3_2.json Skip
|
||||
sha3_3.json Skip
|
||||
sha3_4.json Skip
|
||||
sha3_5.json Skip
|
||||
sha3_6.json Skip
|
||||
sha3_bigOffset.json Skip
|
||||
sha3_bigOffset2.json Skip
|
||||
sha3_bigSize.json Skip
|
||||
sha3_memSizeNoQuadraticCost31.json Skip
|
||||
sha3_memSizeQuadraticCost32.json Skip
|
||||
sha3_memSizeQuadraticCost32_zeroSize.json Skip
|
||||
sha3_memSizeQuadraticCost33.json Skip
|
||||
sha3_memSizeQuadraticCost63.json Skip
|
||||
sha3_memSizeQuadraticCost64.json Skip
|
||||
sha3_memSizeQuadraticCost64_2.json Skip
|
||||
sha3_memSizeQuadraticCost65.json Skip
|
||||
+ sha3_0.json OK
|
||||
+ sha3_1.json OK
|
||||
+ sha3_2.json OK
|
||||
+ sha3_3.json OK
|
||||
+ sha3_4.json OK
|
||||
+ sha3_5.json OK
|
||||
- sha3_6.json Fail
|
||||
- sha3_bigOffset.json Fail
|
||||
+ sha3_bigOffset2.json OK
|
||||
- sha3_bigSize.json Fail
|
||||
+ sha3_memSizeNoQuadraticCost31.json OK
|
||||
+ sha3_memSizeQuadraticCost32.json OK
|
||||
- sha3_memSizeQuadraticCost32_zeroSize.json Fail
|
||||
+ sha3_memSizeQuadraticCost33.json OK
|
||||
+ sha3_memSizeQuadraticCost63.json OK
|
||||
+ sha3_memSizeQuadraticCost64.json OK
|
||||
+ sha3_memSizeQuadraticCost64_2.json OK
|
||||
+ sha3_memSizeQuadraticCost65.json OK
|
||||
```
|
||||
OK: 0/18 Fail: 0/18 Skip: 18/18
|
||||
OK: 14/18 Fail: 4/18 Skip: 0/18
|
||||
## vmSystemOperations
|
||||
```diff
|
||||
ABAcalls0.json Skip
|
||||
@ -719,9 +719,9 @@ OK: 0/18 Fail: 0/18 Skip: 18/18
|
||||
OK: 0/36 Fail: 0/36 Skip: 36/36
|
||||
## vmTests
|
||||
```diff
|
||||
arith.json Skip
|
||||
+ arith.json OK
|
||||
+ boolean.json OK
|
||||
+ mktx.json OK
|
||||
+ suicide.json OK
|
||||
```
|
||||
OK: 3/4 Fail: 0/4 Skip: 1/4
|
||||
OK: 4/4 Fail: 0/4 Skip: 0/4
|
||||
|
@ -55,7 +55,7 @@ macro logXX(topicCount: static[int]): untyped =
|
||||
let OpName = ident(&"Log{topicCount}")
|
||||
let logicCode = quote:
|
||||
`computation`.gasMeter.consumeGas(
|
||||
`computation`.gasCosts[`OpName`].m_handler(`computation`.memory.len, `memPos` + `len`),
|
||||
`computation`.gasCosts[`OpName`].m_handler(`computation`.memory.len, `memPos`, `len`),
|
||||
reason="Memory expansion, Log topic and data gas cost")
|
||||
`computation`.memory.extend(`memPos`, `len`)
|
||||
let logData = `computation`.memory.read(`memPos`, `len`).toString
|
||||
|
@ -24,7 +24,7 @@ proc mstore*(computation) =
|
||||
let normalizedValue = stack.popInt().toByteArrayBE
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[MStore].m_handler(computation.memory.len, start + 32),
|
||||
computation.gasCosts[MStore].m_handler(computation.memory.len, start, 32),
|
||||
reason="MSTORE: GasVeryLow + memory expansion"
|
||||
)
|
||||
|
||||
@ -37,7 +37,7 @@ proc mstore8*(computation) =
|
||||
let normalizedValue = (value and 0xff).toByteArrayBE
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[MStore8].m_handler(computation.memory.len, start + 1),
|
||||
computation.gasCosts[MStore8].m_handler(computation.memory.len, start, 1),
|
||||
reason="MSTORE8: GasVeryLow + memory expansion"
|
||||
)
|
||||
|
||||
@ -48,7 +48,7 @@ proc mload*(computation) =
|
||||
let start = stack.popInt().toInt
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[MLoad].m_handler(computation.memory.len, start + 32),
|
||||
computation.gasCosts[MLoad].m_handler(computation.memory.len, start, 32),
|
||||
reason="MLOAD: GasVeryLow + memory expansion"
|
||||
)
|
||||
|
||||
|
@ -16,7 +16,7 @@ proc sha3op*(computation: var BaseComputation) =
|
||||
let (pos, len) = (startPosition.toInt, size.toInt)
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[Sha3].m_handler(computation.memory.len, pos + len),
|
||||
computation.gasCosts[Sha3].m_handler(computation.memory.len, pos, len),
|
||||
reason="SHA3: word gas cost"
|
||||
)
|
||||
|
||||
|
@ -149,7 +149,7 @@ proc returnOp*(computation) =
|
||||
let (pos, len) = (startPosition.toInt, size.toInt)
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[Return].m_handler(computation.memory.len, pos + len),
|
||||
computation.gasCosts[Return].m_handler(computation.memory.len, pos, len),
|
||||
reason = "RETURN"
|
||||
)
|
||||
|
||||
@ -163,7 +163,7 @@ proc revert*(computation) =
|
||||
let (pos, len) = (startPosition.toInt, size.toInt)
|
||||
|
||||
computation.gasMeter.consumeGas(
|
||||
computation.gasCosts[Op.Revert].m_handler(computation.memory.len, pos + len),
|
||||
computation.gasCosts[Op.Revert].m_handler(computation.memory.len, pos, len),
|
||||
reason = "REVERT"
|
||||
)
|
||||
|
||||
|
@ -70,8 +70,9 @@ type
|
||||
c_isNewAccount*: bool
|
||||
c_gasBalance*: GasInt
|
||||
c_contractGas*: Gasint
|
||||
c_activeMemSize*: Natural
|
||||
c_memRequested*: Natural
|
||||
c_currentMemSize*: Natural
|
||||
c_memOffset*: Natural
|
||||
c_memLength*: Natural
|
||||
else:
|
||||
discard
|
||||
|
||||
@ -93,7 +94,7 @@ type
|
||||
of GckDynamic:
|
||||
d_handler*: proc(value: Uint256): GasInt {.nimcall.}
|
||||
of GckMemExpansion:
|
||||
m_handler*: proc(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.}
|
||||
m_handler*: proc(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.}
|
||||
of GckComplex:
|
||||
c_handler*: proc(value: Uint256, gasParams: GasParams): GasResult {.nimcall.}
|
||||
# We use gasCost/gasRefund for:
|
||||
@ -110,7 +111,7 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
|
||||
# ############### Helper functions ##############################
|
||||
|
||||
func `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize: Natural): GasInt {.inline.} =
|
||||
func `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength: Natural): GasInt {.inline.} =
|
||||
# Input: size (in bytes)
|
||||
|
||||
# Yellow Paper:
|
||||
@ -121,11 +122,11 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
|
||||
# Cmem(a) ≡ Gmemory · a + a² / 512
|
||||
let
|
||||
prev_words = activeMemSize.wordCount
|
||||
prev_words = currentMemSize.wordCount
|
||||
prev_cost = prev_words * static(FeeSchedule[GasMemory]) +
|
||||
(prev_words ^ 2) shr 9 # div 512
|
||||
|
||||
new_words = requestedMemSize.wordCount
|
||||
new_words = (memOffset + memLength).wordCount
|
||||
new_cost = new_words * static(FeeSchedule[GasMemory]) +
|
||||
(new_words ^ 2) shr 9 # div 512
|
||||
|
||||
@ -152,11 +153,11 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
if not value.isZero:
|
||||
result += static(FeeSchedule[GasExpByte]) * (1 + log256(value))
|
||||
|
||||
func `prefix gasSha3`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
func `prefix gasSha3`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
result += static(FeeSchedule[GasSha3]) +
|
||||
static(FeeSchedule[GasSha3Word]) * requestedMemSize.wordCount
|
||||
static(FeeSchedule[GasSha3Word]) * (memLength).wordCount
|
||||
|
||||
func `prefix gasCopy`(value: Uint256): GasInt {.nimcall.} =
|
||||
## Value is the size of the input to the CallDataCopy/CodeCopy/ReturnDataCopy function
|
||||
@ -170,9 +171,9 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
result = static(FeeSchedule[GasVeryLow]) +
|
||||
static(FeeSchedule[GasCopy]) * value.toInt.wordCount
|
||||
|
||||
func `prefix gasLoadStore`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
func `prefix gasLoadStore`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = static(FeeSchedule[GasVeryLow])
|
||||
result += `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
result += `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
func `prefix gasSstore`(value: Uint256, gasParams: Gasparams): GasResult {.nimcall.} =
|
||||
## Value is word to save
|
||||
@ -192,38 +193,38 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
if value.isZero and not gasParams.s_isStorageEmpty:
|
||||
result.gasRefund = static(FeeSchedule[RefundSclear])
|
||||
|
||||
func `prefix gasLog0`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasLog0`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
result += static(FeeSchedule[GasLog]) +
|
||||
static(FeeSchedule[GasLogData]) * (requestedMemSize - activeMemSize)
|
||||
static(FeeSchedule[GasLogData]) * memLength
|
||||
|
||||
func `prefix gasLog1`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasLog1`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
result += static(FeeSchedule[GasLog]) +
|
||||
static(FeeSchedule[GasLogData]) * (requestedMemSize - activeMemSize) +
|
||||
static(FeeSchedule[GasLogData]) * memLength +
|
||||
static(FeeSchedule[GasLogTopic])
|
||||
|
||||
func `prefix gasLog2`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasLog2`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
result += static(FeeSchedule[GasLog]) +
|
||||
static(FeeSchedule[GasLogData]) * (requestedMemSize - activeMemSize) +
|
||||
static(FeeSchedule[GasLogData]) * memLength +
|
||||
static(2 * FeeSchedule[GasLogTopic])
|
||||
|
||||
func `prefix gasLog3`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasLog3`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
result = static(FeeSchedule[GasLog]) +
|
||||
static(FeeSchedule[GasLogData]) * (requestedMemSize - activeMemSize) +
|
||||
static(FeeSchedule[GasLogData]) * memLength +
|
||||
static(3 * FeeSchedule[GasLogTopic])
|
||||
|
||||
func `prefix gasLog4`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasLog4`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
result = `prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
result = static(FeeSchedule[GasLog]) +
|
||||
static(FeeSchedule[GasLogData]) * (requestedMemSize - activeMemSize) +
|
||||
static(FeeSchedule[GasLogData]) * memLength +
|
||||
static(4 * FeeSchedule[GasLogTopic])
|
||||
|
||||
func `prefix gasCall`(value: Uint256, gasParams: Gasparams): GasResult {.nimcall.} =
|
||||
@ -268,8 +269,9 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
# https://github.com/ethereum/go-ethereum/blob/13af27641829f61d1e6b383e37aab6caae22f2c1/core/vm/gas_table.go#L334
|
||||
# ⚠⚠ Py-EVM seems wrong if memory is needed for both in and out.
|
||||
result.gasCost = `prefix gasMemoryExpansion`(
|
||||
gasParams.c_activeMemSize,
|
||||
gasParams.c_memRequested
|
||||
gasParams.c_currentMemSize,
|
||||
gasParams.c_memOffset,
|
||||
gasParams.c_memLength
|
||||
)
|
||||
|
||||
# Cnew_account - TODO - pre-EIP158 zero-value call consumed 25000 gas
|
||||
@ -302,8 +304,8 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
# Ccall
|
||||
result.gasCost += cextra
|
||||
|
||||
func `prefix gasHalt`(activeMemSize, requestedMemSize: Natural): GasInt {.nimcall.} =
|
||||
`prefix gasMemoryExpansion`(activeMemSize, requestedMemSize)
|
||||
func `prefix gasHalt`(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.} =
|
||||
`prefix gasMemoryExpansion`(currentMemSize, memOffset, memLength)
|
||||
|
||||
func `prefix gasSelfDestruct`(value: Uint256, gasParams: Gasparams): GasResult {.nimcall.} =
|
||||
# TODO
|
||||
@ -323,7 +325,7 @@ template gasCosts(FeeSchedule: GasFeeSchedule, prefix, ResultGasCostsName: untyp
|
||||
func dynamic(handler: proc(value: Uint256): GasInt {.nimcall.}): GasCost =
|
||||
GasCost(kind: GckDynamic, d_handler: handler)
|
||||
|
||||
func memExpansion(handler: proc(activeMemSize, memExpansion: Natural): GasInt {.nimcall.}): GasCost =
|
||||
func memExpansion(handler: proc(currentMemSize, memOffset, memLength: Natural): GasInt {.nimcall.}): GasCost =
|
||||
GasCost(kind: GckMemExpansion, m_handler: handler)
|
||||
|
||||
func complex(handler: proc(value: Uint256, gasParams: GasParams): GasResult {.nimcall.}): GasCost =
|
||||
|
@ -22,8 +22,7 @@ proc validTest*(folder: string, name: string): bool =
|
||||
result = "calldatacopy" notin name and
|
||||
"balanceAddressInputTooBigRightMyAddress." notin name and
|
||||
"callstatelessToReturn1" notin name and
|
||||
"arith" notin name and
|
||||
folder notin @["vmRandomTest", "vmSystemOperations", "vmPerformance", "vmEnvironmentalInfo", "vmLogTest", "vmSha3Test", "vmIOandFlowOperations"]
|
||||
folder notin @["vmRandomTest", "vmSystemOperations", "vmPerformance", "vmEnvironmentalInfo"]
|
||||
#result = name == "exp2.json"
|
||||
|
||||
macro jsonTest*(s: static[string], handler: untyped): untyped =
|
||||
|
Loading…
x
Reference in New Issue
Block a user