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

Implement the getdifficulty RPC #6055

Closed
teor2345 opened this issue Jan 31, 2023 · 0 comments · Fixed by #6099
Closed

Implement the getdifficulty RPC #6055

teor2345 opened this issue Jan 31, 2023 · 0 comments · Fixed by #6099
Assignees
Labels
A-rpc Area: Remote Procedure Call interfaces C-enhancement Category: This is an improvement

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jan 31, 2023

Motivation

This is one of the initial RPCs called by node-stratum-pool:
https://github.com/s-nomp/node-stratum-pool/blob/d86ae73f8ff968d9355bb61aac05e0ebef36ccb5/lib/pool.js#L387-L392

It is required to detect proof of work or proof of stake coins:
https://github.com/s-nomp/node-stratum-pool/blob/d86ae73f8ff968d9355bb61aac05e0ebef36ccb5/lib/pool.js#L424-L427

The pool won't run if this RPC returns an error:
https://github.com/s-nomp/node-stratum-pool/blob/d86ae73f8ff968d9355bb61aac05e0ebef36ccb5/lib/pool.js#L413-L416

Specifications

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

Complex Code or Requirements

We have an existing state request for the difficulty, so we could just use that for now?
(That state request also gets the history tree, which we might want to change in a later PR, but only if it impacts performance.)

Testing

We can do a snapshot test and manually test with s-nomp or equihash-solomining.

Related Work

I'm pretty sure this blocks #5934 with s-nomp and equihash-solomining.

@teor2345 teor2345 added 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 Jan 31, 2023
@mpguerra mpguerra added this to Zebra Jan 31, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Zebra Jan 31, 2023
@oxarbitrage oxarbitrage self-assigned this Feb 1, 2023
@mergify mergify bot closed this as completed in #6099 Feb 7, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Zebra Feb 7, 2023
@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Mar 16, 2023
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 C-enhancement Category: This is an improvement
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants