diff --git a/Cargo.lock b/Cargo.lock index ad45e58..685cdb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1987,7 +1987,7 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "cross-domain-message-gossip" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "futures", "parity-scale-codec", @@ -2474,7 +2474,7 @@ dependencies = [ [[package]] name = "domain-block-preprocessor" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -2503,7 +2503,7 @@ dependencies = [ [[package]] name = "domain-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "fp-account", "frame-support", @@ -6696,7 +6696,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "frame-system", @@ -6748,7 +6748,7 @@ dependencies = [ [[package]] name = "pallet-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", @@ -6774,7 +6774,7 @@ dependencies = [ [[package]] name = "pallet-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-benchmarking", "frame-support", @@ -6811,7 +6811,7 @@ dependencies = [ [[package]] name = "pallet-offences-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "frame-system", @@ -6825,7 +6825,7 @@ dependencies = [ [[package]] name = "pallet-rewards" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "frame-system", @@ -6837,7 +6837,7 @@ dependencies = [ [[package]] name = "pallet-runtime-configs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-benchmarking", "frame-support", @@ -6851,7 +6851,7 @@ dependencies = [ [[package]] name = "pallet-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-benchmarking", "frame-support", @@ -6874,7 +6874,7 @@ dependencies = [ [[package]] name = "pallet-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "frame-system", @@ -6926,7 +6926,7 @@ dependencies = [ [[package]] name = "pallet-transaction-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "frame-system", @@ -6982,7 +6982,7 @@ dependencies = [ [[package]] name = "pallet-transporter" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", @@ -8561,7 +8561,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "futures", @@ -8601,7 +8601,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace-rpc" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-oneshot", "futures", @@ -8632,7 +8632,7 @@ dependencies = [ [[package]] name = "sc-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "sc-client-api", "sc-executor", @@ -8971,7 +8971,7 @@ dependencies = [ [[package]] name = "sc-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "atomic", "core_affinity", @@ -9193,7 +9193,7 @@ dependencies = [ [[package]] name = "sc-subspace-block-relay" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-channel", "async-trait", @@ -9218,7 +9218,7 @@ dependencies = [ [[package]] name = "sc-subspace-chain-specs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" [[package]] name = "sc-sysinfo" @@ -9944,7 +9944,7 @@ dependencies = [ [[package]] name = "sp-block-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -10038,7 +10038,7 @@ dependencies = [ [[package]] name = "sp-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "log", @@ -10174,7 +10174,7 @@ dependencies = [ [[package]] name = "sp-domain-digests" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -10183,7 +10183,7 @@ dependencies = [ [[package]] name = "sp-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "blake2 0.10.6", "domain-runtime-primitives", @@ -10215,7 +10215,7 @@ dependencies = [ [[package]] name = "sp-domains-fraud-proof" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "domain-block-preprocessor", "domain-runtime-primitives", @@ -10247,7 +10247,7 @@ dependencies = [ [[package]] name = "sp-executive" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "parity-scale-codec", @@ -10338,7 +10338,7 @@ dependencies = [ [[package]] name = "sp-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "frame-support", "hash-db", @@ -10357,7 +10357,7 @@ dependencies = [ [[package]] name = "sp-messenger-host-functions" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "domain-block-preprocessor", "parity-scale-codec", @@ -10417,7 +10417,7 @@ dependencies = [ [[package]] name = "sp-objects" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "sp-api", "subspace-core-primitives", @@ -10604,7 +10604,7 @@ dependencies = [ [[package]] name = "sp-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "parity-scale-codec", "scale-info", @@ -10748,10 +10748,11 @@ dependencies = [ [[package]] name = "space-acres" -version = "0.1.7" +version = "0.1.8" dependencies = [ "anyhow", "arc-swap", + "async-lock 3.3.0", "async-trait", "backoff", "bytesize", @@ -10774,7 +10775,6 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "parking_lot 0.12.1", - "rayon", "relm4", "relm4-components", "relm4-icons", @@ -10944,7 +10944,7 @@ dependencies = [ [[package]] name = "subspace-archiving" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "parity-scale-codec", "rayon", @@ -10957,7 +10957,7 @@ dependencies = [ [[package]] name = "subspace-core-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "blake3", "derive_more", @@ -10980,7 +10980,7 @@ dependencies = [ [[package]] name = "subspace-erasure-coding" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "kzg", "rust-kzg-blst", @@ -10990,7 +10990,7 @@ dependencies = [ [[package]] name = "subspace-farmer" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "anyhow", "async-lock 3.3.0", @@ -11048,7 +11048,7 @@ dependencies = [ [[package]] name = "subspace-farmer-components" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-lock 3.3.0", "async-trait", @@ -11079,7 +11079,7 @@ dependencies = [ [[package]] name = "subspace-metrics" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "actix-web", "prometheus", @@ -11090,7 +11090,7 @@ dependencies = [ [[package]] name = "subspace-networking" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-mutex", "async-trait", @@ -11128,7 +11128,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "chacha20", "derive_more", @@ -11141,7 +11141,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "aes", "subspace-core-primitives", @@ -11151,7 +11151,7 @@ dependencies = [ [[package]] name = "subspace-rpc-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "hex", "serde", @@ -11163,7 +11163,7 @@ dependencies = [ [[package]] name = "subspace-runtime" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", @@ -11218,7 +11218,7 @@ dependencies = [ [[package]] name = "subspace-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "pallet-transaction-payment", "sp-core", @@ -11229,7 +11229,7 @@ dependencies = [ [[package]] name = "subspace-service" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "async-trait", "cross-domain-message-gossip", @@ -11306,7 +11306,7 @@ dependencies = [ [[package]] name = "subspace-verification" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=b96ae888720551b22ece25cf1adba00615721fa9#b96ae888720551b22ece25cf1adba00615721fa9" +source = "git+https://github.com/subspace/subspace?rev=d049b53e8d368b2c4e222df5f8b0cb510cab2387#d049b53e8d368b2c4e222df5f8b0cb510cab2387" dependencies = [ "parity-scale-codec", "schnorrkel", diff --git a/Cargo.toml b/Cargo.toml index 7851aee..122f0d7 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 Subspace Network" license = "0BSD" -version = "0.1.7" +version = "0.1.8" authors = ["Nazar Mokrynskyi "] repository = "https://github.com/subspace/space-acres" edition = "2021" @@ -37,6 +37,7 @@ product-name = "Space Acres" [dependencies] anyhow = "1.0.80" arc-swap = "1.7.0" +async-lock = "3.3.0" async-trait = "0.1.77" backoff = { version = "0.4.0", features = ["futures", "tokio"] } bytesize = "1.3.0" @@ -60,7 +61,6 @@ open = "5.1.2" pallet-balances = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } parity-scale-codec = "3.6.9" parking_lot = "0.12.1" -rayon = "1.9.0" relm4 = "0.7.0-rc.1" relm4-icons = { version = "0.7.0-alpha.2", features = ["checkmark", "cross", "menu-large", "processor", "puzzle-piece", "size-horizontally", "ssd", "wallet2", "warning"] } relm4-components = { version = "0.7.0-rc.1", default-features = false } @@ -72,25 +72,25 @@ sc-informant = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500 sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } sc-storage-monitor = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } -sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } +sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } semver = "1.0.22" serde = { version = "1.0.197", features = ["derive"] } serde_json = "1.0.114" simple_moving_average = "1.0.2" sp-core = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } -sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } +sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } sp-runtime = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } -subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9", default-features = false } -subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-networking = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } -subspace-service = { git = "https://github.com/subspace/subspace", rev = "b96ae888720551b22ece25cf1adba00615721fa9" } +subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387", default-features = false } +subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-networking = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } +subspace-service = { git = "https://github.com/subspace/subspace", rev = "d049b53e8d368b2c4e222df5f8b0cb510cab2387" } supports-color = "3.0.0" thiserror = "1.0.57" thread-priority = "0.16.0" diff --git a/src/backend/farmer.rs b/src/backend/farmer.rs index e5c330a..c56015c 100644 --- a/src/backend/farmer.rs +++ b/src/backend/farmer.rs @@ -5,13 +5,13 @@ use crate::backend::utils::{Handler, HandlerFn}; use crate::backend::PieceGetterWrapper; use crate::PosTable; use anyhow::anyhow; +use async_lock::Mutex as AsyncMutex; use event_listener_primitives::HandlerId; use futures::channel::oneshot; use futures::future::BoxFuture; use futures::stream::{FuturesOrdered, FuturesUnordered}; use futures::{select, FutureExt, StreamExt}; use parking_lot::Mutex; -use rayon::prelude::*; use std::num::{NonZeroU8, NonZeroUsize}; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; @@ -34,12 +34,14 @@ use subspace_farmer::utils::{ use subspace_farmer::NodeClient; use subspace_farmer_components::plotting::PlottedSector; use thread_priority::ThreadPriority; -use tokio::runtime::Handle; use tokio::sync::{Barrier, Semaphore}; use tracing::{error, info, info_span, Instrument}; /// Minimal cache percentage, there is no need in setting it higher const CACHE_PERCENTAGE: NonZeroU8 = NonZeroU8::MIN; +/// NOTE: for large gaps between the plotted part and the end of the file plot cache will result in +/// very long period of writing zeroes on Windows, see https://stackoverflow.com/q/78058306/3806795 +const MAX_SPACE_PLEDGED_FOR_PLOT_CACHE_ON_WINDOWS: u64 = 7 * 1024 * 1024 * 1024 * 1024; #[derive(Debug, Default, Copy, Clone, PartialEq)] pub struct InitialFarmState { @@ -196,6 +198,13 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu } } + let plot_cache = !cfg!(windows) + || disk_farms + .iter() + .map(|farm| farm.allocated_plotting_space) + .sum::() + <= MAX_SPACE_PLEDGED_FOR_PLOT_CACHE_ON_WINDOWS; + let farmer_app_info = node_client .farmer_app_info() .await @@ -262,25 +271,38 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu Some(ThreadPriority::Min), )?; - let (single_disk_farms, plotting_delay_senders, resized) = tokio::task::block_in_place(|| { - let handle = Handle::current(); + let (single_disk_farms, plotting_delay_senders, resized) = { let global_mutex = Arc::default(); - let faster_read_sector_record_chunks_mode_barrier = &Barrier::new(disk_farms.len()); - let faster_read_sector_record_chunks_mode_concurrency = &Semaphore::new(1); + let info_mutex = &AsyncMutex::new(()); + let faster_read_sector_record_chunks_mode_barrier = + Arc::new(Barrier::new(disk_farms.len())); + let faster_read_sector_record_chunks_mode_concurrency = Arc::new(Semaphore::new(1)); let (plotting_delay_senders, plotting_delay_receivers) = (0..disk_farms.len()) .map(|_| oneshot::channel()) .unzip::<_, _, Vec<_>, Vec<_>>(); - let resized = &AtomicBool::new(false); - let single_disk_farms = disk_farms - .into_par_iter() + let mut single_disk_farms = Vec::with_capacity(disk_farms.len()); + let mut single_disk_farms_stream = disk_farms + .into_iter() .zip(plotting_delay_receivers) .enumerate() - .map( - move |(disk_farm_index, (disk_farm, plotting_delay_receiver))| { - let _tokio_handle_guard = handle.enter(); - + .map(|(disk_farm_index, (disk_farm, plotting_delay_receiver))| { + let node_client = node_client.clone(); + let farmer_app_info = farmer_app_info.clone(); + let max_pieces_in_sector = farmer_app_info.protocol_info.max_pieces_in_sector; + let kzg = kzg.clone(); + let erasure_coding = erasure_coding.clone(); + let piece_getter = piece_getter.clone(); + let downloading_semaphore = Arc::clone(&downloading_semaphore); + let plotting_thread_pool_manager = plotting_thread_pool_manager.clone(); + let global_mutex = Arc::clone(&global_mutex); + let faster_read_sector_record_chunks_mode_barrier = + Arc::clone(&faster_read_sector_record_chunks_mode_barrier); + let faster_read_sector_record_chunks_mode_concurrency = + Arc::clone(&faster_read_sector_record_chunks_mode_concurrency); + + async move { let resized_local = match SingleDiskFarm::collect_summary(disk_farm.directory.clone()) { SingleDiskFarmSummary::Found { info, .. } => { @@ -296,26 +318,22 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu let single_disk_farm_fut = SingleDiskFarm::new::<_, _, PosTable>( SingleDiskFarmOptions { directory: disk_farm.directory.clone(), - farmer_app_info: farmer_app_info.clone(), - // TODO: Check for allocated space change and show warning in UI that - // restart is needed on Windows + farmer_app_info, allocated_space: disk_farm.allocated_plotting_space, - max_pieces_in_sector: farmer_app_info - .protocol_info - .max_pieces_in_sector, - node_client: node_client.clone(), + max_pieces_in_sector, + node_client, reward_address, - kzg: kzg.clone(), - erasure_coding: erasure_coding.clone(), - piece_getter: piece_getter.clone(), + kzg, + erasure_coding, + piece_getter, cache_percentage: CACHE_PERCENTAGE, - downloading_semaphore: Arc::clone(&downloading_semaphore), + downloading_semaphore, record_encoding_concurrency, farm_during_initial_plotting, farming_thread_pool_size: recommended_number_of_farming_threads(), - plotting_thread_pool_manager: plotting_thread_pool_manager.clone(), + plotting_thread_pool_manager, plotting_delay: Some(plotting_delay_receiver), - global_mutex: Arc::clone(&global_mutex), + global_mutex, disable_farm_locking: false, faster_read_sector_record_chunks_mode_barrier, faster_read_sector_record_chunks_mode_concurrency, @@ -323,50 +341,67 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu disk_farm_index, ); - let single_disk_farm = match handle.block_on(single_disk_farm_fut) { + let single_disk_farm = match single_disk_farm_fut.await { Ok(single_disk_farm) => single_disk_farm, Err(SingleDiskFarmError::InsufficientAllocatedSpace { min_space, allocated_space, }) => { - return Err(anyhow::anyhow!( - "Allocated space {} ({}) is not enough, minimum is ~{} (~{}, \ - {} bytes to be exact)", - bytesize::to_string(allocated_space, true), - bytesize::to_string(allocated_space, false), - bytesize::to_string(min_space, true), - bytesize::to_string(min_space, false), - min_space - )); + return ( + disk_farm_index, + Err(anyhow::anyhow!( + "Allocated space {} ({}) is not enough, minimum is ~{} (~{}, \ + {} bytes to be exact)", + bytesize::to_string(allocated_space, true), + bytesize::to_string(allocated_space, false), + bytesize::to_string(min_space, true), + bytesize::to_string(min_space, false), + min_space + )), + ); } Err(error) => { - return Err(error.into()); + return (disk_farm_index, Err(error.into())); } }; + let _info_guard = info_mutex.lock().await; + let info = single_disk_farm.info(); - println!("Single disk farm {disk_farm_index}:"); - println!(" ID: {}", info.id()); - println!(" Genesis hash: 0x{}", hex::encode(info.genesis_hash())); - println!(" Public key: 0x{}", hex::encode(info.public_key())); - println!( + info!("Single disk farm {disk_farm_index}:"); + info!(" ID: {}", info.id()); + info!(" Genesis hash: 0x{}", hex::encode(info.genesis_hash())); + info!(" Public key: 0x{}", hex::encode(info.public_key())); + info!( " Allocated space: {} ({})", bytesize::to_string(info.allocated_space(), true), bytesize::to_string(info.allocated_space(), false) ); - println!(" Directory: {}", disk_farm.directory.display()); + info!(" Directory: {}", disk_farm.directory.display()); + + (disk_farm_index, Ok(single_disk_farm)) + } + .instrument(info_span!("", %disk_farm_index)) + }) + .collect::>(); - Ok(single_disk_farm) - }, - ) - .collect::, _>>()?; + while let Some((disk_farm_index, single_disk_farm)) = single_disk_farms_stream.next().await + { + if let Err(error) = &single_disk_farm { + let span = info_span!("", %disk_farm_index); + let _span_guard = span.enter(); - anyhow::Ok(( + error!(%error, "Single disk creation failed"); + } + single_disk_farms.push(single_disk_farm?); + } + + ( single_disk_farms, plotting_delay_senders, resized.load(Ordering::Acquire), - )) - })?; + ) + }; { let handler_id = Arc::new(Mutex::new(None)); @@ -395,10 +430,14 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu .iter() .map(|single_disk_farm| single_disk_farm.piece_cache()) .collect(), - single_disk_farms - .iter() - .map(|single_disk_farm| single_disk_farm.plot_cache()) - .collect(), + if plot_cache { + single_disk_farms + .iter() + .map(|single_disk_farm| single_disk_farm.plot_cache()) + .collect() + } else { + Vec::new() + }, ) .await;