Understanding Gasper

Sid Sharma [2023-07-17]

This is a part of research for an ongoing project, so this is more of a braindump. Read the original Gasper paper here.
⚠ NOTE: This is a WIP ⚠


Table of Contents

  1. Table of Contents
  2. Overview
  3. Goals
  4. Groundwork and Model
  5. LMD GHOST – v0
  6. Detour: Committees and Block Production
  7. Prototype Hybrid LMD GHOST – v0.999…
  8. Hybrid LMD GHOST – v1

Overview

Gasper is the consensus protocol used by Ethereum. It’s composed of 2 gadgets:

  1. LMD GHOST: fork-choice rule for block production
  2. Casper: finality gadget for finalizing blocks

Validators have 2 jobs: propose blocks and make attestations

Goals

Groundwork and Model

LMD GHOST – v0

LMD GHOST tree example

An example of LMD GHOST tree. Source: Gasper

Detour: Committees and Block Production

Prototype Hybrid LMD GHOST – v0.999…

def protoHLMD(G: view) -> block:
    (B_j, j) = getHighestEpochJustifiedPair(G)
    B = B_j
    M = latestAttestations()
    while B not in G.leaves:
        B = argmax([weight(G, child, M) for child in B.children])
    return B

Hybrid LMD GHOST – v1

def HLMD(G: view) -> block:
    (B_j, j) = max([J(l) for l in G.leaves]) # only leaves
    B’ = [(B_j, j) in J(l) for l in G.leaves]
    B = B_j, G’ = union([chain(b) for b in B’]) 
    M = latestAttestations()
    while B not in G’.leaves:
        B = argmax([weight(G’, child, M) for child in B.children])
    return B