Giter Club home page Giter Club logo

sp1-reth's Introduction

SP1 Reth

Telegram Chat

SP1 Reth is a 100% open-source POC that showcases how any rollup can use SP1 to build a performant (type-1, bytecode compatible) zkEVM with less than 2000 lines of maintainable Rust code. SP1 Reth achieves incredible performance (around $0.01-0.02 proving cost for an average Ethereum transaction) by leveraging SP1โ€™s open-source, customizable precompile system, with orders of magnitude improvements to come. SP1 Reth points to a future where all rollups can become ZK rollups, utilizing the magic of ZKPs with maintainable software written in Rust.

Blog Post | SP1 Repo | SP1 Docs

Requirements

To reproduce the benchmarks in our blog post, your system will need:

  • 64+ CPUs
  • 512+ GB RAM
  • NVME Hard Drive

We ran our benchmarks on a i4g.16xlarge instance on AWS. You may need to add a swap file on NVME.

Run

Make sure you have mounted your NVME hard drive in a RAID0 setup with at raid0 with a tmp folder.

cd script
TMPDIR=/mnt/raid0/tmp \
SHARD_SIZE=524288 \
RUST_LOG="debug,p3_keccak_air=off" \
RUSTFLAGS="-C target-cpu=native" \
cargo run --release -- \
  --rpc-url <rpc_url> \
  --block-number <block_number>

Lines of Code

$ cloc --by-file --include-lang=Rust primitives program   
      10 text files.
       8 unique files.
       5 files ignored.

github.com/AlDanial/cloc v 1.96  T=0.01 s (707.0 files/s, 264169.2 lines/s)
------------------------------------------------------------------------------------------
File                                        blank        comment           code
------------------------------------------------------------------------------------------
primitives/src/mpt.rs                         124            272           1022
primitives/src/processor.rs                    43             56            316
primitives/src/alloy2reth.rs                    8              3            145
primitives/src/db.rs                           19             11            134
primitives/src/lib.rs                          15             17             24
program/src/main.rs                             6              5             22
------------------------------------------------------------------------------------------
SUM:                                          215            364           1663
------------------------------------------------------------------------------------------

Security

This code has not yet been audited, and should not be used in any production systems.

Acknowledgements

We would like to acknowledge the projects below whose previous work has been instrumental in making this project a reality:

  • Reth: For providing an excellent execution client reference and primitives needed for processing blocks.
  • Revm: For providing core execution primitives and a performant EVM implementation.
  • Alloy: For providing core ethereum primitives and RPC methods.
  • Zeth: SP1 Reth is originally based on Zeth, but we chose to not fork Zeth directly because we noticed there was an opportunity to reuse significantly more code from Reth, Revm, and Alloy.

sp1-reth's People

Contributors

ctian1 avatar jtguibas avatar ratankaliani 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

sp1-reth's Issues

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.