Files
nym/common/nymsphinx/Cargo.toml
Bogdan-Ștefan Neacşu 57df77a995 Layer selection (#664)
* 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>
2021-07-01 17:56:57 +03:00

38 lines
1.3 KiB
TOML

[package]
name = "nymsphinx"
version = "0.1.0"
authors = ["Jedrzej Stuczynski <andrew@nymtech.net>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
rand_distr = "0.3"
nymsphinx-acknowledgements = { path = "acknowledgements" }
nymsphinx-addressing = { path = "addressing" }
nymsphinx-anonymous-replies = { path = "anonymous-replies" }
nymsphinx-chunking = { path = "chunking" }
nymsphinx-cover = { path = "cover" }
nymsphinx-forwarding = { path = "forwarding" }
nymsphinx-params = { path = "params" }
nymsphinx-types = { path = "types" }
# those dependencies are due to intriducing preparer and receiver. Perpaphs that indicates they should be moved
# to separate crate?
crypto = { path = "../crypto" }
topology = { path = "../topology" }
[dev-dependencies]
mixnet-contract = { path = "../mixnet-contract" }
# do not include this when compiling into wasm as it somehow when combined together with reqwest, it will require
# net2 via tokio-util -> tokio -> mio -> net2
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.nymsphinx-framing]
path = "framing"
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio]
version = "1.4"
features = ["sync"]