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

Engine API: Make SYNCING response and according actions fork specific #152

Closed
wants to merge 2 commits into from

Conversation

mkalinin
Copy link
Collaborator

It is required by an optimistic sync ethereum/consensus-specs#2770 that EL sync process and according responses are fork specific. It means that despite of the sync process that is catching up with the head of any fork an EL client software must still verify payloads, update fork choice state and initiate payload build processes on another fork if data that are requisite for these operations are available for a client software.

An example:

A -> B -> C <= canonical
\
  -> B' -> C' <= SYNCING

In this example executePayload(D), where C -> D MUST NOT be affected by sync process that is catching up with C'. Also, forkchoiceUpdated(finalized: A', head: D) assuming that A' is finalized ancestor of A MUST NOT be affected by the aforementioned sync process, and it MUST initiate a payload build process if requested.

Also, tired of updating numbers in the list when changing the order of items, thus, utilizing Markdown to maintain ordered lists.


4. Client software **MAY** provide additional details on the validation error if the payload is deemed `INVALID` by assigning the corresponding message to the `validationError` field.
1. Client software **MUST** validate the payload and respond accordingly despite of the sync process being in progress if there is enough data for the payload validation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might consider a clarifying example

"(e.g. if branch A is SYNCING but a block is inserted the head of branch B which is VALID, this block must be validated)"

2. All updates to the forkchoice state resulting from this call **MUST** be made atomically.
1. All updates to the forkchoice state resulting from this call **MUST** be made atomically.

1. Client software **MUST** return `{status: SUCCESS, payloadId: null}` if `payloadAttributes` is `null`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should clarify that this isn't returned no matter what if payloadAttribues is null but only if null and successful

Suggested change
1. Client software **MUST** return `{status: SUCCESS, payloadId: null}` if `payloadAttributes` is `null`.
1. Client software **MUST** return `{status: SUCCESS, payloadId: null}` if `payloadAttributes` is `null` and fork choice update is successful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe we should reorder this statement with the next one.

  • {SYNCING, null} if not enough info to process
  • {SUCCESS, null} if no payload and success
  • {SUCCESS, id} if payload and success

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That way it acts a blocking condition on the next two success conditions

src/engine/specification.md Outdated Show resolved Hide resolved

3. Client software **MUST** return `{status: SUCCESS, payloadId: null}` if `payloadAttributes` is `null` and the client is not `SYNCING`.
1. Client software **MUST** return `{status: SYNCING, payloadId: null}` if the payload identified by either the `forkchoiceState.headBlockHash` or the `forkchoiceState.finalizedBlockHash` is unknown. In the event that either the `forkchoiceState.headBlockHash` or the `forkchoiceState.finalizedBlockHash` is unknown, the client software **SHOULD** initiate the sync process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the SHOULD here be a MUST?

It's weird to respond with SYNCING and not actually kick off some sync process

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data supplied by the forkchoiceUpdated isn't always enough to initiate the sync process. For instance, there is no state root to pull the state for, so, the MUST can't always be satisfied.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

@mkalinin
Copy link
Collaborator Author

Superseded by #165

@mkalinin mkalinin closed this Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants