vocdoni/dvote-js

Update gateway selection process by decoupling web3 and dvote gateways

Closed this issue · 0 comments

The gateway selection process and the pool were designed considering that web and dvote gateways can be colocated. This led in
assuming that it is a benefit choosing colocated web3 and dvote gateways and introducing various similar optimizations.

For example, in the gateway selection process, the final {dvote,web3} pairs are:

  1. Ordered based only on the health of the dvote nodes
  2. The web3 pairs are chose trying to match the domain, or if no web3 is colocated at random

The service colocation is no longer the case and the web3 nodes have their own metrics, so the proposal of this issue is to decouple the selection process.
The web3 prioritization should take place (@p4u, @jordipainan ) ->

  1. if there is a peerCount metric favour the highest peercount
  2. orelse choose the node with the highest lastBlockNumber