Skip to content

Add examples for engine methods #465

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

Merged
merged 5 commits into from
Sep 11, 2023

Conversation

alexandratran
Copy link
Contributor

@alexandratran alexandratran commented Aug 23, 2023

Add examples for:

  • engine_exchangeCapabilities
  • engine_exchangeTransitionConfigurationV1
  • engine_forkchoiceUpdatedV1
  • engine_forkchoiceUpdatedV2
  • engine_forkchoiceUpdatedV3
  • engine_getPayloadBodiesByHashV1
  • engine_getPayloadBodiesByRangeV1
  • engine_getPayloadV1
  • engine_getPayloadV2
  • engine_getPayloadV3
  • engine_newPayloadV1
  • engine_newPayloadV2
  • engine_newPayloadV3

The V1 examples are taken from the Besu Engine API docs.

This will be one in a series of PRs adding examples to this OpenRPC spec.

@mkalinin
Copy link
Contributor

This is great! I wish Engine API were getting these examples in its early days :-D

I understand that they are brought from Besu API docs and happy to merge this PR as is. But the following additions would be really nice:

  • forkchoiceUpdated example with non-null payloadAttributes (can be assembled from forkchoiceUpdatedV1 and getPayloadV1 examples)
  • newPayload example with INVALID payload status in the response
  • V2 and V3 examples for each method

@mkalinin
Copy link
Contributor

Spellchecker has a problem with hex strings. I have found the following solution to that:

  - name: json schemas
    ...
    pipeline:
    - pyspelling.filters.context:
        context_visible_first: true
        delimiters:
        - open: ''
          content: 0x[a-fA-F0-9]+
          close: ''

cc @lightclient

@alexandratran
Copy link
Contributor Author

@mkalinin thanks for the feedback. I've made the additions as per your request, but I need some confirmation and additional input for some of the added examples. In particular, can you provide good examples for the following parameters?

  • engine_newPayloadV3: blobGasUsed, excessBlobGas, and expected blob versioned hashes
  • engine_getPayloadV3: blobsBundle object

@alexandratran alexandratran changed the title Add examples for V1 engine methods Add examples for engine methods Aug 24, 2023
@mkalinin
Copy link
Contributor

I think you can find good examples of these methods calls in the Hive logs, for instance, here is the Besu logs of Cancun Engine API checks.

@alexandratran
Copy link
Contributor Author

@mkalinin Thanks, added in the missing examples.

- '0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
- '0x80c5f2e1eb23939cf3600f61872e3e9964d0acafb440634e530d6139a193b889c56a0c07d737729dbe0626706fc9f25f'
- '0x98daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a7553'
blobs:
Copy link
Contributor

Choose a reason for hiding this comment

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

Blobs are huge! Maybe we want to trim its values, curious what others think about it? cc @lightclient

Copy link
Contributor

@mkalinin mkalinin left a comment

Choose a reason for hiding this comment

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

Great work! thank you!

@alexandratran
Copy link
Contributor Author

@mkalinin Thanks! When ready, can you merge this (since I don't have write access)? Also, I have a similar PR open adding debug examples: #464.

@mkalinin mkalinin merged commit ff43500 into ethereum:main Sep 11, 2023
@alexandratran alexandratran deleted the add-engine-examples branch July 10, 2024 21:18
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