Code Monkey home page Code Monkey logo

eth-sim's Introduction

ETH Transaction Simulator

A PoC for an Ethereum transaction simulator, which compares two approaches:

  1. Use standard ETH RPC calls to fetch the needed state for the simulation and run the EVM code locally
  2. Use a local reth DB to fetch the data and run the EVM code locally

The local DB approach is much faster compared to using RPC, even when the RPC is running locally.

Here are some benchmark results of simulating mempool transactions using reth running locally on Ubuntu 22.04, Ryzen 5 5600X, 24GB RAM, Seagate FireCuda 530 4TB NVME.

https://docs.google.com/spreadsheets/d/1lolaKiBNtQuFktuw8Pa2tnWLtJcWKG_gHQF06cMCrd4/edit?usp=sharing

You can see from the results that the Reth DB speed is over 2x faster, compare to using the RPC interface of the node.

Benchmark results

Run

In order to run the mempool simulator copy the .env.example file to .env. Set WS_RPC_URL and HTTP_RPC_URL to a node which supports fetching the pending transactions in the mempool. Also set RETH_DB_PATH to the location of the DB of a locally synced reth node.

$ cp .env.example .env
$ cargo run --release

Make sure to run with --release, so that you can see the true performance of the reth DB simulator.

eth-sim's People

Contributors

konqueror1 avatar valo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.