Lighthouse Ethereum Consensus Client
repository·stable·Indexed 25 days ago
https://github.com/sigp/lighthouseA high-performance, security-focused Ethereum consensus client implemented in Rust. The project includes the Lighthouse Account Manager for cryptographic key generation and secure storage, lcli for state transition replaying, and a BuilderHttpClient for interacting with MEV builders. It provides tools for managing database schema migrations and a local testnet environment using Docker, Kurtosis, and yq.
What's inside Lighthouse
- Lighthouse is an open-source Ethereum consensus client written in Rust. It is designed for security and performance, suitable for use on the Ethereum consensus mainnet. It is licensed under Apache 2.0.
Overview of Lighthouse Account Manager roles
stableThe Lighthouse Account Manager (AM) is a stand-alone binary used to manage cryptographic keys for Ethereum Serenity. Its primary responsibilities include:
- Generation of cryptographic key pairs: Securely generating keys using sufficient entropy.
- Secure storage of private keys: Encrypting keys at rest on disk in a format compatible with the validator client.
- Staking initiation: Producing the messages and transactions required to initiate staking on Ethereum 1.x.
Overview of Lighthouse UI (Siren)
stableSiren is a user interface built for Lighthouse that connects to a Lighthouse Beacon Node and a Lighthouse Validator Client. It is used to monitor performance and display key validator metrics.
Note: Siren is currently in active development and is maintained in its own dedicated repository: https://github.com/sigp/siren.
Overview of the Lighthouse validator-manager tool
stableThe
lighthouse validator-managertool is used to manage validators on a running Lighthouse Validator Client (VC). Unlike theaccount-managertool, which creates files to be read upon the next VC restart, thevalidator-managerperforms operations via the HTTP API to make instant changes to a live VC.Key features include:
- Moving validators between two VCs while maintaining the slashing protection database.
- Generating deposit files compatible with the Ethereum Staking Launchpad.
- Minimizing downtime during validator operations.
- Preserving the "key cache" when adding validators to prevent long startup waits.
Understand Lighthouse Database Architecture (Hot vs. Cold DB)
stableLighthouse employs a "split" database schema to manage state efficiency:
- Hot DB: Stores recent, unfinalized states and all blocks. Full
BeaconStatestructures are stored once per epoch to maintain performance for recent data. - Freezer DB (or Cold DB): Stores finalized states. It uses a sparser format where full
BeaconStatestructures (snapshots) are stored periodically, and intermediate states are reconstructed by replaying blocks or applying hierarchical state diffs (hdiffs). - Split Slot: The specific slot that marks the boundary between the freezer DB (slots less than the split slot) and the hot DB (slots greater than or equal to the split slot).
- Hot DB: Stores recent, unfinalized states and all blocks. Full
Understand slashing protection effectiveness and limitations
stableLighthouse uses an SQLite database located at
$datadir/validators/slashing_protection.sqliteto record signed messages and prevent double-signing.What it PROTECTS against:
- Duplicate clients: Running two Lighthouse clients on the same machine with the same
datadir(the second client will fail to start due to the database lock). - Deep re-orgs: Prevents re-attesting in an epoch where you have already attested.
- Migration errors: Prevents signing if the
slashing_protection.sqlitefile is missing during adatadirchange.
What it DOES NOT protect against:
- Simultaneous instances: Running two different clients (e.g., Lighthouse and Prysm) or two Lighthouse instances with different
datadirson the same machine or different machines. You are responsible for ensuring your keys never run in two places at once. - Incomplete imports: Importing keys without also importing the voting/signing history.
- Manual recreation: Using the
--init-slashing-protectionflag to wipe the history.
- Duplicate clients: Running two Lighthouse clients on the same machine with the same
Use lcli for state transition replaying
stablelcli is a command-line debugging tool designed to assist in fault-finding by replaying state transitions from SSZ files. It is inspired by zcli.Identify available Lighthouse APIs
stableLighthouse provides two distinct RESTful HTTP/JSON APIs for querying the Ethereum consensus state:
- Beacon Node API: Used for interacting with the beacon node (e.g., querying attestations, blocks, and consensus state).
- Validator Client API: Used for interacting with the validator client (e.g., managing validator keys, checking staking status, and performing withdrawals).
Backfill historical blob data
stableTo retrieve historical blob data beyond the standard 18-day availability period, you can use the experimental flag
--complete-blob-backfill.Critical Requirements & Risks:
- This is an experimental feature.
- It only works if the flag is present during a fresh checkpoint sync when the database is being initialized.
- It will not work if the node is already running with an existing database.
- During backfill, the node may experience issues such as blocking most of its peers.
--complete-blob-backfillAccess Lighthouse Documentation and Support
stableFor detailed technical information, guides, and developer documentation, refer to the Lighthouse Book.
For community discussion and support, use the Lighthouse Discord server. For periodic progress updates and roadmap insights, follow the Lighthouse Blog.
Set up the Lighthouse development environment
stableTo develop on Lighthouse, ensure you have the base dependencies installed via the Installation Guide. For development, you must also install:
cmake: Required by some dependencies.java 17 runtime: Minimum version 17 is required forweb3signer_tests.
Recover EIP-2335 validator keystores from a mnemonic
stableIf you have lost your validator keystore files or passwords, you can regenerate them using a mnemonic via the
lighthouse account validator recovercommand.⚠️ Warning: Use this only as a last resort.
- Your mnemonic is not encrypted and is highly vulnerable to theft when entered into a computer.
- Regenerating keys can result in duplicate keypairs. Running the same keypairs on two different validator clients will likely result in slashing.
Each recovered index creates a directory in the
--validator-dirlocation (default~/.lighthouse/{network}/validators) containing the necessary information to run a validator withlighthouse vc. The new keystore password is saved in the--secrets-dir(default~/.lighthouse/{network}/secrets).Note:
{network}refers to the value passed to the--networkparameter (default ismainnet).