Commit Graph

1557 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy 05275f9773
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
2018-06-13 19:33:47 +02:00
mratsim 8d76cab46a Was confused about ∧ in the Yellow paper. Fix #50 - pass 2 new tests. Only 1 arithmetic failure left. 2018-06-13 16:05:52 +02:00
Mamy Ratsimbazafy 90c3ca4a96
Gas refactoring - decouple opcode logic and gas (#49)
* Decoupling op logic and gas - introduce gasometer, rework opcode declaration

* Remove gas constants for gas opcode computation

* Remove gas constants for precompiled contracts

* make vm_types compile

* Make opcode, call and computation compile

* Distinguish between dynamic and complex gas costs, fix arithmetic

* Fix context and sha3

* update memory and storage ops

* Log opcode uses memory expansion code

* update/stub system_ops with gas costs

* Make test compile. Deactivate stub test_vm

* all tests compiles, opcode fails due to https://github.com/nim-lang/Nim/issues/8007 (const object variant in tables reset at runtime)

* Create an enum without holes - workaround: https://github.com/nim-lang/Nim/issues/8007

* Use arrays instead of tables for GasCosts, remove some unused imports - passing all basic tests!

* Make test_vm_json compile

* Fix test_vm_json - workaround https://github.com/nim-lang/Nim/issues/8015

* fix memory expansion cost bug

* Remove leftover special handling from before GckMemExpansion

* cleanup outdated comment, better align =

* Fix sha3 gas cost not taking memory expansion into account

* Improve gas error reporting of test_vm_json

* Fix gas computation regression due to mem expansion

* mass replace for memExpansion->RequestedMemSize was too eager

* fix log gas cost (no tests :/)

* missed a static FeeSchedule

* static as expression is fickle
2018-06-12 17:33:47 +02:00
Mamy Ratsimbazafy 8528f1b704
Dirty fix #46 (test_vm_json segfaults from #45), incidentally fix #32 (#47) 2018-06-06 20:40:44 +02:00
Yuriy Glukhov d8a4e5cbfb Fixed compilation of test_vm_json. Still fails because of Op.Call :( 2018-05-31 10:58:59 +03:00
Yuriy Glukhov 8bdf09683b Hash256/EthAddrres refactoring 2018-05-30 19:11:15 +03:00
Yuriy Glukhov 51b572d8b8 Some renames 2018-05-28 13:22:28 +03:00