HackMD
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • More (Comment, Invitee)
    • Publishing
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions and GitHub Sync
    • Transfer ownership
    • Delete this note
    • Template
    • Save as template
    • Insert from template
    • Export
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Sharing Help
Menu
Options
Versions and GitHub Sync Transfer ownership Delete this note
Export
Google Drive Export to Google Drive Gist
Import
Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
More (Comment, Invitee)
Publishing
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with GitHub
Like BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Proposal for mitigation against balancing attacks to LMD GHOST One key way in which eth2's fork choice differs from that of eth1, as well as "chain-based" PoS algorithms (eg. older algorithms like Peercoin and NXT, but also newer ones like Tezos, Ouroboros...) is that in eth2, there are many messages affecting the "score" of a block arriving in parallel. ### Chain-based: ![](http://web.archive.org/web/20200704180058im_/https://vitalik.ca/files/posts_files/cbc-casper-files/Chain4.png) ### Committee-per-slot (as in eth2): ![](http://web.archive.org/web/20200720052252im_/https://vitalik.ca/files/posts_files/cbc-casper-files/Chain13.png) Chain-based algorithms are easier to prove liveness for (and indeed, in some cases liveness has been proven), because there is generally a single actor acting at one time, allowing them to act as a "coordinating bottleneck" getting everyone to agree on the same score. Here is a "strawman proof sketch" for liveness in chain-based algorithms. Suppose that: 1. There is exactly one actor (eg. a block proposer) who can participate in each slot. 2. Honest block proposers publish their block during the first half of the slot. 3. Network latency is bounded above by half a slot (so $\delta < \frac{1}{2}$, measuring time in slots). 4. An actor assigned to take action (eg. propose a block) during slot $N+1$ will act based only on information that they received before the end of slot $N$. We model the time during which nodes receive a message sent at time $t$ as a "cloud" in the interval $(t, t+\delta)$ (so far, this is just stating the standard academic presentation of a synchrony assumption). Thus there are two cases: ### Agreement case ![](https://storage.googleapis.com/ethereum-hackmd/upload_6b01831335316ee54c7b9b110aa3bf58.png) ### Disagreement case ![](https://storage.googleapis.com/ethereum-hackmd/upload_e68e0a039eb85578656b52df50299ef1.png) Notice that the disagreement case happens only when the participant in slot N is dishonest. Hence, if the participant assigned to some given slot is honest, then either (i) at the end of that slot everyone agrees what the correct chain is, because they are calculating the fork choice based on the same information, or (ii) the attacker "used up" some saved participation rights from an even earlier slot in which they did not participate. Hence, a disruption can only continue if the attacker has at least one saved participation right per honest participant, ie. if the attacker is assigned to more slots than honest nodes (ie. the honest majority assumption is violated). Now, let's look at the "many parallel attestations" case. In the case where there are many parallel attestations that contribute to the score of a block, there is no single actor that creates a bottleneck in this way. Hence, an attacker could manipulate the network (plus strategically broadcast a few of their own validators) in such a way as to create a state of disagreement at the end of each slot about which messages count toward the fork choice, and therefore which of multiple chains is the winning chain. See [here](https://arxiv.org/pdf/2009.04987.pdf), particularly pages 4-5, for an exposition of this kind of attack. Note that this attack does depend on networking assumptions that are highly contrived in practice (the attacker having fine-grained control over latencies of individual validators), but nevertheless a protocol that is secure against such attacks is better than one that is not. ## Proposed solution The proposed solution is to introduce an explicit "synchronization bottleneck" gadget into the fork choice. In particular, we add the following rules: 1. Suppose that all of the attesters assigned to slot $N$ have collective total weight $W$ 2. A participant in slot $N+1$ only considers attestations valid if they arrived before the end of slot $N$ (from their point of view) 3. The _proposer_ in slot $N+1$ is expected to make a proposal immediately at the start of slot $N+1$. Their proposal implicitly chooses a particular chain. From the point of view of _attesters_ in slot N+1, if they see the proposal arriving before 1/3 of the way into a slot, they treat that proposal as equivalent to an attestation with weight $\frac{W}{4}$ (this score adjustment is valid only for slot $N+1$; after slot $N+1$ this score adjustment is reverted). 4. Reduce the synchrony assumption to $\delta < \frac{1}{3}$ ![](https://storage.googleapis.com/ethereum-hackmd/upload_6de409c1965e8af422227c30fde1cd44.png) ### Analysis _(Note: for ease of analysis, we pretend that clocks are perfectly synchronous, and that any actual clock disparity is part of the network delay)_ At the end of slot $N$, all validators have received some set of attestations. If there is an attack going on (ie. there were $k\ge1$ malicious attesters that revealed attestations during slot $N$), the validators will likely disagree on the score of each block. But the range of their disagreement will be bounded-above by $k$. Suppose (without loss of generality) that there are two competing blocks, $A$ and $B$, and $A$ "wins" if $score(A) - score(B) \ge 0$ and otherwise $B$ wins. The range of disagreement in $score(A) - score(B)$ will be bounded above by $2k$ (ie. each validator's opinion on the value $score(A) - score(B)$ will be in some range $[z, z+2k]$ for a fixed $z$) Let $W_p$ be the weight of the proposer ($W_p = \frac{W}{4}$ in the exposition above). If the proposer is honest, they are guaranteed to follow two behaviors: 1. If they see that $score(A) - score(B) \ge 0$, they will propose a block on top of $A$; otherwise they will propose a block for $B$. 2. They will propose their block immediately, guaranteeing that all attesters see it before the deadline. Let $[z, z+2k]$ be the range of disagreement on $score(A) - score(B)$. We distinguish three cases: 1. $z < -2k$ 2. $-2k \le z < 0$ 3. $z \ge 0$ In case (1), the proposer wil vote for $B$, and so attesters will see adjusted scores in the range $[z-W_p, z+2k-W_p]$; this entire range is negative, and so there is full agreement on $B$. In case (3), the proposer will vote for $A$, and so attesters will see adjusted scores in the range $[z+W_p, z+2k+W_p]$; this entire range is positive, and so there is full agreement on $A$. In case (2), effectively the proposer decides. Depending on where in the range the proposer's own opinion falls, either the proposer favors $A$ or $B$. Hence, the range will be either (i) $[z-W_p, z+2k-W_p]$ or (ii) $[z+W_p, z+2k+W_p]$. Consider the case where $W_p \ge 2k$. Note that from the definition of case (2), $-2k \le z < 0$ In case (2.i), $z < 0$ and $2k - W_p \le 0$, so the upper end of the range $z+2k-W_p$ is negative, so the entire range is negative. In case (2.ii), $z > -2k$ and $W_p \ge 2k$, so $z + W_p > 0$, so the entire range is positive. Hence, there is full agreement on either $A$ or $B$, depending on the proposer's pick. Now, let's get back to the exposition, where $W_p = \frac{W}{4}$. To prevent the proposer synchronization bottleneck from working, the key premise in the above reasoning that $W_p \ge 2k$ must be broken; hence, there must be $>\frac{W}{4}$ attesters that reveal themselves during each slot. If the proposer synchronization bottleneck _works_ during any single slot, all honest attesters will vote in that direction, further pushing $score(A) - score(B)$ away from zero. To prevent one side or the other from winning at this point, the attacker must reveal enough attestations to counteract all honest validators during that slot (minus $\frac{1}{4}$ to counteract the loss of the proposer vote's efficacy at the end of the slot); this will take much more than $\frac{W}{4}$ attestations. Hence, maintaining a persistent liveness break requires at least $\frac{W}{4}$ malicious validators per slot, or $\ge \frac{1}{4}$ of validators to be dishonest.

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.


Upgrade

All
  • All
  • Team
No template.

Create a template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Sign in via SAML

or

Sign in via GitHub

Help

  • English
  • 中文
  • 日本語

Documents

Tutorials

Book Mode Tutorial

Slide Example

YAML Metadata

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions and GitHub Sync

Sign in to link this note to GitHub Learn more
This note is not linked with GitHub Learn more
 
Add badge Pull Push GitHub Link Settings
Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub

      Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

       Sign in to GitHub

      HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully