Commit Graph

23 Commits

Author SHA1 Message Date
coffeepots 1cead76327 Add note about cyclic dep 2018-11-08 16:40:40 +00:00
coffeepots 434edcc2ae Fix incorrect message parameters (had sender and destination swapped) 2018-10-18 17:47:54 +01:00
coffeepots 36270ff4d5 Fixes for Call gas usage, Calls use precompiles, pass down their opCode 2018-10-02 16:07:16 +01:00
Yuriy Glukhov 0adfaf0f31 s/increaseBalance/addBalance 2018-09-19 18:41:17 +03:00
Dustin Brody dd20f4079c revert better toSeq version to worse for-loop version of extracting keys from table because former now fails to compile 2018-09-18 07:07:04 -07:00
Dustin Brody 7dfd2a3849 update deltabalance to mix of setBalance and increaseBalance 2018-09-18 06:25:28 -07:00
coffeepots 4f03c9cf2a
Merge pull request #139 from status-im/callOpCodeWork
Flesh out call op
2018-09-18 14:09:00 +01:00
coffeepots d435e434ec Copy opCodeExec to child computation 2018-09-18 13:03:22 +01:00
Zahary Karadjov d71ce6fb24 Make use of the new transactional API offered by the Trie DB 2018-09-18 02:56:10 +03:00
coffeepots d484420f5b Remove fork distinguished procs, handle in applyCreateMessage 2018-09-17 19:35:07 +01:00
Dustin Brody beb1befc6e 13 additional GeneralStateTests working; remove commented auto-ported Py-EVM validations which are implicit in UInt256; address comments to last commit (toSeq, hoising vmState.readOnlyStateDB, deltaBalance -> increaseBalance) 2018-09-17 13:41:32 +00:00
coffeepots 63f9acd8ce Add create and apply message procs 2018-09-14 18:03:26 +01:00
coffeepots 6183761251 Refactor for generateChildComputation 2018-09-14 16:16:55 +01:00
coffeepots 69f07c587a Add generateChildComputation, addChildComputation and applyChildComputation 2018-09-14 16:16:55 +01:00
Dustin Brody 7ba90fda54
48 new working GeneralStateTests, via fixing some overflows/underflows, creating a rudimentary balance commit/revert scheme, and implementing account deletion for the selfdestruct instruction (#146) 2018-09-14 13:43:40 +00:00
Yuriy Glukhov 3a1ec035b3 Various fixes towards state reconstruction 2018-09-07 14:00:37 +03:00
Jacek Sieka db202dc35f
replace logging module with nim-chronicles (fixes #38)
This blindly changes logging to nim-chronicles - issues that ensue:

* keeps gas cost computation logs hidden behind flag
* unclear if logScope is practical - for example, since vm is split over
many files, topics get lost when using simple top-level per-module
topics
* when passing named object around, scope should incliude the name of
the object but this is caught neither by logScope nor by dynamicLogScope
2018-08-29 16:13:03 -06:00
coffeepots e33bc85bfa Remove validateCanonicalAddress 2018-07-19 19:04:01 +01:00
Yuriy Glukhov b2acf3a5e3 GasMeter is an object now (#73) 2018-07-18 14:18:17 +02:00
Mamy Ratsimbazafy 4dd75aee84
Delete utilities: address, padding, bytes (#68)
* Delete utilities: address, padding, bytes

* Remove bigEndianToInt

* Fix C compiler error: member reference base type 'char' is not a structure or union

* fix todo comment
2018-07-06 17:08:31 +02:00
Mamy Ratsimbazafy 4b5eada322
Refactor interpreter dispatch (#65)
* move forks constants, rename errors

* Move vm/utils to vm/interpreter/utils

* initial opcodes refactoring

* Add refactored Comparison & Bitwise Logic Operations

* Add sha3 and address, simplify macro, support pop 0

* balance, origin, caller, callValue

* fix gas copy opcodes gas costs, add callDataLoad/Size/Copy, CodeSize/Copy and gas price opcode

* Update with 30s, 40s, 50s opcodes + impl of balance + stack improvement

* add push, dup, swap, log, create and call operations

* finish opcode implementation

* Add the new dispatching logic

* Pass the opcode test

* Make test_vm_json compile

* halt execution without exceptions for Return, Revert, selfdestruct (fix #62)

* Properly catch and recover from EVM exceptions (stack underflow ...)

* Fix byte op

* Fix jump regressions

* Update for latest devel, don't import old dispatch code as quasiBoolean macro is broken by latest devel

* Fix sha3 regression on empty memory slice and until end of range slice

* Fix padding / range error on expXY_success (gas computation left)

* update logging procs

* Add tracing - expXY_success is not a regression, sload stub was accidentally passing the test

* Reuse the same stub as OO implementation

* Delete previous opcode implementation

* Delete object oriented fork code

* Delete exceptions that were used as control flows

* delete base.nim 🔥, yet another OO remnants

* Delete opcode table

* Enable omputed gotos and compile-time gas fees

* Revert const gasCosts -> generates SIGSEGV

* inline push, swap and dup opcodes

* loggers are now template again, why does this pass new tests?

* Trigger CI rebuild after rocksdb fix https://github.com/status-im/nim-rocksdb/pull/5

* Address review comment on "push" + VMTests in debug mode (not release)

* Address review comment: don't tag fork by default, make opcode impl grepable

* Static compilation fixes after rebasing

* fix the initialization of the VM database

* add a missing import

* Deactivate balance and sload test following #59

* Reactivate stack check (deactivated in #59, necessary to pass tests)

* Merge remaining opcodes implementation from #59

* Merge callDataLoad and codeCopy fixes, todo simplify see #67
2018-07-06 09:52:31 +02:00
zah 18b7bbb3b0 Implemented most of the stubbed-out state handling instructions (#59)
Merge note: currently cannot compile due to `quasiBoolean` (#63). This will be solved by https://github.com/status-im/nimbus/pull/65
----

* Implemented most of the stubbed out state handling instructions

The code compiles, but still fails at the moment due to incorrect

initialization of the VM. Don't merge yet. More commits will be
pushed in the coming days.

* Fixed crash

* trie put and del are void now

* getBlockTransactionData and getReceipts

* Working code for extcodesize0.json

* fix origin.json

* fix calldatasize1

* fix calldataloadSizeTooHighPartial

* fix calldataloadSizeTooHigh

* more efficient PushX implementation

* fix and, or, xor
2018-07-05 14:41:01 +02:00
Mamy Ratsimbazafy c26c751f9b
Reorganize VM/interpreter + cleanup (#52)
* Move and cleanup interpreter files - prepare for redesign of VM

* fix call comment aobut recursive dependencies

* memory: use a template again and avoid (?) a cstring-> string conversion

* Fix stack test regression

* Fix recursive dependency on logging_ops, test_vm_json compiles but regression :/

* Fix signextend regression

* Fix 3 signed test and sha3 test
2018-06-15 11:11:25 +02:00