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

JSON-RPC types do not agree with Ethereum's OpenRPC spec #1560

Open
0xaatif opened this issue Oct 24, 2024 · 2 comments
Open

JSON-RPC types do not agree with Ethereum's OpenRPC spec #1560

0xaatif opened this issue Oct 24, 2024 · 2 comments
Assignees

Comments

@0xaatif
Copy link

0xaatif commented Oct 24, 2024

As an example, take debug_getBadBlocks (alphabetically, the first method in the spec)

- name: debug_getBadBlocks
  summary: Returns an array of recent bad blocks that the client has seen on the network.
  params: []
  result:
    name: Blocks
    schema:
      title: Bad block array
      type: array
      items:
        $ref: '#/components/schemas/BadBlock'

https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/debug/getters.yaml#L82-L91

BadBlock looks like

BadBlock:
  title: Bad block
  type: object
  required:
    - block
    - hash
    - rlp

https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/schemas/block.yaml#L140-L146

But in alloy, we return a Vec<Block>:

async fn debug_get_bad_blocks(&self) -> TransportResult<Vec<Block>>;

This is the wrong struct (there's no BadBlock struct anyway)

@EdwardJES
Copy link
Contributor

Keen to take the the BadBlock task.

@mattsse
Copy link
Member

mattsse commented Oct 25, 2024

cool @EdwardJES for this we need a new helper type and then simply swap out the return type

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

No branches or pull requests

4 participants
@mattsse @EdwardJES @0xaatif and others