lambdaclass/ethlambda
GitHub: lambdaclass/ethlambda
Stars: 75 | Forks: 25
# ethlambda
Minimalist, fast and modular implementation of the Lean Ethereum client written in Rust.
## Getting started
### Prerequisites
- [Rust](https://rust-lang.org/tools/install)
- [Git](https://git-scm.com/install)
- [Docker](https://www.docker.com/get-started)
- [yq](https://github.com/mikefarah/yq#install)
### Building and testing
We use `cargo` as our build system, but prefer `make` as a convenient wrapper for common tasks. These are some common targets:
# Formats all code
make fmt
# Checks and lints the code
make lint
# Runs all tests
make test
# Builds a docker image tagged as "ghcr.io/lambdaclass/ethlambda:local"
make docker-build DOCKER_TAG=local
Run `make help` or take a look at our [`Makefile`](./Makefile) for other useful commands.
### Running in a devnet
To run a local devnet with multiple clients using [lean-quickstart](https://github.com/blockblaz/lean-quickstart):
# This will clone lean-quickstart, build the docker image, and start a local devnet
make run-devnet
This generates fresh genesis files and starts all configured clients with metrics enabled.
Press `Ctrl+C` to stop all nodes.
For custom devnet configurations, go to `lean-quickstart/local-devnet/genesis/validator-config.yaml` and edit the file before running the command above. See `lean-quickstart`'s documentation for more details on how to configure the devnet.
## Philosophy
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](https://blog.lambdaclass.com/lambdas-engineering-philosophy/).
## Design principles
- 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.
## 📚 References and acknowledgements
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.
- [Ethereum](https://ethereum.org/en/)
- [LeanEthereum](https://github.com/leanEthereum)
- [Zeam](https://github.com/blockblaz/zeam)
- [Lantern](https://github.com/Pier-Two/lantern)
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.
## Current status
The client implements the core features of a Lean Ethereum consensus client:
- **Networking** — libp2p peer connections, STATUS message handling, gossipsub for blocks and attestations
- **State management** — genesis state generation, state transition function, block processing
- **Fork choice** — 3SF-mini fork choice rule implementation with attestation-based head selection
- **Validator duties** — attestation production and broadcasting, block building
Additional features:
### Container Releases
Docker images are published to `ghcr.io/lambdaclass/ethlambda` with the following tags:
| Tag | Description |
|-----|-------------|
| `devnetX` | Stable image for a specific devnet (e.g. `devnet4`) |
| `latest` | Alias for the stable image of the currently running devnet |
| `unstable` | Development builds; promoted to `devnetX`/`latest` once tested |
| `sha-XXXXXXX` | Specific commit |
[`RELEASE.md`](./RELEASE.md) has more details on our release process and how to tag new images.
### pq-devnet-4
We are running the `pq-devnet-4` spec. A Docker tag `devnet4` is available for this version.
### pq-devnet-5
### Older devnets
Docker tags for each devnet are released, with format `devnetX` (i.e. `devnet1`, `devnet2`, `devnet3`).
## Incoming features
Some features we are looking to implement in the near future, in order of priority:
### Experimental features
We have a proof-of-concept formalization of a part of the state transition function in Lean4 in PR [#269](https://github.com/lambdaclass/ethlambda/pull/269).
标签:通知系统