Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opti sync: elaborate on why sync optimistically #2958

Merged
merged 7 commits into from
Aug 9, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions sync/optimistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,23 @@ optimistic blocks (and vice-versa).

## Design Decision Rationale

### Why sync optimistically?

Most execution engines use state sync as a default sync mechanism on Ethereum Mainnet
mkalinin marked this conversation as resolved.
Show resolved Hide resolved
because executing blocks from genesis takes several weeks on commodity hardware.

State sync requires the knowledge of the current head of the chain to converge eventually.
If not constantly fed with the most recent head, state sync won't be able to complete
because the recent state soon becomes unavailable due to state trie pruning.

Optimistic block import (i.e. import without waiting for a payload to be executed by the engine)
mkalinin marked this conversation as resolved.
Show resolved Hide resolved
breaks a deadlock between the state sync and processing a beacon block by skipping payload
execution as long as execution engine is syncing.
mkalinin marked this conversation as resolved.
Show resolved Hide resolved

Optimistic sync works nicely with execution engines using block execution as a default
mkalinin marked this conversation as resolved.
Show resolved Hide resolved
sync mechanism (e.g. Erigon). It makes optimistic sync a *generalized* solution for
interaction between consensus and execution engine during the sync process.

### Why `SAFE_SLOTS_TO_IMPORT_OPTIMISTICALLY`?

Nodes can only import an optimistic block if their justified checkpoint is
Expand Down