vocdoni/dvote-js

Error when wev3 gateway does not support `net_peerCount`

emmdim opened this issue · 0 comments

net_peerCount is currently use as node synchornization metric, considering that nodes that have no peers cannot be synced and are rejected. Nevertheless some web3 nodes do not suport this call.

Provisional solution:

  1. If the net_peerCount call fails then return a 0 value and do not reject the node. also store the value for the prioritization process.
  2. Additionally make a call to get the lastBlockNumber known, and use this in a following scheme to priorize the nodes that do not have peers in a best-effort manner based on the block number. The prioritization implementation will be the subject of another issue

@brickpop @p4u