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

Extend Deneb with Execution layer cross-validation #557

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dapplion
Copy link
Contributor

Add spec for routes introduced by @karalabe in https://gist.github.com/karalabe/47c906f0ab4fdc5b8b791b74f084e5f9

In summary, these routes allow one to request witnesses from an execution client, and submit them to another for stateless execution.

Refer to Peter's doc for more detailed rationale https://gist.github.com/karalabe/47c906f0ab4fdc5b8b791b74f084e5f9#engine-api-specs

@karalabe
Copy link
Member

Based on the discussions on discord, I've converted the witness to a fully opaque blob on the engine API. I.e.

  • The StatelessWitnessV1 type was dropped altogether, as the CL doesn't need to interpret anything inside.
  • Wherever the StatelessWitnessV1 type was used, it's now an opaque DATA type.
    • For reference, the content of the opaque data is an RLP encoded witness, as defined in my spec doc.

This should both make the api diff smaller, as well as more performant by avoiding witness parsing CL side.

@mkalinin
Copy link
Collaborator

We used to have src/engine/experimental folder to keep specs of the feature that aren’t yet scoped for any HF. I think it is better to move this spec there, and once we’re ready include it in Prague or another HF.

@dapplion
Copy link
Contributor Author

We used to have src/engine/experimental folder to keep specs of the feature that aren’t yet scoped for any HF. I think it is better to move this spec there, and once we’re ready include it in Prague or another HF.

This change is not part of any hard-fork, and can be enabled at any time (including before Pectra) by some clients without coordination. Given that where would you place it?


- `status`: `enum` - `"VALID" | "INVALID"`
- `stateRoot`: `DATA|null`, 32 Bytes - the state root of the most recent *valid* block in the branch defined by payload and its ancestors
- `receiptsRoot`: `DATA|null`, 32 Bytes - the receipts root of the most recent *valid* block in the branch defined by payload and its ancestors
Copy link
Collaborator

Choose a reason for hiding this comment

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

@karalabe could you please share more info about why latestValidHash can not work in the case of stateless execution?

Copy link
Member

Choose a reason for hiding this comment

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

There's no local chain. Stateless execution is stateless. Here's the input, here's the output. Forget we ever talked.

Copy link
Member

Choose a reason for hiding this comment

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

It's more akin to a library verifying an execution than a full node being on the other side.

@mkalinin
Copy link
Collaborator

mkalinin commented Jul 1, 2024

This change is not part of any hard-fork, and can be enabled at any time (including before Pectra) by some clients without coordination. Given that where would you place it?

It seems that we would need to update newPayloadWithWitness and executeStatelessPayload every time when the payload struct changes. Can we have newPayload response to be extended with the witness field which is optional? Something like:

PayloadStatusV2:

  • status: enum - "VALID" | "INVALID" | "SYNCING" | “ACCEPTED"
  • latestValidHash: DATA|null, 32 Bytes - the hash of the most recent valid block in the branch defined by payload and its ancestors
  • validationError: String|null - a message providing additional details on the validation error if the payload is classified as INVALID
  • witness: DATA|null - Opaque blob containing witness data RLP encoded if provided.

In this case it can become a part of the API since Prague. If we want to make this functionality parallel to the main payload processing flow (i.e. always be implemented via separate methods) then it can be introduced in Cancun I believe, and updated accordingly in Prague.

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.

3 participants