-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add a JSON-RPC request for reserved nodes #8704
Conversation
There's a problem in the design: When you process the JSON-RPC request in the service, you call There are two ways I can see to fix that:
The second is IMO a way better solution on principle, but it potentially introduces a race condition in the peerset: if there are some pending |
I don't think I can do that, because I can request Peerset asynchronously via PeersetHandle. So there should be some way to sit and block on Receiver.
I thought about it, however there is no executors in the dependency list of the crate. So I would prefer one of the given solutions:
|
You definitely can. The method you added is on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
bot merge |
Waiting for commit status. |
Bot will approve on the behalf of @tomaka, since they are a team lead, in an attempt to reach the minimum approval count |
* Add boilerplate for JSON-RPC layer for reserved nodes * Add more boilerplate for JSON-RPC layer for reserved nodes * Make JSON-RPC layer for reserved nodes async * Use more realistic data in reserver_peers tests * Make JSON-RPC layer for reserved nodes blocking * Apply tomaka's suggestion to reduce .into_iter() for an iter Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Fixes #8147
Adds a
reservedPeers
rpc call to return peers added/removed throughaddReservedPeer
andremoveReservedPeer
.Yes. The work is in progress