Minimalist, fast and modular implementation of the Lean Ethereum client written in Rust.
We use cargo as our build system. To build and run the client, simply run:
cargo runRun make help or take a look at our Makefile for other useful commands.
To quickly spin up a devnet, see lean-quickstart. We have a WIP integration with it in our fork.
Many long-established clients accumulate bloat over time. This often occurs due to the need to support legacy features for existing users or through attempts to implement overly ambitious software. The result is often complex, difficult-to-maintain, and error-prone systems.
In contrast, our philosophy is rooted in simplicity. We strive to write minimal code, prioritize clarity, and embrace simplicity in design. We believe this approach is the best way to build a client that is both fast and resilient. By adhering to these principles, we will be able to iterate fast and explore next-generation features early.
Read more about our engineering philosophy in this post of our blog.
- Ensure effortless setup and execution across all target environments.
- Be vertically integrated. Have the minimal amount of dependencies.
- Be structured in a way that makes it easy to build on top of it.
- Have a simple type system. Avoid having generics leaking all over the codebase.
- Have few abstractions. Do not generalize until you absolutely need it. Repeating code two or three times can be fine.
- Prioritize code readability and maintainability over premature optimizations.
- Avoid concurrency split all over the codebase. Concurrency adds complexity. Only use where strictly necessary.
The following links, repos, companies and projects have been important in the development of this repo, we have learned a lot from them and want to thank and acknowledge them.
If we forgot to include anyone, please file an issue so we can add you. We always strive to reference the inspirations and code we use, but as an organization with multiple people, mistakes can happen, and someone might forget to include a reference.
The initial project setup and integration with lean-quickstart are complete.
This milestone focuses on connecting to other clients and listening for new blocks through gossipsub.
- Connect to other peers via libp2p ✅
- Respond to STATUS messages from other peers 🏗️
- Listen for new blocks in gossipsub
This milestone focuses on computing the chain state from the gossiped by peers received.
- Generate initial state from genesis configuration
- Implement state transition function
- Transition state on each new block
This milestone focuses on choosing the head of the chain based on gossiped attestations.
- Listen for attestations in gossipsub
- Implement fork-choice rule
- Apply fork-choice rule based on received attestations
This milestone focuses on performing the duties of a validator.
- Produce and broadcast attestations on each slot
- Compute current proposer for each slot
- Build and broadcast new blocks when proposing