Open RedaOps opened 6 months ago
I can't remember why I didn't use jsonrpsee, I think I couldn't set some timeout or I had some issue customizing something... but in general if we can replace the code we have with library functions I will welcome a PR :)
Right now, the Orchestrator uses
bitcoincore_rpc::jsonrpc::Response
struct for deserialising responses from MPC nodes.This is working as expected, since the structure follows the standardised jsonrpc response, and nodes send replies using
jsonrpsee_core::RpcResult
. However, we should use the same package/structure on both sides.On top of that, I suggest using the
jsonrpsee
client for jsonrpc requests, instead of thereqwest
library. (examples)I suggest using jsonrpsee's
Response
struct for deserialization in the following places:https://github.com/sigma0-xyz/zkbitcoin/blob/601b6a4ad94db02dff358c2f7baf92912c78e687/src/committee/orchestrator.rs#L174-L185
https://github.com/sigma0-xyz/zkbitcoin/blob/601b6a4ad94db02dff358c2f7baf92912c78e687/src/committee/orchestrator.rs#L344-L356
https://github.com/sigma0-xyz/zkbitcoin/blob/601b6a4ad94db02dff358c2f7baf92912c78e687/src/committee/orchestrator.rs#L407-L420