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: how to apply latestValidHash when payload is INVALID #2954

Merged
merged 4 commits into from
Aug 3, 2022
Merged
Changes from 1 commit
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
18 changes: 18 additions & 0 deletions sync/optimistic.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ the merge block MUST be treated the same as
an `INVALIDATED` block (i.e., it and all its descendants are invalidated and
removed from the block tree).

### How to apply `latestValidHash` when payload status is `INVALID`

Processing the `INVALID` payload status by consensus engine
depends on the value returned in `latestValidHash` parameter.
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
The general approach is as follows:
1. Consensus engine MUST identify `invalidBlock` as per definition in the table below
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
2. `invalidBlock` and all its descendants MUST be transitioned from `NOT_VALIDATED` to `INVALIDATED`
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
djrtwo marked this conversation as resolved.
Show resolved Hide resolved

| `latestValidHash` | `invalidBlock` |
|:- |:- |
| Execution block hash | The *child* of a block with `body.execution_payload.block_hash == latestValidHash` in the chain containing a block with payload in question |
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
| `0x00..00` (all zeroes) | The first block with `body.execution_payload != ExecutionPayload()` in the chain containing a block with payload in question |
| `null` | Block with payload in question |

When `latestValidHash` is a meaningful execution block hash but consensus engine
can't find a block satisfying `body.execution_payload.block_hash == latestValidHash`,
djrtwo marked this conversation as resolved.
Show resolved Hide resolved
consensus engine SHOULD behave the same as if `latestValidHash` was `null`.

### Execution Engine Errors

When an execution engine returns an error or fails to respond to a payload
Expand Down