# Ethereum reorgs after the merge --- ## What is a fork choice rule? * A function, evaluated by the client * Input = the set of blocks and other messages that have been seen * Output = the "canonical chain" --- ## Example: Nakamoto PoW (highest-total-difficulty) ![](https://i.imgur.com/6HXMS6F.png) --- ## There are three major types of fork choice rules <small> | Algorithm | Finality | Reorgs | Fork choice | | - | - | - | - | | Nakamoto | (eg. PoW Ethereum / Bitcoin) | None | Frequent | Longest chain | | GASPER (eg. PoS ethereum) | Every 2-epochs (~12 min) | Very occasional | Chain with strongest support after last finalized block | | Tendermint | Single block (~1-10s) | Never | Only finalized blocks | </small> --- ### Important: the fork choice question is separate from PoW vs PoS. | | PoW | PoS | | - | - | - | | **Nakamoto-style** | Bitcoin, PoW Ethereum | Peercoin, NXT, Tezos | | **Parallelized** | GHOST | Gasper | | **Instant-finality** | - | Tendermint | --- ## So... how do reorgs work in each case? --- ## Reorgs in Nakamoto PoW ![](https://vitalik.ca/images/cbc-casper-files/Chain3.png) * PoW fork choice uses the "longest total difficulty" rule * One consequence of this is that a block can often be reverted by a single block. --- ## Reorgs in Gasper ![](https://vitalik.ca/images/cbc-casper-files/Chain13.png) <small> * There is a large committee (~6,300 in Ethereum today) attesting at each slot * To revert a block, you need to overcome the attesters, not just a single proposer * Hence, reorging is extremely hard unless you have a large portion of total stake. </small> --- ### One caveat... ![](https://storage.googleapis.com/ethereum-hackmd/upload_e101ffcfd4c2c81ac86d8d0283b8d007.jpg) <small> * Fork choice is currently done on blocks, not (block, slot) pairs. * This means that in the above case, the top-right attestations do NOT impact the B vs no B choice * The attacker can wait for `C` to come out and then publish `B` with the attestations, reverting `C` * This reduces the threshold for attacks to significantly below 50% </small> --- ## Reorgs in Tendermint * Impossible (single slot finality) --- ## Q: How do these theoretical differences translate into practice? --- #### One way to look at the incentives: | Consensus algorithm | Game chart | | - | - | | Nakamoto | ![](https://i.imgur.com/KhGLgw5.png) | | Gasper | ![](https://i.imgur.com/zCIbFDy.png) | | Tendermint | ![](https://i.imgur.com/mqwKbeY.png) | --- ## In other words: * In Nakamoto, small groups can profitably reorg * In Gasper, need a large group (>30%) to profitably reorg * In Tendermint, cannot profitably reorg --- ## Conclusions for Ethereum <small> * **Short term**, two options: * Do not worry: miners have no incentive to attack because that will accelerate the merge * Tweak Nakamoto fork choice to favor earlier blocks and make reorgs a little harder * **Medium term**: * Prioritize the merge, to make reorgs much more difficult * Adjust beacon chain fork choice rule to harden against <50% attacks * **Long term**: * Explore more strongly penalizing even single-slot reversions </small> ---
{"metaMigratedAt":"2023-06-16T06:20:35.788Z","metaMigratedFrom":"YAML","title":"Ethereum reorgs after the merge","breaks":true,"slideOptions":"{\"transition\":\"slide\",\"parallaxBackgroundImage\":\"https://i.imgur.com/kBNEMDJ.png\",\"parallaxBackgroundSize\":\"100% 100%\",\"parallaxBackgroundHorizontal\":0}","contributors":"[{\"id\":\"1d678dc3-c84d-4629-8c9b-69b6187e7a0b\",\"add\":3599,\"del\":229}]"}
    3009 views