From 5014927e07bffa18a8c7a0abf9ea36082788d89c Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 6 Nov 2024 18:54:19 +0200 Subject: [PATCH] Update Subspace to latest `main` with mainnet chain spec and correct PoT seed --- Cargo.lock | 135 +++++++++++++++++++------------------- Cargo.toml | 38 +++++------ src/backend.rs | 26 +++----- src/backend/farmer.rs | 13 ++-- src/backend/networking.rs | 40 +++++------ src/backend/node.rs | 41 +++++++----- 6 files changed, 142 insertions(+), 151 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d8ca13..13cf9aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2065,7 +2065,7 @@ checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "cross-domain-message-gossip" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "domain-block-preprocessor", "fp-account", @@ -2584,7 +2584,7 @@ dependencies = [ [[package]] name = "domain-block-preprocessor" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -2617,7 +2617,7 @@ dependencies = [ [[package]] name = "domain-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "fp-account", "frame-support", @@ -5564,7 +5564,7 @@ dependencies = [ [[package]] name = "libp2p" version = "0.54.1" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "bytes", "either", @@ -5593,7 +5593,7 @@ dependencies = [ "libp2p-yamux 0.46.0", "multiaddr 0.18.2", "pin-project", - "rw-stream-sink 0.4.0 (git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8)", + "rw-stream-sink 0.4.0 (git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d)", "thiserror", ] @@ -5612,7 +5612,7 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" version = "0.4.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "libp2p-core 0.42.0", "libp2p-identity", @@ -5623,7 +5623,7 @@ dependencies = [ [[package]] name = "libp2p-autonat" version = "0.13.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "async-trait", "asynchronous-codec 0.7.0", @@ -5661,7 +5661,7 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" version = "0.4.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "libp2p-core 0.42.0", "libp2p-identity", @@ -5700,7 +5700,7 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.42.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "either", "fnv", @@ -5709,13 +5709,13 @@ dependencies = [ "libp2p-identity", "multiaddr 0.18.2", "multihash 0.19.1", - "multistream-select 0.13.0 (git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8)", + "multistream-select 0.13.0 (git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d)", "once_cell", "parking_lot 0.12.3", "pin-project", "quick-protobuf", "rand", - "rw-stream-sink 0.4.0 (git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8)", + "rw-stream-sink 0.4.0 (git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d)", "serde", "smallvec", "thiserror", @@ -5744,7 +5744,7 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.42.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "async-trait", "futures", @@ -5759,7 +5759,7 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.47.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "asynchronous-codec 0.7.0", "base64 0.22.1", @@ -5813,7 +5813,7 @@ dependencies = [ [[package]] name = "libp2p-identify" version = "0.45.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "asynchronous-codec 0.7.0", "either", @@ -5883,7 +5883,7 @@ dependencies = [ [[package]] name = "libp2p-kad" version = "0.46.1" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "arrayvec", "asynchronous-codec 0.7.0", @@ -5933,7 +5933,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.46.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "data-encoding", "futures", @@ -5970,7 +5970,7 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.15.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "futures", "libp2p-core 0.42.0", @@ -6013,7 +6013,7 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.45.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "asynchronous-codec 0.7.0", "bytes", @@ -6056,7 +6056,7 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.45.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "either", "futures", @@ -6073,7 +6073,7 @@ dependencies = [ [[package]] name = "libp2p-plaintext" version = "0.42.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "asynchronous-codec 0.7.0", "bytes", @@ -6112,7 +6112,7 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.11.1" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "bytes", "futures", @@ -6153,7 +6153,7 @@ dependencies = [ [[package]] name = "libp2p-request-response" version = "0.27.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "async-trait", "futures", @@ -6195,7 +6195,7 @@ dependencies = [ [[package]] name = "libp2p-swarm" version = "0.45.1" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "either", "fnv", @@ -6205,7 +6205,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive 0.35.0", "lru", - "multistream-select 0.13.0 (git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8)", + "multistream-select 0.13.0 (git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d)", "once_cell", "rand", "smallvec", @@ -6231,7 +6231,7 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.35.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -6259,7 +6259,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.42.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "futures", "futures-timer", @@ -6294,7 +6294,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.5.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "futures", "futures-rustls 0.26.0", @@ -6328,7 +6328,7 @@ dependencies = [ [[package]] name = "libp2p-upnp" version = "0.3.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "futures", "futures-timer", @@ -6391,7 +6391,7 @@ dependencies = [ [[package]] name = "libp2p-yamux" version = "0.46.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "either", "futures", @@ -7181,7 +7181,7 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.13.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "bytes", "futures", @@ -8771,7 +8771,7 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.3.1" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "asynchronous-codec 0.7.0", "bytes", @@ -9680,7 +9680,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.4.0" -source = "git+https://github.com/autonomys/rust-libp2p?rev=ae7527453146df24aff6afed5f5b9efdffbc15b8#ae7527453146df24aff6afed5f5b9efdffbc15b8" +source = "git+https://github.com/autonomys/rust-libp2p?rev=3f6238a86bda615ee9ec54462147f6a5d7891b6d#3f6238a86bda615ee9ec54462147f6a5d7891b6d" dependencies = [ "futures", "pin-project", @@ -9905,7 +9905,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "futures", @@ -9947,7 +9947,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace-rpc" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-oneshot", "futures", @@ -9960,6 +9960,7 @@ dependencies = [ "sc-rpc-api", "sc-utils", "schnellru", + "serde", "sp-api", "sp-blockchain", "sp-consensus", @@ -9981,7 +9982,7 @@ dependencies = [ [[package]] name = "sc-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "sc-client-api", "sc-executor", @@ -10342,7 +10343,7 @@ dependencies = [ [[package]] name = "sc-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "core_affinity", "derive_more 1.0.0", @@ -10577,7 +10578,7 @@ dependencies = [ [[package]] name = "sc-subspace-block-relay" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -10603,7 +10604,7 @@ dependencies = [ [[package]] name = "sc-subspace-chain-specs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" [[package]] name = "sc-sysinfo" @@ -11305,7 +11306,7 @@ dependencies = [ [[package]] name = "sp-auto-id" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "parity-scale-codec", "scale-info", @@ -11329,7 +11330,7 @@ dependencies = [ [[package]] name = "sp-block-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -11424,7 +11425,7 @@ dependencies = [ [[package]] name = "sp-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "log", @@ -11540,7 +11541,7 @@ dependencies = [ [[package]] name = "sp-domain-digests" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -11549,7 +11550,7 @@ dependencies = [ [[package]] name = "sp-domain-sudo" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "parity-scale-codec", @@ -11560,7 +11561,7 @@ dependencies = [ [[package]] name = "sp-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "blake2 0.10.6", "domain-runtime-primitives", @@ -11592,7 +11593,7 @@ dependencies = [ [[package]] name = "sp-domains-fraud-proof" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "domain-block-preprocessor", "domain-runtime-primitives", @@ -11627,7 +11628,7 @@ dependencies = [ [[package]] name = "sp-executive" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "parity-scale-codec", @@ -11718,7 +11719,7 @@ dependencies = [ [[package]] name = "sp-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-trait", "frame-support", @@ -11740,7 +11741,7 @@ dependencies = [ [[package]] name = "sp-messenger-host-functions" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "domain-block-preprocessor", "parity-scale-codec", @@ -11797,7 +11798,7 @@ dependencies = [ [[package]] name = "sp-objects" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "sp-api", "subspace-core-primitives", @@ -11983,7 +11984,7 @@ dependencies = [ [[package]] name = "sp-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "parity-scale-codec", "scale-info", @@ -12123,7 +12124,7 @@ dependencies = [ [[package]] name = "space-acres" -version = "0.2.0-pre-release.0" +version = "0.2.0" dependencies = [ "anyhow", "arc-swap", @@ -12375,7 +12376,7 @@ dependencies = [ [[package]] name = "subspace-archiving" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "parity-scale-codec", "rayon", @@ -12389,7 +12390,7 @@ dependencies = [ [[package]] name = "subspace-core-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "blake3", "bytes", @@ -12408,7 +12409,7 @@ dependencies = [ [[package]] name = "subspace-erasure-coding" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "kzg", "rust-kzg-blst", @@ -12419,7 +12420,7 @@ dependencies = [ [[package]] name = "subspace-fake-runtime-api" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "domain-runtime-primitives", "frame-support", @@ -12451,7 +12452,7 @@ dependencies = [ [[package]] name = "subspace-farmer" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "anyhow", "async-lock", @@ -12507,7 +12508,7 @@ dependencies = [ [[package]] name = "subspace-farmer-components" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "anyhow", "async-lock", @@ -12540,7 +12541,7 @@ dependencies = [ [[package]] name = "subspace-kzg" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "derive_more 1.0.0", "kzg", @@ -12555,7 +12556,7 @@ dependencies = [ [[package]] name = "subspace-metrics" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "actix-web", "prometheus", @@ -12566,7 +12567,7 @@ dependencies = [ [[package]] name = "subspace-networking" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "async-mutex", "async-trait", @@ -12606,7 +12607,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "chacha20", "derive_more 1.0.0", @@ -12622,7 +12623,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space-gpu" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "blst", "cc", @@ -12635,7 +12636,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "aes 0.9.0-pre.2", "subspace-core-primitives", @@ -12645,7 +12646,7 @@ dependencies = [ [[package]] name = "subspace-rpc-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "hex", "parity-scale-codec", @@ -12658,7 +12659,7 @@ dependencies = [ [[package]] name = "subspace-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "frame-support", "frame-system", @@ -12674,7 +12675,7 @@ dependencies = [ [[package]] name = "subspace-service" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12761,7 +12762,7 @@ dependencies = [ [[package]] name = "subspace-verification" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=379fe0eeb585b24e6e5eeb238967aca656850eff#379fe0eeb585b24e6e5eeb238967aca656850eff" +source = "git+https://github.com/subspace/subspace?rev=85aba66baea8bb3a74e28e272e7c88751d26999c#85aba66baea8bb3a74e28e272e7c88751d26999c" dependencies = [ "parity-scale-codec", "schnorrkel", diff --git a/Cargo.toml b/Cargo.toml index 4d8802a..ea28131 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.0-pre-release.0" +version = "0.2.0" authors = ["Nazar Mokrynskyi "] repository = "https://github.com/autonomys/space-acres" edition = "2021" @@ -68,14 +68,14 @@ reqwest = { version = "0.12.8", default-features = false, features = ["json", "r sc-client-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-client-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-consensus-slots = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } -sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } +sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } sc-informant = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-network-types = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-rpc = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-storage-monitor = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } -sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } +sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } sc-utils = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } schnellru = "0.2.3" semver = "1.0.23" @@ -85,24 +85,24 @@ simple_moving_average = "1.0.2" sp-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sp-blockchain = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sp-consensus = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } -sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } +sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } sp-core = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } -sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -sp-objects = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } +sp-domains-fraud-proof = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +sp-objects = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } sp-runtime = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } -subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff", default-features = false } -subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-networking = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff", optional = true } -subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } -subspace-service = { git = "https://github.com/subspace/subspace", rev = "379fe0eeb585b24e6e5eeb238967aca656850eff" } +subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c", default-features = false } +subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-networking = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c", optional = true } +subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } +subspace-service = { git = "https://github.com/subspace/subspace", rev = "85aba66baea8bb3a74e28e272e7c88751d26999c" } supports-color = "3.0.1" sys-locale = "0.3.1" tempfile = "3.13.0" diff --git a/src/backend.rs b/src/backend.rs index 545b2d3..1f46090 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -21,7 +21,7 @@ use backoff::ExponentialBackoff; use future::FutureExt; use futures::channel::mpsc; use futures::{future, select, SinkExt, Stream, StreamExt}; -use sc_subspace_chain_specs::DEVNET_CHAIN_SPEC; +use sc_subspace_chain_specs::MAINNET_CHAIN_SPEC; use sp_consensus_subspace::ChainConstants; use std::error::Error; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; @@ -56,7 +56,6 @@ use tokio::runtime::Handle; use tracing::{error, info_span, warn, Instrument}; pub type FarmIndex = u8; -pub type CacheIndex = u8; /// Get piece retry attempts number. const PIECE_GETTER_MAX_RETRIES: u16 = 7; @@ -67,12 +66,7 @@ const GET_PIECE_MAX_INTERVAL: Duration = Duration::from_secs(40); #[derive(Debug, Clone)] struct PieceGetterWrapper( - FarmerPieceGetter< - FarmIndex, - CacheIndex, - SegmentCommitmentPieceValidator, - MaybeNodeClient, - >, + FarmerPieceGetter, MaybeNodeClient>, ); #[async_trait::async_trait] @@ -108,7 +102,6 @@ impl PieceGetterWrapper { fn new( farmer_piece_getter: FarmerPieceGetter< FarmIndex, - CacheIndex, SegmentCommitmentPieceValidator, MaybeNodeClient, >, @@ -125,7 +118,6 @@ impl PieceGetterWrapper { struct WeakPieceGetterWrapper( WeakFarmerPieceGetter< FarmIndex, - CacheIndex, SegmentCommitmentPieceValidator, MaybeNodeClient, >, @@ -300,7 +292,7 @@ struct LoadedBackend { config_file_path: PathBuf, consensus_node: ConsensusNode, farmer: Farmer, - node_runner: NodeRunner>, + node_runner: NodeRunner, } enum BackendLoadingResult { @@ -724,7 +716,7 @@ async fn load_chain_specification( .await?; // TODO: Switch to non-devnet chain spec - let chain_spec = node::load_chain_specification(DEVNET_CHAIN_SPEC.as_bytes()) + let chain_spec = node::load_chain_specification(MAINNET_CHAIN_SPEC.as_bytes()) .map_err(|error| anyhow::anyhow!(error))?; notifications_sender @@ -780,10 +772,10 @@ async fn create_networking_stack( ) -> anyhow::Result<( MaybeNodeClient, Node, - NodeRunner>, + NodeRunner, Keypair, - FarmerCache, - FarmerCacheWorker, + FarmerCache, + FarmerCacheWorker, )> { notifications_sender .send(BackendNotification::Loading( @@ -973,8 +965,8 @@ async fn create_farmer( reward_address: PublicKey, disk_farms: Vec, plotted_pieces: Arc>>, - farmer_cache: FarmerCache, - farmer_cache_worker: FarmerCacheWorker, + farmer_cache: FarmerCache, + farmer_cache_worker: FarmerCacheWorker, node_client: MaybeNodeClient, kzg: Kzg, reduce_plotting_cpu_load: bool, diff --git a/src/backend/farmer.rs b/src/backend/farmer.rs index edc3e5e..48cce3a 100644 --- a/src/backend/farmer.rs +++ b/src/backend/farmer.rs @@ -185,29 +185,26 @@ pub struct DiskFarm { /// Arguments for farmer #[derive(Debug)] -pub(super) struct FarmerOptions { +pub(super) struct FarmerOptions { pub(super) reward_address: PublicKey, pub(super) disk_farms: Vec, pub(super) node_client: MaybeNodeClient, pub(super) piece_getter: PieceGetterWrapper, pub(super) plotted_pieces: Arc>>, - pub(super) farmer_cache: FarmerCache, - pub(super) farmer_cache_worker: FarmerCacheWorker, + pub(super) farmer_cache: FarmerCache, + pub(super) farmer_cache_worker: FarmerCacheWorker, pub(super) kzg: Kzg, pub(super) reduce_plotting_cpu_load: bool, pub(super) on_farm_initialized: OnFarmInitialized, } -pub(super) async fn create_farmer( - farmer_options: FarmerOptions, +pub(super) async fn create_farmer( + farmer_options: FarmerOptions, ) -> anyhow::Result> where FarmIndex: Hash + Eq + Copy + fmt::Display + fmt::Debug + TryFrom + Send + Sync + 'static, usize: From, - CacheIndex: Hash + Eq + Copy + fmt::Debug + fmt::Display + Send + Sync + 'static, - usize: From, - CacheIndex: TryFrom, OnFarmInitialized: Fn(FarmIndex), { let span = info_span!("Farmer"); diff --git a/src/backend/networking.rs b/src/backend/networking.rs index 9bf00b9..908ab9d 100644 --- a/src/backend/networking.rs +++ b/src/backend/networking.rs @@ -81,7 +81,7 @@ impl Default for NetworkOptions { } #[allow(clippy::type_complexity, clippy::too_many_arguments)] -pub fn create_network( +pub fn create_network( protocol_prefix: String, base_path: &Path, NetworkOptions { @@ -98,15 +98,12 @@ pub fn create_network( }: NetworkOptions, weak_plotted_pieces: Weak>>, node_client: NC, - farmer_cache: FarmerCache, -) -> Result<(Node, NodeRunner>), anyhow::Error> + farmer_cache: FarmerCache, +) -> Result<(Node, NodeRunner), anyhow::Error> where FarmIndex: Hash + Eq + Copy + fmt::Debug + Send + Sync + 'static, usize: From, NC: NodeClientExt + Clone, - CacheIndex: Hash + Eq + Copy + fmt::Debug + fmt::Display + Send + Sync + 'static, - usize: From, - CacheIndex: TryFrom, { let span = info_span!("Network"); let _enter = span.enter(); @@ -302,22 +299,21 @@ where ..default_config }; - construct(config) - .map(|(node, node_runner)| { - node.on_new_listener(Arc::new({ - let node = node.clone(); + let (node, node_runner) = construct(config)?; + maybe_weak_node.lock().replace(node.downgrade()); - move |address| { - info!( - "DSN listening on {}", - address.clone().with(Protocol::P2p(node.id())) - ); - } - })) - .detach(); + node.on_new_listener(Arc::new({ + let node = node.clone(); + + move |address| { + info!( + "DSN listening on {}", + address.clone().with(Protocol::P2p(node.id())) + ); + } + })) + .detach(); - // Consider returning HandlerId instead of each `detach()` calls for other usages. - (node, node_runner) - }) - .map_err(Into::into) + // Consider returning HandlerId instead of each `detach()` calls for other usages. + Ok((node, node_runner)) } diff --git a/src/backend/node.rs b/src/backend/node.rs index eac9ba0..a120597 100644 --- a/src/backend/node.rs +++ b/src/backend/node.rs @@ -44,13 +44,11 @@ use subspace_service::config::{ }; use subspace_service::sync_from_dsn::DsnSyncPieceGetter; use subspace_service::{FullClient, NewFull}; -use tokio::fs; use tokio::time::MissedTickBehavior; use tracing::{error, info_span}; -// TODO: This corresponds to Gemini 3h and needs to be updated to the next network pub(super) const GENESIS_HASH: &str = - "0c121c75f4ef450f40619e1fca9d1e8e7fbabc42c895bc4790801e85d5a91c34"; + "66455a580aabff303720aa83adbe6c44502922251c03ba73686d5245da9e21bd"; const SYNC_STATUS_EVENT_INTERVAL: Duration = Duration::from_secs(5); /// Roughly 138k empty blocks can fit into one archived segment, hence we need to not allow to prune /// more blocks that this @@ -517,27 +515,34 @@ pub(super) async fn create_consensus_node( sync, }; - // TODO: Remove once support for upgrade from Gemini 3g is no longer necessary - if fs::try_exists(base_path.join("paritydb")) - .await - .unwrap_or_default() - { - return Err(ConsensusNodeCreationError::IncompatibleChain { - compatible_chain: consensus_chain_config.base.chain_spec.name().to_string(), - }); - } - - let partial_components = subspace_service::new_partial::( + let partial_components_result = subspace_service::new_partial::( &consensus_chain_config.base, match consensus_chain_config.sync { ChainSyncMode::Full => false, ChainSyncMode::Snap => true, }, &pot_external_entropy, - ) - .map_err(|error| { - sc_service::Error::Other(format!("Failed to build a full subspace node: {error:?}")) - })?; + ); + + let partial_components = match partial_components_result { + Ok(partial_components) => partial_components, + Err(error) => { + // TODO: This is a workaround to what and how initialization does, remove this at + // some point in the future once upgrade from Gemini networks is no longer needed + if error.to_string().contains( + "env:ext_fraud_proof_runtime_interface_derive_bundle_digest_version_2", + ) { + return Err(ConsensusNodeCreationError::IncompatibleChain { + compatible_chain: consensus_chain_config.base.chain_spec.name().to_string(), + }); + } else { + return Err(sc_service::Error::Other(format!( + "Failed to build a full subspace node: {error:?}" + )) + .into()); + } + } + }; if hex::encode(partial_components.client.info().genesis_hash) != GENESIS_HASH { return Err(ConsensusNodeCreationError::IncompatibleChain {