-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layer selection #664
Layer selection #664
Conversation
I see you interpreted the ticket slightly differently than what I initially had in mind. I'm not saying it's good or wrong. I guess we would need an external pair of eyes on it, @durch or @futurechimp . What I had in mind was to completely get rid of So basically when mixnode bonds, contract says "hey, thanks for bonding, you're now on layer X" |
Yep, I thought of that originally too. I kind of changed my mind on the way though, as it seemed to offer more flexibility for the mixnode operator.
If that is the case, then I can remove it completely now and be done with it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One additional comment: we could now remove LayerDistribution.invalid
field as it will be impossible to set it. Perhaps it might be worth to have a choose_with_fewest
method on it to more easily find appropriate layer?
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>
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>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
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>
Remove the option of a client app to propose a preferred layer. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
... because layer choice is now present only in the contract. Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
pub sphinx_key: SphinxKey, | ||
/// Base58 encoded ed25519 EdDSA public key. | ||
pub identity_key: IdentityKey, | ||
pub version: String, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, Deserialize, PartialEq, Serialize, JsonSchema)] | ||
pub enum Layer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More type-safety - I like it
Signed-off-by: Bogdan-Ștefan Neacșu <bogdan@nymtech.net>
No description provided.