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 getpeerinfo RPC #5723

Closed
Tracked by #5234
teor2345 opened this issue Nov 25, 2022 · 3 comments · Fixed by #5951
Closed
Tracked by #5234

Implement the getpeerinfo RPC #5723

teor2345 opened this issue Nov 25, 2022 · 3 comments · Fixed by #5951
Assignees
Labels
A-concurrency Area: Async code, needs extra work to make it work properly. A-network Area: Network protocol updates or fixes A-rpc Area: Remote Procedure Call interfaces C-enhancement Category: This is an improvement

Comments

@teor2345
Copy link
Contributor

Motivation

Some mining pools use the getpeerinfo RPC to make sure the mining pool is still connected to peers.

Specifications

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

Designs

  • Pass the shared zebra-network address book to the RPC server
  • Call address_book.recently_live_peers() to get the peers that were recently connected
    • The shared address book is protected by a mutex, so we want to clone it to drop the mutex as soon as possible.
    • Doing the mutex lock and clone in a separate function will make sure this happens.
  • Turn the list of MetaAddrs into a list of peerinfo records

We just need to provide the addr field for now, we can add more fields if mining pools ask for them.

@teor2345 teor2345 added C-enhancement Category: This is an improvement S-needs-triage Status: A bug report needs triage P-Medium ⚡ A-network Area: Network protocol updates or fixes A-rpc Area: Remote Procedure Call interfaces labels Nov 25, 2022
@mpguerra
Copy link
Contributor

We should implement these, however since they are not strictly mining RPCs they don't fall within the scope of the MVP.

@teor2345
Copy link
Contributor Author

We should implement these, however since they are not strictly mining RPCs they don't fall within the scope of the MVP.

Some mining pools won't be able to use Zebra until we implement these RPCs.

@arya2 arya2 assigned arya2 and unassigned arya2 Dec 8, 2022
@arya2 arya2 self-assigned this Jan 2, 2023
@teor2345 teor2345 added the A-concurrency Area: Async code, needs extra work to make it work properly. label Jan 11, 2023
@mergify mergify bot closed this as completed in #5951 Jan 17, 2023
@mpguerra
Copy link
Contributor

@arya2 can we get an estimate here please?

@mpguerra mpguerra moved this to 🆕 New in Zebra Jan 24, 2023
@mpguerra mpguerra added this to Zebra Jan 24, 2023
@mpguerra mpguerra moved this from 🆕 New to ✅ Done in Zebra Jan 24, 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-concurrency Area: Async code, needs extra work to make it work properly. A-network Area: Network protocol updates or fixes 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