LMD GHOST is the fork choice rule used by Ethereum's proof-of-stake consensus to decide which block is the current head of the chain when more than one candidate exists. The name stands for "Latest Message Driven Greediest Heaviest Observed SubTree". In short, a node walks up the tree of blocks from a trusted starting point and, at every fork, follows the branch supported by the greatest total stake, counting only the most recent vote from each validator.
LMD GHOST is one half of Ethereum's consensus protocol, known as Gasper. The other half, Casper FFG, finalises checkpoints so they cannot be reversed without huge losses to validators; it is described under Casper (Ethereum). LMD GHOST keeps the chain moving block by block, while Casper FFG locks history in place every few minutes.
LMD GHOST in plain terms
Imagine a group of hikers at a series of trail junctions, each trying to agree on the main path. Every hiker regularly calls out which path they think is correct, and only their latest call counts. At each junction, the group takes the branch that the largest number of hikers, weighted by how much they have staked on being right, currently supports, including everyone further down that branch.
The group keeps doing this at each junction until it reaches the end of the trail. That end point is the head of the chain. Because older calls are replaced by newer ones, the group can change its mind quickly if new information arrives, but it never forgets the checkpoints it has already locked in.
How LMD GHOST works
Ethereum divides time into slots of 12 seconds, grouped into epochs of 32 slots. In each slot, one validator proposes a block and a committee of others publish attestations, signed votes for what they see as the head of the chain. The fork choice then runs as follows:
- Start from the most recent justified checkpoint accepted by Casper FFG.
- For each validator, keep only its latest attestation and the amount of stake behind it.
- At each block, look at its children. For each child, add up the stake of all latest votes for that child or any block descended from it.
- Move to the child with the greatest total weight, breaking ties by a fixed rule.
- Repeat until reaching a block with no children. That block is the head.
"Greediest heaviest observed subtree" refers to counting votes for a whole subtree of descendants, not just a single chain; "latest message driven" means old votes are discarded once a validator votes again.
Every node runs this calculation for itself, using the attestations it has received. Two nodes with slightly different views of the network may briefly disagree about the head, but as attestations spread they converge on the same answer. Client software keeps the vote tallies in an efficient data structure so the rule can be recomputed many times each slot without heavy computation, and the specification is written precisely enough that the different Ethereum clients reach identical results.
History
The GHOST rule was proposed by Yonatan Sompolinsky and Aviv Zohar in a 2013 paper as a way to make fast proof-of-work blockchains more secure, by counting blocks on side branches when choosing the main chain. Ethereum researchers adapted the idea to proof of stake, replacing blocks with validator votes, and the combined Gasper protocol was described in a 2020 paper. LMD GHOST went live with the Beacon Chain in December 2020 and has governed Ethereum's main chain since the Merge of September 2022.
Attacks and refinements
Researchers identified several weaknesses in the original rule. In balancing attacks, a small group of malicious validators times its votes to keep honest validators split between two branches, delaying agreement. In reorganisation attacks, a proposer may try to orphan a rival's block by withholding its own. Ethereum added "proposer boost", which gives a timely block extra temporary weight, and other adjustments to make such attacks harder. Research continues on alternatives that would give faster finality, including single-slot finality designs, which could change or replace LMD GHOST in future upgrades.
Role in Ethereum consensus
LMD GHOST favours liveness: it always identifies some head, even when many validators are offline, so blocks keep being produced. Casper FFG favours safety: it finalises a checkpoint only when two-thirds of staked ether agrees. If more than a third of validators go offline, the chain keeps growing under LMD GHOST but stops finalising, and a mechanism called the inactivity leak gradually reduces the stake of offline validators until finality can resume. This pairing reflects a classic trade-off in Byzantine fault tolerant systems, and the wider design is covered under consensus layer.