Skip to content

LayerZero-Labs/fafo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

FAFO: Fast Ahead-of-Formation Optimization

Overview

FAFO is a blockchain transaction scheduler that optimizes transaction execution by reordering transactions before block formation for maximum concurrency.

  • Over 1 million Merkleized EVM-Compatible transactions per second while maintaining state verifiability
  • Near-linear throughput scaling up to 96 cores and beyond on a single machine
  • 91% cheaper than sharded execution

Read the full FAFO paper here: https://layerzero.network/publications/FAFO_Whitepaper.pdf

FAFO is ongoing research. Designed for high performance and practical use, some features are still evolving. We invite feedback and contributions from the community.

Architecture

FAFO has three key components:

  • ParaLyze preprocesses each transaction in the mempool to approximate the addresses of every storage slot it reads and writes.
  • ParaFramer uses our cache-friendly data structure, ParaBloom, to group non-conflicting (parallel-executable) transactions into frames. Frames are groups of transactions that do not have data conflicts and thus can be run in parallel.
  • ParaScheduler extracts even more parallelism out of the stream by computing a collection of precedence graphs for each storage slot accessed by each transaction.

Quick start

To get started, clone the repository and install the dependencies:

git clone https://github.com/LayerZero-Labs/fafo.git
cd fafo
./install-dependencies

Run a quick benchmark:

# No contention
./bench-sendeth/run.sh --size fast --generator none
# Contention
./bench-sendeth/run.sh --size fast --generator hotn

See bench-sendeth/readme.md for more benchmark details.

Installation

Prerequisites

Due to the complexities of software versions and environments on your host, it can be challenging to resolve issues related to these factors.

We strongly recommend using Dev Containers for development to ensure a consistent and isolated development environment and avoid common setup issues, and that will be helpful to reproduce the issues also.

Setup steps:

  1. Install Visual Studio Code (VSCode)
  2. Install the "Dev Containers" extension in VSCode
  3. Use VSCode's "Dev Containers: Clone Repository in Named Container Volume..." command to clone the repository
    • Open Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
    • Type and select "Dev Containers: Clone Repository in Named Container Volume..."
    • Enter repository URL when prompted
    • Choose a meaningful name for the volume

This setup ensures optimal performance and consistent development environment.

For more details, see Dev Containers in VS Code

Development

See CONTRIBUTING.md for our full development workflow.

Any questions?

Please raise a GitHub issue. For vulnerabilities, please report them privately via GitHub security page per our security policy.

License

This project is dual licensed under the MIT License and the Apache License 2.0.

See also

Acknowledgements

If you use FAFO in a publication, please cite it as:

FAFO: Over 1 million TPS on a single node running EVM while still Merkleizing every block
Ryan Zarick, Isaac Zhang, Daniel Wong, Thomas Kim, Bryan Pellegrino, Mignon Li, Kelvin Wong
https://layerzero.network/research/fafo

@article{zarick2025fafo,
  title={FAFO: Over 1 million TPS on a single node running EVM while still Merkleizing every block},
  author={Zarick, Ryan and Zhang, Isaac and Wong, Daniel and Kim, Thomas and Pellegrino, Bryan and Li, Mignon and Wong, Kelvin},
  journal={Under submission},
  year={2025}
}

QMDB is a product of LayerZero Labs Research.

LayerZero LayerZero

Homepage | Docs | Developers

About

FAFO: Over 1 million TPS on a single node running EVM while still Merkleizing every block

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages