From 751467fff16937734b01c85090f5c1e53c7a331e Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 27 Nov 2024 21:32:00 +0200 Subject: [PATCH 1/2] Update Subspace to `mainnet-2024-nov-27` release --- Cargo.lock | 94 +++++++++++++++++++------------------------ Cargo.toml | 36 ++++++++--------- README.md | 4 +- src/backend.rs | 33 ++++++++++----- src/backend/farmer.rs | 4 +- src/backend/node.rs | 2 + 6 files changed, 89 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7303358..9870dec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -788,15 +788,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener 2.5.3", -] - [[package]] name = "async-oneshot" version = "0.5.9" @@ -2065,7 +2056,7 @@ checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "cross-domain-message-gossip" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "domain-block-preprocessor", "fp-account", @@ -2584,7 +2575,7 @@ dependencies = [ [[package]] name = "domain-block-preprocessor" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -2617,7 +2608,7 @@ dependencies = [ [[package]] name = "domain-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "fp-account", "frame-support", @@ -9905,7 +9896,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "futures", @@ -9946,7 +9937,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace-rpc" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-oneshot", "futures", @@ -9981,7 +9972,7 @@ dependencies = [ [[package]] name = "sc-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "sc-client-api", "sc-executor", @@ -10342,7 +10333,7 @@ dependencies = [ [[package]] name = "sc-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "core_affinity", "derive_more 1.0.0", @@ -10577,7 +10568,7 @@ dependencies = [ [[package]] name = "sc-subspace-block-relay" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -10603,12 +10594,12 @@ dependencies = [ [[package]] name = "sc-subspace-chain-specs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" [[package]] name = "sc-subspace-sync-common" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "array-bytes", "futures", @@ -11321,7 +11312,7 @@ dependencies = [ [[package]] name = "sp-auto-id" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "parity-scale-codec", "scale-info", @@ -11345,7 +11336,7 @@ dependencies = [ [[package]] name = "sp-block-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -11440,7 +11431,7 @@ dependencies = [ [[package]] name = "sp-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "log", @@ -11556,7 +11547,7 @@ dependencies = [ [[package]] name = "sp-domain-digests" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -11565,7 +11556,7 @@ dependencies = [ [[package]] name = "sp-domain-sudo" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "parity-scale-codec", @@ -11576,7 +11567,7 @@ dependencies = [ [[package]] name = "sp-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "blake2 0.10.6", "domain-runtime-primitives", @@ -11608,7 +11599,7 @@ dependencies = [ [[package]] name = "sp-domains-fraud-proof" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "domain-block-preprocessor", "domain-runtime-primitives", @@ -11643,7 +11634,7 @@ dependencies = [ [[package]] name = "sp-executive" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "parity-scale-codec", @@ -11734,7 +11725,7 @@ dependencies = [ [[package]] name = "sp-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "async-trait", "frame-support", @@ -11756,7 +11747,7 @@ dependencies = [ [[package]] name = "sp-messenger-host-functions" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "domain-block-preprocessor", "parity-scale-codec", @@ -11813,7 +11804,7 @@ dependencies = [ [[package]] name = "sp-objects" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "sp-api", "subspace-core-primitives", @@ -11999,7 +11990,7 @@ dependencies = [ [[package]] name = "sp-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "parity-scale-codec", "scale-info", @@ -12139,7 +12130,7 @@ dependencies = [ [[package]] name = "space-acres" -version = "0.2.4" +version = "0.2.5" dependencies = [ "anyhow", "arc-swap", @@ -12388,7 +12379,7 @@ dependencies = [ [[package]] name = "subspace-archiving" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "parity-scale-codec", "rayon", @@ -12402,7 +12393,7 @@ dependencies = [ [[package]] name = "subspace-core-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "blake3", "bytes", @@ -12421,7 +12412,7 @@ dependencies = [ [[package]] name = "subspace-erasure-coding" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "kzg", "rust-kzg-blst", @@ -12432,7 +12423,7 @@ dependencies = [ [[package]] name = "subspace-fake-runtime-api" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "domain-runtime-primitives", "frame-support", @@ -12464,7 +12455,7 @@ dependencies = [ [[package]] name = "subspace-farmer" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "anyhow", "async-lock", @@ -12519,7 +12510,7 @@ dependencies = [ [[package]] name = "subspace-farmer-components" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "anyhow", "async-lock", @@ -12552,7 +12543,7 @@ dependencies = [ [[package]] name = "subspace-kzg" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "derive_more 1.0.0", "kzg", @@ -12567,7 +12558,7 @@ dependencies = [ [[package]] name = "subspace-metrics" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "actix-web", "prometheus", @@ -12578,15 +12569,14 @@ dependencies = [ [[package]] name = "subspace-networking" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ - "async-mutex", + "async-lock", "async-trait", "backoff", "bytes", "clap 4.5.20", "derive_more 1.0.0", - "either", "event-listener-primitives", "fs2", "futures", @@ -12618,7 +12608,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "chacha20", "derive_more 1.0.0", @@ -12634,7 +12624,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space-gpu" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "blst", "cc", @@ -12647,7 +12637,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "aes 0.9.0-pre.2", "subspace-core-primitives", @@ -12657,7 +12647,7 @@ dependencies = [ [[package]] name = "subspace-rpc-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "hex", "parity-scale-codec", @@ -12670,7 +12660,7 @@ dependencies = [ [[package]] name = "subspace-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "frame-support", "frame-system", @@ -12686,10 +12676,11 @@ dependencies = [ [[package]] name = "subspace-service" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "array-bytes", "async-channel 1.9.0", + "async-lock", "async-trait", "cross-domain-message-gossip", "domain-runtime-primitives", @@ -12716,9 +12707,7 @@ dependencies = [ "sc-executor", "sc-informant", "sc-network", - "sc-network-light", "sc-network-sync", - "sc-network-transactions", "sc-offchain", "sc-proof-of-time", "sc-rpc", @@ -12731,7 +12720,6 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", - "sc-utils", "schnellru", "schnorrkel", "sp-api", @@ -12774,7 +12762,7 @@ dependencies = [ [[package]] name = "subspace-verification" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=8fe58495741b547af5da8d3b5349b42d3145286e#8fe58495741b547af5da8d3b5349b42d3145286e" +source = "git+https://github.com/subspace/subspace?rev=f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c#f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" dependencies = [ "parity-scale-codec", "schnorrkel", diff --git a/Cargo.toml b/Cargo.toml index 7c83b52..34912b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "space-acres" description = "Space Acres is an opinionated GUI application for farming on Autonomys Network" license = "0BSD" -version = "0.2.4" +version = "0.2.5" authors = ["Nazar Mokrynskyi "] repository = "https://github.com/autonomys/space-acres" edition = "2021" @@ -71,13 +71,13 @@ reqwest = { version = "0.12.8", default-features = false, features = ["json", "r sc-client-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-client-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-consensus-slots = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } +sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-network-types = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-rpc = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-storage-monitor = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } +sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } sc-utils = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } schnellru = "0.2.3" semver = "1.0.23" @@ -86,23 +86,23 @@ serde_json = "1.0.132" simple_moving_average = "1.0.2" sp-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sp-consensus = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } +sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } sp-core = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sp-objects = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } +sp-objects = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } sp-runtime = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e", default-features = false } -subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-networking = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e", optional = true } -subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } -subspace-service = { git = "https://github.com/subspace/subspace", rev = "8fe58495741b547af5da8d3b5349b42d3145286e" } +subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c", default-features = false } +subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-networking = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c", optional = true } +subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } +subspace-service = { git = "https://github.com/subspace/subspace", rev = "f4a19dd5bc59c4e2480bd13ce86c73fdc4cc8c2c" } supports-color = "3.0.1" sys-locale = "0.3.1" tempfile = "3.13.0" diff --git a/README.md b/README.md index 33642ff..71e5376 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,13 @@ installations from 3g. Current features: -* Configuration (reward address, node location, multiple farms, P2P ports) +* Configuration (reward address, node location, multiple farms, P2P ports and some advanced options) * Node sync with displayed progress, speed and ETA * Farmer plotting/farming piece cache/plotting/replotting progress display and speed calculation * Farmer auditing/proving performance indicators * Farmer sector state visualization +* Desktop notifications with rewards and other notable events +* Very easy to use Upcoming features/capabilities: see open issues, also consider contributing if something is missing! diff --git a/src/backend.rs b/src/backend.rs index 1f46090..5b69976 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -16,7 +16,7 @@ use crate::backend::node::{ dsn_bootstrap_nodes, BlockImportedNotification, ChainInfo, ChainSpec, ConsensusNode, ConsensusNodeCreationError, SyncState, GENESIS_HASH, }; -use async_lock::RwLock as AsyncRwLock; +use async_lock::{RwLock as AsyncRwLock, Semaphore}; use backoff::ExponentialBackoff; use future::FutureExt; use futures::channel::mpsc; @@ -63,6 +63,8 @@ const PIECE_GETTER_MAX_RETRIES: u16 = 7; const GET_PIECE_INITIAL_INTERVAL: Duration = Duration::from_secs(5); /// Defines max duration between get_piece calls. const GET_PIECE_MAX_INTERVAL: Duration = Duration::from_secs(40); +/// Multiplier on top of outgoing connections number for piece downloading purposes +const PIECE_PROVIDER_MULTIPLIER: usize = 10; #[derive(Debug, Clone)] struct PieceGetterWrapper( @@ -417,20 +419,28 @@ async fn load( let plotted_pieces = Arc::new(AsyncRwLock::new(PlottedPieces::default())); - let (maybe_node_client, node, node_runner, network_keypair, farmer_cache, farmer_cache_worker) = - create_networking_stack( - &config, - GENESIS_HASH.to_string(), - &chain_spec, - Arc::downgrade(&plotted_pieces), - notifications_sender, - ) - .await?; + let ( + maybe_node_client, + node, + node_runner, + network_keypair, + farmer_cache, + farmer_cache_worker, + out_connections, + ) = create_networking_stack( + &config, + GENESIS_HASH.to_string(), + &chain_spec, + Arc::downgrade(&plotted_pieces), + notifications_sender, + ) + .await?; let kzg = Kzg::new(); let piece_provider = PieceProvider::new( node.clone(), SegmentCommitmentPieceValidator::new(node.clone(), maybe_node_client.clone(), kzg.clone()), + Semaphore::new(out_connections as usize * PIECE_PROVIDER_MULTIPLIER), ); let piece_getter = PieceGetterWrapper::new(FarmerPieceGetter::new( @@ -776,6 +786,7 @@ async fn create_networking_stack( Keypair, FarmerCache, FarmerCacheWorker, + u32, )> { notifications_sender .send(BackendNotification::Loading( @@ -881,6 +892,7 @@ async fn create_networking_stack( network_options.pending_in_connections = 500; network_options.pending_out_connections = 500; } + let out_connections = network_options.out_connections; let maybe_node_client = MaybeNodeClient::default(); let (farmer_cache, farmer_cache_worker) = FarmerCache::new( @@ -912,6 +924,7 @@ async fn create_networking_stack( network_keypair, farmer_cache, farmer_cache_worker, + out_connections, )) } diff --git a/src/backend/farmer.rs b/src/backend/farmer.rs index e66a5e1..33df233 100644 --- a/src/backend/farmer.rs +++ b/src/backend/farmer.rs @@ -6,7 +6,7 @@ use crate::backend::utils::{Handler, HandlerFn}; use crate::backend::PieceGetterWrapper; use crate::PosTable; use anyhow::anyhow; -use async_lock::{Mutex as AsyncMutex, RwLock as AsyncRwLock}; +use async_lock::{Mutex as AsyncMutex, RwLock as AsyncRwLock, Semaphore}; use bytesize::ByteSize; use event_listener_primitives::HandlerId; use futures::channel::{mpsc, oneshot}; @@ -45,7 +45,7 @@ use subspace_farmer::utils::{ use subspace_farmer_components::plotting::PlottedSector; use subspace_kzg::Kzg; use thread_priority::ThreadPriority; -use tokio::sync::{watch, Barrier, Semaphore}; +use tokio::sync::{watch, Barrier}; use tracing::{debug, error, info, info_span, Instrument}; /// Minimal cache percentage, there is no need in setting it higher diff --git a/src/backend/node.rs b/src/backend/node.rs index 1a1d471..7a13cb6 100644 --- a/src/backend/node.rs +++ b/src/backend/node.rs @@ -509,6 +509,8 @@ pub(super) async fn create_consensus_node( subspace_networking: SubspaceNetworking::Reuse { node, bootstrap_nodes: dsn_bootstrap_nodes, + // This will not be used since we provide piece getter explicitly below + max_connections: 0, }, dsn_piece_getter: Some(piece_getter), is_timekeeper: false, From 4a3aafb555aa442206bb51b8cb7a2eb226d02b6f Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 27 Nov 2024 21:49:02 +0200 Subject: [PATCH 2/2] Do not fail when there are no tests to run --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 91d1ab6..3e726be 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -269,5 +269,5 @@ jobs: with: tool: cargo-nextest - - name: cargo nextest run --locked - run: cargo -Zgitoxide -Zgit nextest run --locked + - name: cargo nextest run --locked --no-tests pass + run: cargo -Zgitoxide -Zgit nextest run --locked --no-tests pass