conflux-rust icon indicating copy to clipboard operation
conflux-rust copied to clipboard

Rpc to check node status, and related errors.

Open yangzhe1990 opened this issue 4 years ago • 2 comments

Let's say, the full node are disconnected from the Conflux network, after a while, it should not serve blockchain related rpc any more.

Possible unhealthy status can be:

NOT_CATCHED_UP NO_TRUSTED_PEERS NO_PEERS PIVOT_CHAIN_UNSTABLE SUSPICIOUS_MINING_RATE SUSPICIOUS_PIVOT_TIMESTAMP ... (the list can go on)

For each related rpc call, we should at first check the system status to determine whether we can continue to serve the rpc under each condition.

For light node, since it has to forward queries to other peers / resend the request if it times out or if the peer replied malicious result. For each retry, the light node should check its status again.

Note that this status rpc is different from start phase, because unhealthy status can occur at any phase.

yangzhe1990 avatar Apr 09 '20 13:04 yangzhe1990

Here are some useful but missing rpc functions implemented in Parity https://wiki.parity.io/JSONRPC-parity-module#network-information

We should consider add some of them.

yangzhe1990 avatar Apr 09 '20 13:04 yangzhe1990

We also need an rpc to let client know the rpc protocol version. I think the status() rpc call is a good place.

yangzhe1990 avatar Apr 09 '20 14:04 yangzhe1990