Files
darkfi/Cargo.toml
parazyd 55ee919906 net: Perform full p2p code cleanup and improve certain pieces.
Notable changes:

* Rewritten transport protocols into Dialer and Listener (Nym is TODO)

  This simplifies using the transports a lot, as can be seen for example
  in src/rpc, and generally around the p2p library. It also defines features
  for each transport (all of which are enabled by default). We drop the
  socks client for Tor and Nym and use first-class support with the Arti Tor
  library, and nym-sphinx/nym-websockets (to be used with nym-client).

* Outbound session healing

  The outbound session will now poll and try to fill all the requested
  slots more efficiently, and if needed, will activate peer discovery to
  find more peers if we can't connect to any known ones. Also if we're
  unable to connect to any, we shall drop them from our set.

  Additionally, transport mixing is enabled by default, so when we're
  allowing transport mixing, and we use Tor, we will also be able to connect
  to other transports that Tor can connect to (e.g. tcp://).

* Unix socket transport dropped

  We haven't been using this, and it seems we're not going down this path,
  so the code has been obsoleted and removed.

* TLS session verification

  We fully verify server and client TLS certificates upon connection so
  we're able to perform TLS1.3 with forward secrecy.

* lilith pruning

  lilith now periodically prunes known peers from its sets if it's unable
  to connect to them.
2023-06-29 13:13:15 +02:00

344 lines
7.4 KiB
TOML

[package]
name = "darkfi"
version = "0.4.1"
homepage = "https://dark.fi"
description = "Anonymous. Uncensored. Sovereign."
authors = ["Dyne.org foundation <foundation@dyne.org>"]
repository = "https://github.com/darkrenaissance/darkfi"
license = "AGPL-3.0-only"
edition = "2021"
[lib]
name = "darkfi"
doctest = false
#[profile.release]
#debug = true
#lto = "fat"
#codegen-units = 1
[workspace]
members = [
"bin/zkas",
#"bin/cashierd",
"bin/darkfid",
"bin/drk",
"bin/faucetd",
"bin/fud/fu",
"bin/fud/fud",
"bin/genev/genevd",
"bin/genev/genev-cli",
"bin/ircd",
"bin/darkirc",
"bin/dnetview",
#"bin/dao/daod",
#"bin/dao/dao-cli",
"bin/tau/taud",
"bin/tau/tau-cli",
#"bin/darkwiki/darkwikid",
#"bin/darkwiki/darkwiki-cli",
"bin/dhtd/dhtd",
"bin/vanityaddr",
"bin/lilith",
"bin/zktool",
"src/sdk",
"src/sdk/python",
"src/serial",
"src/serial/derive",
"src/serial/derive-internal",
"src/contract/test-harness",
"src/contract/money",
"src/contract/dao",
"src/contract/consensus",
"src/contract/deployooor",
"example/dchat",
]
[dependencies]
# Hard dependencies
libc = "0.2.144"
log = "0.4.19"
thiserror = "1.0.40"
# async-runtime
async-std = {version = "1.12.0", features = ["attributes"], optional = true}
async-trait = {version = "0.1.68", optional = true}
futures = {version = "0.3.28", optional = true}
smol = {version = "1.3.0", optional = true}
# Networking
async-rustls = {version = "0.4.0", features = ["dangerous_configuration"], optional = true}
iprange = {version = "0.6.7", optional = true}
ipnet = {version = "2.7.2", optional = true}
socket2 = {version = "0.5.3", optional = true, features = ["all"]}
# Pluggable Transports
arti-client = {version = "0.9.1", default-features = false, features = ["async-std", "rustls", "onion-service-client"], optional = true}
# TODO: nym ( Read this to figure out impl https://github.com/ChainSafe/rust-libp2p-nym )
# TLS cert utilities
ed25519-compact = {version = "2.0.4", optional = true}
rcgen = {version = "0.10.0", optional = true}
rustls-pemfile = {version = "1.0.2", optional = true}
x509-parser = {version = "0.15.0", features = ["validate", "verify"], optional = true}
# Encoding
bs58 = {version = "0.5.0", optional = true}
hex = {version = "0.4.3", optional = true}
serde_json = {version = "1.0.96", optional = true}
serde = {version = "1.0.164", features = ["derive"], optional = true}
semver = {version = "1.0.17", optional = true}
structopt = {version= "0.3.26", optional = true}
structopt-toml = {version= "0.5.1", optional = true}
toml = {version = "0.7.4", optional = true}
# Big float high precision arithmetics
dashu = { version = "0.3.1", optional=true }
# Utilities
# TODO: check chrono usage and impl our own
chrono = {version = "0.4.26", optional = true}
darkfi-serial = {path = "src/serial", optional = true}
darkfi-derive = {path = "src/serial/derive", optional = true}
darkfi-derive-internal = {path = "src/serial/derive-internal", optional = true}
indexmap = {version = "1.9.3", optional = true}
itertools = {version = "0.10.5", optional = true}
lazy_static = {version = "1.4.0", optional = true}
# TODO: Test without serde
url = {version = "2.4.0", features = ["serde"], optional = true}
# Misc
# TODO: Implement something simple and kill these deps
indicatif = {version = "0.17.5", optional = true}
simplelog = {version = "0.12.1", optional = true}
ripemd = {version = "0.1.3", optional = true}
# Crypto
rand = {version = "0.8.5", optional = true}
blake3 = {version = "1.4.0", features = ["rayon"], optional = true}
crypto_api_chachapoly = {version = "0.5.0", optional = true}
halo2_proofs = {version = "0.3.0", optional = true}
halo2_gadgets = {version = "0.3.0", optional = true}
# Smart contract runtime
darkfi-sdk = {path = "src/sdk", optional = true}
wasmer = {version = "3.3.0", optional = true}
wasmer-compiler-singlepass = {version = "3.3.0", optional = true}
wasmer-middlewares = {version = "3.3.0", optional = true}
# Wallet management
rusqlite = {version = "0.29.0", optional = true}
# Blockchain store
sled = {version = "0.34.7", optional = true}
sled-overlay = {version = "0.0.7", optional = true}
# Temporary version lock
curve25519-dalek = {version = "=4.0.0-rc.2", default-features = false, optional = true}
[dev-dependencies]
clap = {version = "4.3.3", features = ["derive"]}
halo2_proofs = {version = "0.3.0", features = ["dev-graph", "gadget-traces", "sanity-checks"]}
halo2_gadgets = {version = "0.3.0", features = ["test-dev-graph", "test-dependencies"]}
plotters = "0.3.4"
easy-parallel = "3.3.0"
prettytable-rs = "0.10.0"
# -----BEGIN LIBRARY FEATURES-----
[features]
p2p-transport-tcp = []
p2p-transport-tor = ["arti-client"]
p2p-transport-nym = []
async-runtime = [
"async-std",
"async-trait",
"futures",
"smol",
]
blockchain = [
"blake3",
"bs58", # <-- TODO: remove after we get rid of json for notifications
"chrono",
"crypto_api_chachapoly",
"dashu",
"halo2_proofs",
"lazy_static",
"rand",
"sled",
"sled-overlay",
"url",
"async-runtime",
"darkfi-sdk",
"darkfi-serial/crypto",
"net",
"rpc",
"tx",
"util",
"wallet",
"wasm-runtime",
]
dht = [
"blake3",
"chrono",
"rand",
"async-runtime",
"darkfi-serial",
"darkfi-serial/collections",
"darkfi-serial/hash",
"net",
]
event-graph = [
"blake3",
"chrono",
"hex",
"rand",
"async-runtime",
"darkfi-serial/hash",
"net",
]
net = [
"ed25519-compact",
"async-rustls",
"hex",
"iprange",
"ipnet",
"structopt",
"structopt-toml",
"rand",
"rcgen",
"rustls-pemfile",
"x509-parser",
"semver",
"serde",
"serde_json",
"socket2",
"url",
"async-runtime",
"darkfi-serial",
"darkfi-serial/async",
"darkfi-serial/url",
"system",
"util",
"p2p-transport-tcp",
"p2p-transport-tor",
"p2p-transport-nym",
]
raft = [
"chrono",
"rand",
"sled",
"async-runtime",
"darkfi-serial",
"net",
"util",
]
rpc = [
"hex",
"rand",
"serde",
"serde_json",
"url",
"async-runtime",
"darkfi-serial",
"net",
]
system = [
"rand",
"async-runtime",
]
tx = [
"blake3",
"rand",
"async-runtime",
"darkfi-sdk",
"darkfi-serial",
"zk",
]
util = [
"chrono",
"simplelog",
"serde",
"serde_json",
"toml",
"url",
"darkfi-serial",
]
wallet = [
"async-std",
"rand",
"rusqlite",
"darkfi-serial",
"util",
]
wasm-runtime = [
"wasmer",
"wasmer-compiler-singlepass",
"wasmer-middlewares",
"blockchain",
"darkfi-sdk",
]
zk = [
"halo2_proofs",
"halo2_gadgets",
"rand",
"darkfi-sdk",
"zkas",
]
zkas = [
"indexmap",
"itertools",
"darkfi-serial",
]
# -----END LIBRARY FEATURES-----
[[example]]
name = "net"
path = "example/net.rs"
required-features = ["async-runtime", "net"]
[[example]]
name = "zk"
path = "example/zk.rs"
required-features = ["zk"]
[[example]]
name = "zk-inclusion-proof"
path = "example/zk-inclusion-proof.rs"
required-features = ["zk"]
[patch.crates-io]
arti-client = {git="https://gitlab.torproject.org/tpo/core/arti", rev="08d1155cb92568176d8b54b85ec5437dff112e01"}
halo2_proofs = {git="https://github.com/parazyd/halo2", branch="v3"}
halo2_gadgets = {git="https://github.com/parazyd/halo2", branch="v3"}