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.
- Install Lua, the scripting language.
brew install lua
on Mac. - Install luarocks, a package manager for Lua:
brew install luarocks
- Install Redis and run
redis-server
to start the db. - Run
./load.sh
to loadevm.lua
script into Redis, with some test data.
-
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
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
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