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

core/types: fix json encoding for Request #30422

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

islishude
Copy link
Contributor

@islishude islishude commented Sep 12, 2024

The #29431 adds requests to the block type

if block.Header().RequestsHash != nil {
fields["requests"] = block.Requests()
}

But it doesn't have correct json encoding, the rpc always returns "requests": [{}]

@fjl
Copy link
Contributor

fjl commented Sep 12, 2024

Also fixed by #30425

@islishude
Copy link
Contributor Author

I just checked out #30425, it uses a raw bytes for both engine api and jsonrpc.

I think it will be still useful to jsonrpc if we have a readable data.

so I just added an intermedia type for the Request, the json result has a type and data like following.

[
  {
    "type": 0,
    "data": {
      "pubkey": "0xab89324e578c5b0162f260340bf9505080dab873c5269d112f95a90b6743442b918c36c4bfeadeec840266d801966a31",
      "withdrawalCredentials": "0x01000000000000000000000005562e2e3725f641a140a098ec720f65595ae58d",
      "amount": "0x773594000",
      "signature": "0xb1921ba4029eaa2e7d783ae4f0f3417b4a0b3ef5691eb4d3a717355479ec89cb28dfac62b94815fc4939492bd00460430dafc49006a0196574741141b0acca886009d85da019039977a7cdb6c995a5691bd87914f95783c36df9f0470e6b302e",
      "index": "0x77a4190000000000"
    }
  }
]

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