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

feature: restore JSON-RPC 1.0 support #9211

Open
conradoplg opened this issue Feb 5, 2025 · 1 comment
Open

feature: restore JSON-RPC 1.0 support #9211

conradoplg opened this issue Feb 5, 2025 · 1 comment
Labels
C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage

Comments

@conradoplg
Copy link
Collaborator

Motivation

Zebra used to support both JSON-RPC 1.0 or 2.0 in respect to the jsonrpc field (non-existent in 1.0, mandatory with the 2.0 value in 2.0).

However, after the migration to jsonrpsee, this does not work anymore, and tools like zcash-cli stopped working with

{"jsonrpc":"2.0","id":"curltest","error":{"code":-32600,"message":"Invalid request"}}

We might want to restore that support. We already replace requests with jsonrpc = "1.0" (which is nonsensical, since the field did not exist in 1.0, but some tools like lightwalletd use it) to jsonrpc = "2.0" using a middleware; it might be simple to make it add jsonrpc = "2.0" if the jsonrpc field is missing.

Specifications

No response

Complex Code or Requirements

No response

Testing

No response

Related Work

No response

@conradoplg conradoplg added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage labels Feb 5, 2025
@github-project-automation github-project-automation bot moved this to New in Zebra Feb 5, 2025
@str4d
Copy link
Contributor

str4d commented Feb 6, 2025

I have this working in zallet. I based my JSON-RPC handler on zebrad and zebra-rpc (but couldn't depend on either), and in addition to fixing this bug I enhanced it to correctly map responses back to whatever the client expects in responses. I'll try find time to port my patch to zebra.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage
Projects
Status: New
Development

No branches or pull requests

2 participants