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

Ignore the jsonrequestobject argument to the getblocktemplate RPC #5495

Closed
Tracked by #5235 ...
teor2345 opened this issue Oct 28, 2022 · 2 comments · Fixed by #5772
Closed
Tracked by #5235 ...

Ignore the jsonrequestobject argument to the getblocktemplate RPC #5495

teor2345 opened this issue Oct 28, 2022 · 2 comments · Fixed by #5772
Assignees
Labels
A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement

Comments

@teor2345
Copy link
Contributor

teor2345 commented Oct 28, 2022

Motivation

Our stub getblocktemplate RPC will fail if it gets any arguments.

But we want to ignore the optional jsonrequestobject argument instead, because we're not going to support any optional features requested by clients.

Specifications

https://zcash.github.io/rpc/getblocktemplate.html

Designs

Accept an Option argument and ignore it.

Related Work

If we discover that clients need optional features, we can parse the argument and implement them later.

@teor2345 teor2345 added A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium ⚡ A-rpc Area: Remote Procedure Call interfaces labels Oct 28, 2022
@arya2
Copy link
Contributor

arya2 commented Oct 28, 2022

Accept an Option<String> argument and ignore it? Does that work?

It seemed to cause ParseErrors for the JsonParameterObject in submitblock when that was called with only one parameter.

Update: I was wrong, jsonrpc handles Option<T> params as expected, so the design in this ticket would work.

@teor2345
Copy link
Contributor Author

Accept an Option<String> argument and ignore it? Does that work?

It seemed to cause ParseErrors for the JsonParameterObject in submitblock when that was called with only one parameter.

I'm not exactly sure how the jsonrpc library argument processing works, but unlike submitblock, getblocktemplate doesn't need any arguments at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Area: Remote Procedure Call interfaces A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement
Projects
None yet
3 participants