57df77a995
* mixnode: Remove layer computation from mixnode The layer is currently computed locally. This should be moved to the validator, and the mixnode should find this information via a query. Until the query is actually processed, we keep the layer field as None. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Compute layer of bonding mixnode Predictably compute the best layer of a bonding mixnode by putting it on the layer with the fewest mixnodes and, in case of equality, with the smallest index e.g. layer 1 is better then layer 3 if both have the fewest mixnodes. The layer received from the client app is regarded as a preferred option and is only accepted if the number of nodes on the preferred layer is not bigger then the one on the best layer. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Add tests for layer selection Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * mixnode: Upgrade from 0.10.2 to 0.10.3 The config file is changed so that it's only containing the layer if the layer exists. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Move the layer from MixNode to MixNodeBond Remove the option of a client app to propose a preferred layer. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Move from u64 to Layer representation Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Remove Layer::Invalid as it no longer makes sense... ... because layer choice is now present only in the contract. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * contracts: Move layer selection algorithm in `choose_with_fewest` method Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * mixnode: Remove layer altogether Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * mixnode: Refactor upgrading system Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * mixnode: Remove layer from template as well Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net> * Remove invalid field from LayerDistribution Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>