Q: When do we trigger it?
Q: Describe the algorithm
https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#specification-1
forkchoiceState.headBlockHash
references an unknown payload or a payload that can't be validated because data that are requisite for the validation is missing. The sync process is specified in the Sync section.https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#specification
https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#sync
In the context of this specification, the sync is understood as the process of obtaining data required to validate a payload. The sync process may consist of the following stages:
Note: Each of these stages is optional. Exact behavior of client software during the sync process is implementation dependent.
https://github.com/ethereum/execution-apis/blob/main/src/engine/common.md#message-ordering
Consensus Layer client software MUST respect the order of the corresponding fork choice update events when making calls to the engine_forkchoiceUpdated
method.
Execution Layer client software MUST process engine_forkchoiceUpdated
method calls
in the same order as they have been received.
We start a new backwards sync (BWS) session on both engine_forkchoiceUpdated (fCU) and engine_newPayload (nP).
AbstractEngineForkchoiceUpdated.java
AbstractEngineNewPayload.java
MergeCoordinator.java
BackwardSyncContext
is the entry point and manages the session.BackwardChain
is the data structure, where chainHead is the oldest block.hashesToAppend
is Deque representing the work queue (one per session?)isTrusted
means "do we have it stored?" (Maybe "trust" is because it came from the CL).BackwardSyncAlgorithm
consists of CompletableFuture
Steps composed recursively in a State Pattern.(WorldStateDownload || FastImportBlocks) -> WorldStateHeal -> BWS