mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-25 03:28:57 +00: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
Nimbus: an Ethereum 2.0 Sharding Client for Resource-Restricted Devices
Join the Status community chats:
Rationale
Nimbus: an Ethereum 2.0 Sharding Client
Building & Testing
Prerequisites
Please install a recent version of Facebook's RocksDB following the instructions here:
https://github.com/facebook/rocksdb/blob/master/INSTALL.md
Currently Nimbus requires the latest development version of the Nim programming language. Follow the installation steps or use choosenim.
Obtaining the prerequisites through the Nix package manager
Users of the Nix package manager can install all prerequisites simply by running:
nix-shell nimbus.nix
Build
You can build the package and run the tests using nimble test
. You can run the example using nim compile --run examples/decompile_smart_contract.nim
.
License
Licensed under one of the following:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license: LICENSE-MIT or http://opensource.org/licenses/MIT
Description
Nimbus: an Ethereum Execution Client for Resource-Restricted Devices
https://status-im.github.io/nimbus-eth1/
Languages
Nim
97.8%
Shell
0.7%
Makefile
0.5%
CodeQL
0.4%
Nix
0.2%
Other
0.3%