diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f69abc1..e14bc8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,7 +49,7 @@ jobs: - name: Install GTK4 and libfuse2 (Linux) # libfuse2 is needed for AppImage to run - run: sudo apt-get install --no-install-recommends -y libgtk-4-dev libfuse2 + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libgtk-4-dev libfuse2 if: runner.os == 'Linux' - name: Configure GTK4 cache (Windows) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1cfe3a6..57672bf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -67,7 +67,7 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0 - name: Install GTK4 (Ubuntu) - run: sudo apt-get install --no-install-recommends -y libgtk-4-dev + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libgtk-4-dev if: runner.os == 'Linux' - name: Install GTK4 (macOS) @@ -187,7 +187,7 @@ jobs: uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # @v3.1.0 - name: Install GTK4 (Ubuntu) - run: sudo apt-get install --no-install-recommends -y libgtk-4-dev + run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libgtk-4-dev if: runner.os == 'Linux' - name: Install GTK4 (macOS) diff --git a/Cargo.lock b/Cargo.lock index 0d41856..abdb791 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1973,7 +1973,7 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "cross-domain-message-gossip" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "futures", "parity-scale-codec", @@ -2460,7 +2460,7 @@ dependencies = [ [[package]] name = "domain-block-preprocessor" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -2488,12 +2488,14 @@ dependencies = [ [[package]] name = "domain-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ + "fp-account", "frame-support", "frame-system", "parity-scale-codec", "scale-info", + "serde", "sp-api", "sp-core", "sp-runtime", @@ -2978,6 +2980,25 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fp-account" +version = "1.0.0-dev" +source = "git+https://github.com/subspace/frontier?rev=7627e61d80275a4cf24d06f27491f6c31eadb7b7#7627e61d80275a4cf24d06f27491f6c31eadb7b7" +dependencies = [ + "hex", + "impl-serde", + "libsecp256k1", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", + "sp-std", +] + [[package]] name = "fragile" version = "2.0.0" @@ -6587,7 +6608,7 @@ dependencies = [ [[package]] name = "orml-vesting" version = "0.4.1-dev" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6639,13 +6660,14 @@ dependencies = [ [[package]] name = "pallet-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", "frame-support", "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-consensus-slots", @@ -6664,7 +6686,7 @@ dependencies = [ [[package]] name = "pallet-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-benchmarking", "frame-support", @@ -6701,7 +6723,7 @@ dependencies = [ [[package]] name = "pallet-offences-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6715,7 +6737,7 @@ dependencies = [ [[package]] name = "pallet-rewards" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6727,7 +6749,7 @@ dependencies = [ [[package]] name = "pallet-runtime-configs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6740,7 +6762,7 @@ dependencies = [ [[package]] name = "pallet-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-benchmarking", "frame-support", @@ -6763,7 +6785,7 @@ dependencies = [ [[package]] name = "pallet-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6815,7 +6837,7 @@ dependencies = [ [[package]] name = "pallet-transaction-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "frame-system", @@ -6871,7 +6893,7 @@ dependencies = [ [[package]] name = "pallet-transporter" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", @@ -6880,6 +6902,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core", + "sp-domains", "sp-messenger", "sp-runtime", "sp-std", @@ -8398,7 +8421,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "futures", @@ -8438,7 +8461,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace-rpc" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-oneshot", "futures", @@ -8790,7 +8813,7 @@ dependencies = [ [[package]] name = "sc-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "atomic", "core_affinity", @@ -9011,7 +9034,7 @@ dependencies = [ [[package]] name = "sc-subspace-block-relay" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-channel", "async-trait", @@ -9036,7 +9059,7 @@ dependencies = [ [[package]] name = "sc-subspace-chain-specs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" [[package]] name = "sc-sysinfo" @@ -9762,7 +9785,7 @@ dependencies = [ [[package]] name = "sp-block-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -9856,7 +9879,7 @@ dependencies = [ [[package]] name = "sp-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "log", @@ -9992,7 +10015,7 @@ dependencies = [ [[package]] name = "sp-domain-digests" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -10001,7 +10024,7 @@ dependencies = [ [[package]] name = "sp-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "blake2 0.10.6", "domain-runtime-primitives", @@ -10033,7 +10056,7 @@ dependencies = [ [[package]] name = "sp-domains-fraud-proof" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "domain-block-preprocessor", "domain-runtime-primitives", @@ -10065,7 +10088,7 @@ dependencies = [ [[package]] name = "sp-executive" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "parity-scale-codec", @@ -10157,7 +10180,7 @@ dependencies = [ [[package]] name = "sp-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "frame-support", "hash-db", @@ -10217,7 +10240,7 @@ dependencies = [ [[package]] name = "sp-objects" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "sp-api", "sp-std", @@ -10405,7 +10428,7 @@ dependencies = [ [[package]] name = "sp-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "parity-scale-codec", "scale-info", @@ -10548,7 +10571,7 @@ dependencies = [ [[package]] name = "space-acres" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "arc-swap", @@ -10734,7 +10757,7 @@ dependencies = [ [[package]] name = "subspace-archiving" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "parity-scale-codec", "rayon", @@ -10747,7 +10770,7 @@ dependencies = [ [[package]] name = "subspace-core-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "blake3", "derive_more", @@ -10770,7 +10793,7 @@ dependencies = [ [[package]] name = "subspace-erasure-coding" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "kzg", "rust-kzg-blst", @@ -10780,7 +10803,7 @@ dependencies = [ [[package]] name = "subspace-farmer" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "anyhow", "async-lock 3.3.0", @@ -10836,7 +10859,7 @@ dependencies = [ [[package]] name = "subspace-farmer-components" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-lock 3.3.0", "async-trait", @@ -10847,6 +10870,7 @@ dependencies = [ "hex", "libc", "parity-scale-codec", + "parking_lot 0.12.1", "rand", "rayon", "schnorrkel", @@ -10866,7 +10890,7 @@ dependencies = [ [[package]] name = "subspace-metrics" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "actix-web", "prometheus", @@ -10877,7 +10901,7 @@ dependencies = [ [[package]] name = "subspace-networking" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-mutex", "async-trait", @@ -10915,7 +10939,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "chacha20", "derive_more", @@ -10928,7 +10952,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "aes", "subspace-core-primitives", @@ -10938,7 +10962,7 @@ dependencies = [ [[package]] name = "subspace-rpc-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "hex", "serde", @@ -10950,7 +10974,7 @@ dependencies = [ [[package]] name = "subspace-runtime" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "domain-runtime-primitives", "frame-benchmarking", @@ -11004,7 +11028,7 @@ dependencies = [ [[package]] name = "subspace-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "pallet-transaction-payment", "sp-core", @@ -11016,7 +11040,7 @@ dependencies = [ [[package]] name = "subspace-service" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "async-trait", "cross-domain-message-gossip", @@ -11090,7 +11114,7 @@ dependencies = [ [[package]] name = "subspace-verification" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=ad2cc2c740a657b653d2e9800c314f2e6a64e746#ad2cc2c740a657b653d2e9800c314f2e6a64e746" +source = "git+https://github.com/subspace/subspace?rev=a41b193837d8a57e2749cae30f21bee729cfb165#a41b193837d8a57e2749cae30f21bee729cfb165" dependencies = [ "parity-scale-codec", "schnorrkel", diff --git a/Cargo.toml b/Cargo.toml index c2ba6f8..8f2c129 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.2" +version = "0.1.3" authors = ["Nazar Mokrynskyi "] repository = "https://github.com/subspace/space-acres" edition = "2021" @@ -63,25 +63,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 = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } +sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } semver = "1.0.21" serde = { version = "1.0.196", features = ["derive"]} serde_json = "1.0.113" 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 = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } +sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } sp-runtime = { git = "https://github.com/subspace/polkadot-sdk", rev = "d6b500960579d73c43fc4ef550b703acfa61c4c8", default-features = false } -subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746", default-features = false } -subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-networking = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } -subspace-service = { git = "https://github.com/subspace/subspace", rev = "ad2cc2c740a657b653d2e9800c314f2e6a64e746" } +subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165", default-features = false } +subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-networking = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } +subspace-service = { git = "https://github.com/subspace/subspace", rev = "a41b193837d8a57e2749cae30f21bee729cfb165" } supports-color = "2.1.0" thiserror = "1.0.56" tokio = { version = "1.35.1", features = ["fs", "time"] } diff --git a/src/backend.rs b/src/backend.rs index 074b4ee..f5c825c 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -25,7 +25,7 @@ use std::path::{Path, PathBuf}; use std::pin::pin; use std::sync::Arc; use subspace_core_primitives::{BlockNumber, PublicKey}; -use subspace_farmer::piece_cache::{CacheWorker, PieceCache}; +use subspace_farmer::farmer_cache::{FarmerCache, FarmerCacheWorker}; use subspace_farmer::single_disk_farm::SingleDiskFarm; use subspace_farmer::utils::plotted_pieces::PlottedPieces; use subspace_farmer::utils::run_future_in_dedicated_thread; @@ -144,7 +144,7 @@ struct LoadedBackend { config_file_path: PathBuf, consensus_node: ConsensusNode, farmer: Farmer, - node_runner: NodeRunner, + node_runner: NodeRunner, } enum BackendLoadingResult { @@ -279,8 +279,8 @@ async fn load( node_runner, network_keypair, plotted_pieces, - piece_cache, - piece_cache_worker, + farmer_cache, + farmer_cache_worker, ) = create_networking_stack( &config, GENESIS_HASH.to_string(), @@ -312,8 +312,8 @@ async fn load( config.farms.clone(), node, plotted_pieces, - piece_cache, - piece_cache_worker, + farmer_cache, + farmer_cache_worker, &maybe_node_client, notifications_sender, ) @@ -615,11 +615,11 @@ async fn create_networking_stack( ) -> anyhow::Result<( MaybeNodeRpcClient, Node, - NodeRunner, + NodeRunner, Keypair, Arc>>, - PieceCache, - CacheWorker, + FarmerCache, + FarmerCacheWorker, )> { notifications_sender .send(BackendNotification::Loading { @@ -741,7 +741,7 @@ async fn create_networking_stack( let maybe_node_client = MaybeNodeRpcClient::default(); let weak_plotted_pieces = Arc::downgrade(&plotted_pieces); - let (piece_cache, piece_cache_worker) = PieceCache::new( + let (farmer_cache, farmer_cache_worker) = FarmerCache::new( maybe_node_client.clone(), subspace_networking::libp2p::identity::PublicKey::from(network_keypair.public()) .to_peer_id(), @@ -753,7 +753,7 @@ async fn create_networking_stack( network_options, weak_plotted_pieces, maybe_node_client.clone(), - piece_cache.clone(), + farmer_cache.clone(), )?; notifications_sender @@ -769,8 +769,8 @@ async fn create_networking_stack( node_runner, network_keypair, plotted_pieces, - piece_cache, - piece_cache_worker, + farmer_cache, + farmer_cache_worker, )) } @@ -817,8 +817,8 @@ async fn create_farmer( disk_farms: Vec, node: Node, plotted_pieces: Arc>>, - piece_cache: PieceCache, - piece_cache_worker: CacheWorker, + farmer_cache: FarmerCache, + farmer_cache_worker: FarmerCacheWorker, maybe_node_client: &MaybeNodeRpcClient, notifications_sender: &mut mpsc::Sender, ) -> anyhow::Result { @@ -841,8 +841,8 @@ async fn create_farmer( node_client, node, plotted_pieces, - piece_cache, - piece_cache_worker, + farmer_cache, + farmer_cache_worker, }; let farmer = farmer::create_farmer(farmer_options).await?; diff --git a/src/backend/farmer.rs b/src/backend/farmer.rs index 24d7a6a..458d23c 100644 --- a/src/backend/farmer.rs +++ b/src/backend/farmer.rs @@ -17,7 +17,7 @@ use std::{fmt, fs}; use subspace_core_primitives::crypto::kzg::{embedded_kzg_settings, Kzg}; use subspace_core_primitives::{PublicKey, Record, SectorIndex}; use subspace_erasure_coding::ErasureCoding; -use subspace_farmer::piece_cache::{CacheWorker, PieceCache}; +use subspace_farmer::farmer_cache::{FarmerCache, FarmerCacheWorker}; use subspace_farmer::single_disk_farm::farming::FarmingNotification; use subspace_farmer::single_disk_farm::{ SectorPlottingDetails, SectorUpdate, SingleDiskFarm, SingleDiskFarmError, SingleDiskFarmOptions, @@ -56,7 +56,7 @@ pub enum FarmerNotification { farm_index: u8, notification: FarmingNotification, }, - PieceCacheSyncProgress { + FarmerCacheSyncProgress { /// Progress so far in % progress: f32, }, @@ -66,7 +66,7 @@ type Notifications = Handler; pub(super) struct Farmer { farm_fut: BoxFuture<'static, anyhow::Result<()>>, - piece_cache_worker_fut: BoxFuture<'static, ()>, + farmer_cache_worker_fut: BoxFuture<'static, ()>, initial_farm_states: Vec, farm_during_initial_plotting: bool, notifications: Arc, @@ -74,14 +74,14 @@ pub(super) struct Farmer { impl Farmer { pub(super) async fn run(self) -> anyhow::Result<()> { - let piece_cache_worker_fut = match run_future_in_dedicated_thread( - move || self.piece_cache_worker_fut, - "piece-cache-worker".to_string(), + let farmer_cache_worker_fut = match run_future_in_dedicated_thread( + move || self.farmer_cache_worker_fut, + "farmer-cache-worker".to_string(), ) { - Ok(piece_cache_worker_fut) => piece_cache_worker_fut, + Ok(farmer_cache_worker_fut) => farmer_cache_worker_fut, Err(error) => { return Err(anyhow::anyhow!( - "Failed to spawn piece future in background thread: {error}" + "Failed to spawn farmer cache future in background thread: {error}" )); } }; @@ -90,16 +90,16 @@ impl Farmer { move || self.farm_fut, "farmer-farm".to_string(), ) { - Ok(piece_cache_worker_fut) => piece_cache_worker_fut, + Ok(farmer_cache_worker_fut) => farmer_cache_worker_fut, Err(error) => { return Err(anyhow::anyhow!( - "Failed to spawn piece future in background thread: {error}" + "Failed to spawn farm future in background thread: {error}" )); } }; select! { - _ = piece_cache_worker_fut.fuse() => { + _ = farmer_cache_worker_fut.fuse() => { // Nothing to do, just exit } result = farm_fut.fuse() => { @@ -151,8 +151,8 @@ pub(super) struct FarmerOptions { pub(super) node_client: NodeRpcClient, pub(super) node: Node, pub(super) plotted_pieces: Arc>>, - pub(super) piece_cache: PieceCache, - pub(super) piece_cache_worker: CacheWorker, + pub(super) farmer_cache: FarmerCache, + pub(super) farmer_cache_worker: FarmerCacheWorker, } pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Result { @@ -165,8 +165,8 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu node_client, node, plotted_pieces, - piece_cache, - piece_cache_worker, + farmer_cache, + farmer_cache_worker, } = farmer_options; if disk_farms.is_empty() { @@ -207,14 +207,14 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu let piece_getter = Arc::new(FarmerPieceGetter::new( piece_provider, - piece_cache.clone(), + farmer_cache.clone(), node_client.clone(), Arc::clone(&plotted_pieces), )); - let piece_cache_worker_fut = Box::pin( - piece_cache_worker - .run(piece_getter.clone()) + let farmer_cache_worker_fut = Box::pin( + farmer_cache_worker + .run(piece_getter.downgrade()) .in_current_span(), ); @@ -253,6 +253,15 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu let downloading_semaphore = Arc::new(Semaphore::new(plotting_thread_pool_core_indices.len() + 1)); + let record_encoding_concurrency = { + let cpu_cores = plotting_thread_pool_core_indices + .first() + .expect("Guaranteed to have some CPU cores; qed"); + + NonZeroUsize::new((cpu_cores.cpu_cores().len() / 2).min(8)) + .expect("Guaranteed to have some CPU cores; qed") + }; + let plotting_thread_pool_manager = create_plotting_thread_pool_manager( plotting_thread_pool_core_indices .into_iter() @@ -278,10 +287,12 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu piece_getter: piece_getter.clone(), cache_percentage: CACHE_PERCENTAGE, downloading_semaphore: Arc::clone(&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_delay: Some(plotting_delay_receiver), + disable_farm_locking: false, }, disk_farm_index, ); @@ -322,7 +333,7 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu single_disk_farms.push(single_disk_farm); } - let cache_acknowledgement_receiver = piece_cache + let cache_acknowledgement_receiver = farmer_cache .replace_backing_caches( single_disk_farms .iter() @@ -387,12 +398,12 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu let notifications = Arc::new(Notifications::default()); - piece_cache + farmer_cache .on_sync_progress(Arc::new({ let notifications = Arc::clone(¬ifications); move |progress| { - notifications.call_simple(&FarmerNotification::PieceCacheSyncProgress { + notifications.call_simple(&FarmerNotification::FarmerCacheSyncProgress { progress: *progress, }); } @@ -508,7 +519,7 @@ pub(super) async fn create_farmer(farmer_options: FarmerOptions) -> anyhow::Resu anyhow::Ok(Farmer { farm_fut, - piece_cache_worker_fut, + farmer_cache_worker_fut, initial_farm_states, farm_during_initial_plotting, notifications, diff --git a/src/backend/networking.rs b/src/backend/networking.rs index 12d24c5..ce6c18c 100644 --- a/src/backend/networking.rs +++ b/src/backend/networking.rs @@ -2,8 +2,8 @@ use parking_lot::Mutex; use std::collections::HashSet; use std::path::Path; use std::sync::{Arc, Weak}; +use subspace_farmer::farmer_cache::FarmerCache; use subspace_farmer::node_client::NodeClientExt; -use subspace_farmer::piece_cache::PieceCache; use subspace_farmer::utils::plotted_pieces::PlottedPieces; use subspace_farmer::KNOWN_PEERS_CACHE_SIZE; use subspace_networking::libp2p::identity::ed25519::Keypair; @@ -87,8 +87,8 @@ pub fn create_network( }: NetworkOptions, weak_plotted_pieces: Weak>>, node_client: NC, - piece_cache: PieceCache, -) -> Result<(Node, NodeRunner), anyhow::Error> + farmer_cache: FarmerCache, +) -> Result<(Node, NodeRunner), anyhow::Error> where NC: NodeClientExt, { @@ -106,7 +106,7 @@ where }) .map(Box::new)?; - let default_config = Config::new(protocol_prefix, keypair.into(), piece_cache.clone(), None); + let default_config = Config::new(protocol_prefix, keypair.into(), farmer_cache.clone(), None); let config = Config { reserved_peers, listen_on, @@ -117,11 +117,11 @@ where debug!(?piece_index, "Piece request received. Trying cache..."); let weak_plotted_pieces = weak_plotted_pieces.clone(); - let piece_cache = piece_cache.clone(); + let farmer_cache = farmer_cache.clone(); async move { let key = RecordKey::from(piece_index.to_multihash()); - let piece_from_store = piece_cache.get_piece(key).await; + let piece_from_store = farmer_cache.get_piece(key).await; if let Some(piece) = piece_from_store { Some(PieceByIndexResponse { piece: Some(piece) }) diff --git a/src/frontend/running.rs b/src/frontend/running.rs index 6c7269c..d6a196f 100644 --- a/src/frontend/running.rs +++ b/src/frontend/running.rs @@ -293,7 +293,7 @@ impl RunningView { FarmWidgetInput::FarmingNotification(notification), ); } - FarmerNotification::PieceCacheSyncProgress { progress } => { + FarmerNotification::FarmerCacheSyncProgress { progress } => { let old_synced = self.farmer_state.piece_cache_sync_progress == 100.0; let new_synced = progress == 100.0; if old_synced != new_synced { diff --git a/src/frontend/running/farm.rs b/src/frontend/running/farm.rs index baf9edd..463a7bb 100644 --- a/src/frontend/running/farm.rs +++ b/src/frontend/running/farm.rs @@ -278,7 +278,12 @@ impl FactoryComponent for FarmWidget { }, (PlottingState::Idle, _) => gtk::Box { gtk::Label { - set_label: "Farming", + #[watch] + set_label: if self.is_node_synced { + "Farming" + } else { + "Waiting for node to sync" + }, } }, },