Skip to content

evertonfraga/evm-lua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVM Lua

Image description

Here's the crazy idea: make Redis able to interpret EVM opcodes, so it can respond to eth_call with minimal SLOAD latency. This is accomplished by creating an EVM interpreter, written in Lua, and embedding it as Redis Functions.

Installation

  1. Install Lua, the scripting language. brew install lua on Mac.
  2. Install luarocks, a package manager for Lua: brew install luarocks
  3. Install Redis and run redis-server to start the db.
  4. Run ./load.sh to load evm.lua script into Redis, with some test data.

To-dos:

  • Create and deploy Lua functions that interprets EVM bytecode

  • Feed account storage based on initial list and block number

  • Implement benchmark script using Flood.

  • Main opcodes to implement:

  • push16-push32

  • sha3

Install redis-cli on amazon linux 2

sudo yum install wget -y
sudo yum install tcl -y
sudo yum install gcc -y
sudo yum install centos-release-scl -y
sudo yum install devtoolset-9-gcc devtooset-g-gcc-c++ devtoolset-9-binutils -y
sudo yum install openssl-devel* -y

Reference links

Use Redis triggers to do garbage collection: https://redis.io/docs/interact/programmability/triggers-and-functions/examples/

EVM.init should support:

  • new attributes: calldata and depth, starting at 0/1 for each new CALL opcode-type, instantiate a new EVM.init, passing arguments.
  • RETURN should return data from memory, kill the execution context branch. decrement depth. If depth == top depth, return function to external

About

EVM bytecode interpreter written in Lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published