diff --git a/Cargo.lock b/Cargo.lock index 34ede58..8eaa41f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2032,7 +2032,7 @@ checksum = "f64009896348fc5af4222e9cf7d7d82a95a256c634ebcf61c53e4ea461422242" [[package]] name = "cross-domain-message-gossip" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "domain-block-preprocessor", "fp-account", @@ -2520,7 +2520,7 @@ dependencies = [ [[package]] name = "domain-block-preprocessor" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -2553,7 +2553,7 @@ dependencies = [ [[package]] name = "domain-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "fp-account", "frame-support", @@ -9835,7 +9835,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "futures", @@ -9876,7 +9876,7 @@ dependencies = [ [[package]] name = "sc-consensus-subspace-rpc" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-oneshot", "futures", @@ -9911,7 +9911,7 @@ dependencies = [ [[package]] name = "sc-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "sc-client-api", "sc-executor", @@ -10272,7 +10272,7 @@ dependencies = [ [[package]] name = "sc-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "core_affinity", "derive_more 1.0.0", @@ -10507,7 +10507,7 @@ dependencies = [ [[package]] name = "sc-subspace-block-relay" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -10533,12 +10533,12 @@ dependencies = [ [[package]] name = "sc-subspace-chain-specs" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" [[package]] name = "sc-subspace-sync-common" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "array-bytes", "futures", @@ -11251,7 +11251,7 @@ dependencies = [ [[package]] name = "sp-auto-id" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "parity-scale-codec", "scale-info", @@ -11275,7 +11275,7 @@ dependencies = [ [[package]] name = "sp-block-fees" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "domain-runtime-primitives", @@ -11370,7 +11370,7 @@ dependencies = [ [[package]] name = "sp-consensus-subspace" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "log", @@ -11486,7 +11486,7 @@ dependencies = [ [[package]] name = "sp-domain-digests" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -11495,7 +11495,7 @@ dependencies = [ [[package]] name = "sp-domain-sudo" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "parity-scale-codec", @@ -11506,7 +11506,7 @@ dependencies = [ [[package]] name = "sp-domains" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "blake2 0.10.6", "domain-runtime-primitives", @@ -11538,7 +11538,7 @@ dependencies = [ [[package]] name = "sp-domains-fraud-proof" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "domain-block-preprocessor", "domain-runtime-primitives", @@ -11573,7 +11573,7 @@ dependencies = [ [[package]] name = "sp-executive" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "parity-scale-codec", @@ -11664,7 +11664,7 @@ dependencies = [ [[package]] name = "sp-messenger" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-trait", "frame-support", @@ -11686,7 +11686,7 @@ dependencies = [ [[package]] name = "sp-messenger-host-functions" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "domain-block-preprocessor", "parity-scale-codec", @@ -11743,7 +11743,7 @@ dependencies = [ [[package]] name = "sp-objects" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "sp-api", "subspace-core-primitives", @@ -11929,7 +11929,7 @@ dependencies = [ [[package]] name = "sp-subspace-mmr" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "parity-scale-codec", "scale-info", @@ -12133,6 +12133,7 @@ dependencies = [ "sp-runtime", "subspace-archiving", "subspace-core-primitives", + "subspace-data-retrieval", "subspace-erasure-coding", "subspace-fake-runtime-api", "subspace-farmer", @@ -12312,7 +12313,7 @@ dependencies = [ [[package]] name = "subspace-archiving" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "parity-scale-codec", "rayon", @@ -12326,7 +12327,7 @@ dependencies = [ [[package]] name = "subspace-core-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "blake3", "bytes", @@ -12342,10 +12343,27 @@ dependencies = [ "uint 0.10.0", ] +[[package]] +name = "subspace-data-retrieval" +version = "0.1.0" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" +dependencies = [ + "anyhow", + "async-trait", + "futures", + "parity-scale-codec", + "subspace-archiving", + "subspace-core-primitives", + "subspace-erasure-coding", + "thiserror 2.0.1", + "tokio", + "tracing", +] + [[package]] name = "subspace-erasure-coding" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "kzg", "rust-kzg-blst", @@ -12356,7 +12374,7 @@ dependencies = [ [[package]] name = "subspace-fake-runtime-api" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "domain-runtime-primitives", "frame-support", @@ -12388,7 +12406,7 @@ dependencies = [ [[package]] name = "subspace-farmer" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "anyhow", "async-lock", @@ -12421,6 +12439,7 @@ dependencies = [ "ss58-registry", "static_assertions", "subspace-core-primitives", + "subspace-data-retrieval", "subspace-erasure-coding", "subspace-farmer-components", "subspace-kzg", @@ -12443,11 +12462,10 @@ dependencies = [ [[package]] name = "subspace-farmer-components" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "anyhow", "async-lock", - "async-trait", "backoff", "bitvec", "fs2", @@ -12463,6 +12481,7 @@ dependencies = [ "static_assertions", "subspace-archiving", "subspace-core-primitives", + "subspace-data-retrieval", "subspace-erasure-coding", "subspace-kzg", "subspace-proof-of-space", @@ -12476,7 +12495,7 @@ dependencies = [ [[package]] name = "subspace-kzg" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "derive_more 1.0.0", "kzg", @@ -12491,7 +12510,7 @@ dependencies = [ [[package]] name = "subspace-metrics" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "actix-web", "prometheus", @@ -12502,7 +12521,7 @@ dependencies = [ [[package]] name = "subspace-networking" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "async-lock", "async-trait", @@ -12541,7 +12560,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "chacha20", "derive_more 1.0.0", @@ -12557,7 +12576,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-space-gpu" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "blst", "cc", @@ -12570,7 +12589,7 @@ dependencies = [ [[package]] name = "subspace-proof-of-time" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "aes 0.9.0-pre.2", "subspace-core-primitives", @@ -12580,7 +12599,7 @@ dependencies = [ [[package]] name = "subspace-rpc-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "hex", "parity-scale-codec", @@ -12593,7 +12612,7 @@ dependencies = [ [[package]] name = "subspace-runtime-primitives" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "frame-support", "frame-system", @@ -12609,8 +12628,9 @@ dependencies = [ [[package]] name = "subspace-service" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ + "anyhow", "array-bytes", "async-channel 1.9.0", "async-lock", @@ -12679,6 +12699,7 @@ dependencies = [ "static_assertions", "subspace-archiving", "subspace-core-primitives", + "subspace-data-retrieval", "subspace-erasure-coding", "subspace-kzg", "subspace-networking", @@ -12695,7 +12716,7 @@ dependencies = [ [[package]] name = "subspace-verification" version = "0.1.0" -source = "git+https://github.com/subspace/subspace?rev=bdf31b82954f267b7e2815a0e833f45d7d41021c#bdf31b82954f267b7e2815a0e833f45d7d41021c" +source = "git+https://github.com/subspace/subspace?rev=7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3#7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" dependencies = [ "parity-scale-codec", "schnorrkel", diff --git a/Cargo.toml b/Cargo.toml index 57678c0..97d7965 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,13 +72,13 @@ reqwest = { version = "0.12.8", default-features = false, features = ["json", "r sc-client-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-client-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-consensus-slots = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } +sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } sc-network = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-network-types = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-rpc = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-service = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sc-storage-monitor = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } +sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } sc-utils = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } schnellru = "0.2.3" semver = "1.0.23" @@ -87,23 +87,24 @@ serde_json = "1.0.133" simple_moving_average = "1.0.2" sp-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } sp-consensus = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } +sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } sp-core = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -sp-objects = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } +sp-objects = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } sp-runtime = { git = "https://github.com/subspace/polkadot-sdk", rev = "94a1a8143a89bbe9f938c1939ff68abc1519a305", default-features = false } -subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c", default-features = false } -subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-networking = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c", optional = true } -subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } -subspace-service = { git = "https://github.com/subspace/subspace", rev = "bdf31b82954f267b7e2815a0e833f45d7d41021c" } +subspace-archiving = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-data-retrieval = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-fake-runtime-api = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3", default-features = false } +subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-kzg = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-networking = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-proof-of-space-gpu = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3", optional = true } +subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } +subspace-service = { git = "https://github.com/subspace/subspace", rev = "7a8cad0b8af56ad27a0725de46f2b2de9e7f8ae3" } 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 9d35615..c90381d 100644 --- a/src/backend.rs +++ b/src/backend.rs @@ -20,27 +20,23 @@ use async_lock::{RwLock as AsyncRwLock, Semaphore}; use backoff::ExponentialBackoff; use future::FutureExt; use futures::channel::mpsc; -use futures::{future, select, SinkExt, Stream, StreamExt}; +use futures::{future, select, SinkExt, StreamExt}; use sc_subspace_chain_specs::MAINNET_CHAIN_SPEC; use sp_consensus_subspace::ChainConstants; -use std::error::Error; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::num::NonZeroU8; use std::path::{Path, PathBuf}; use std::pin::pin; use std::sync::{Arc, Weak}; use std::time::Duration; -use subspace_core_primitives::pieces::{Piece, PieceIndex}; use subspace_core_primitives::{BlockNumber, PublicKey}; +use subspace_data_retrieval::piece_getter::PieceGetter; use subspace_farmer::farm::plotted_pieces::PlottedPieces; -use subspace_farmer::farmer_cache::{FarmerCache, FarmerCacheWorker}; +use subspace_farmer::farmer_cache::{FarmerCache, FarmerCacheWorker, FarmerCaches}; use subspace_farmer::farmer_piece_getter::piece_validator::SegmentCommitmentPieceValidator; -use subspace_farmer::farmer_piece_getter::{ - DsnCacheRetryPolicy, FarmerPieceGetter, WeakFarmerPieceGetter, -}; +use subspace_farmer::farmer_piece_getter::{DsnCacheRetryPolicy, FarmerPieceGetter}; use subspace_farmer::single_disk_farm::SingleDiskFarm; use subspace_farmer::utils::run_future_in_dedicated_thread; -use subspace_farmer_components::PieceGetter; use subspace_kzg::Kzg; use subspace_networking::libp2p::identity::ed25519::{Keypair, SecretKey}; use subspace_networking::libp2p::multiaddr::Protocol; @@ -48,7 +44,6 @@ use subspace_networking::libp2p::Multiaddr; use subspace_networking::utils::piece_provider::PieceProvider; use subspace_networking::{Node, NodeRunner}; use subspace_runtime_primitives::Balance; -use subspace_service::sync_from_dsn::DsnSyncPieceGetter; use tokio::fs; use tokio::fs::OpenOptions; use tokio::io::AsyncWriteExt; @@ -66,84 +61,6 @@ const GET_PIECE_MAX_INTERVAL: Duration = Duration::from_secs(40); /// Multiplier on top of outgoing connections number for piece downloading purposes const PIECE_PROVIDER_MULTIPLIER: usize = 10; -#[derive(Debug, Clone)] -struct PieceGetterWrapper( - FarmerPieceGetter, MaybeNodeClient>, -); - -#[async_trait::async_trait] -impl DsnSyncPieceGetter for PieceGetterWrapper { - async fn get_piece( - &self, - piece_index: PieceIndex, - ) -> Result, Box> { - Ok(self.0.get_piece_fast(piece_index).await) - } -} - -#[async_trait::async_trait] -impl PieceGetter for PieceGetterWrapper { - async fn get_piece(&self, piece_index: PieceIndex) -> anyhow::Result> { - self.0.get_piece(piece_index).await - } - - async fn get_pieces<'a, PieceIndices>( - &'a self, - piece_indices: PieceIndices, - ) -> anyhow::Result< - Box>)> + Send + Unpin + 'a>, - > - where - PieceIndices: IntoIterator + Send + 'a, - { - self.0.get_pieces(piece_indices).await - } -} - -impl PieceGetterWrapper { - fn new( - farmer_piece_getter: FarmerPieceGetter< - FarmIndex, - SegmentCommitmentPieceValidator, - MaybeNodeClient, - >, - ) -> Self { - Self(farmer_piece_getter) - } - - fn downgrade(&self) -> WeakPieceGetterWrapper { - WeakPieceGetterWrapper(self.0.downgrade()) - } -} - -#[derive(Debug, Clone)] -struct WeakPieceGetterWrapper( - WeakFarmerPieceGetter< - FarmIndex, - SegmentCommitmentPieceValidator, - MaybeNodeClient, - >, -); - -#[async_trait::async_trait] -impl PieceGetter for WeakPieceGetterWrapper { - async fn get_piece(&self, piece_index: PieceIndex) -> anyhow::Result> { - self.0.get_piece(piece_index).await - } - - async fn get_pieces<'a, PieceIndices>( - &'a self, - piece_indices: PieceIndices, - ) -> anyhow::Result< - Box>)> + Send + Unpin + 'a>, - > - where - PieceIndices: IntoIterator + Send + 'a, - { - self.0.get_pieces(piece_indices).await - } -} - /// Major steps in application loading progress #[derive(Debug, Clone)] pub enum LoadingStep { @@ -441,12 +358,14 @@ async fn load( let piece_provider = PieceProvider::new( node.clone(), SegmentCommitmentPieceValidator::new(node.clone(), maybe_node_client.clone(), kzg.clone()), - Semaphore::new(out_connections as usize * PIECE_PROVIDER_MULTIPLIER), + Arc::new(Semaphore::new( + out_connections as usize * PIECE_PROVIDER_MULTIPLIER, + )), ); - let piece_getter = PieceGetterWrapper::new(FarmerPieceGetter::new( + let piece_getter = FarmerPieceGetter::new( piece_provider, - farmer_cache.clone(), + FarmerCaches::from(farmer_cache.clone()), maybe_node_client.clone(), Arc::clone(&plotted_pieces), DsnCacheRetryPolicy { @@ -460,7 +379,7 @@ async fn load( ..ExponentialBackoff::default() }, }, - )); + ); let create_consensus_node_fut = create_consensus_node( &network_keypair, @@ -955,7 +874,7 @@ async fn create_consensus_node( node_path: PathBuf, substrate_port: u16, chain_spec: ChainSpec, - piece_getter: Arc, + piece_getter: Arc, node: Node, maybe_node_client: &MaybeNodeClient, notifications_sender: &mut mpsc::Sender, @@ -1004,7 +923,11 @@ async fn create_farmer( node_client: MaybeNodeClient, kzg: Kzg, reduce_plotting_cpu_load: bool, - piece_getter: PieceGetterWrapper, + piece_getter: FarmerPieceGetter< + FarmIndex, + SegmentCommitmentPieceValidator, + MaybeNodeClient, + >, notifications_sender: &mut mpsc::Sender, ) -> anyhow::Result> { let farms_total = disk_farms.len() as u16; diff --git a/src/backend/farmer.rs b/src/backend/farmer.rs index e07a581..8edc8b2 100644 --- a/src/backend/farmer.rs +++ b/src/backend/farmer.rs @@ -3,7 +3,6 @@ pub(super) mod maybe_node_client; use crate::backend::farmer::maybe_node_client::MaybeNodeClient; use crate::backend::utils::{Handler, HandlerFn}; -use crate::backend::PieceGetterWrapper; use crate::PosTable; use anyhow::anyhow; use async_lock::{Mutex as AsyncMutex, RwLock as AsyncRwLock, Semaphore}; @@ -30,6 +29,8 @@ use subspace_farmer::farm::{ FarmingNotification, PlottedSectors, SectorPlottingDetails, SectorUpdate, }; use subspace_farmer::farmer_cache::{FarmerCache, FarmerCacheWorker}; +use subspace_farmer::farmer_piece_getter::piece_validator::SegmentCommitmentPieceValidator; +use subspace_farmer::farmer_piece_getter::FarmerPieceGetter; use subspace_farmer::node_client::NodeClient; use subspace_farmer::plotter::cpu::CpuPlotter; #[cfg(feature = "_gpu")] @@ -190,7 +191,12 @@ 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) piece_getter: FarmerPieceGetter< + FarmIndex, + SegmentCommitmentPieceValidator, + MaybeNodeClient, + >, + pub(super) plotted_pieces: Arc>>, pub(super) farmer_cache: FarmerCache, pub(super) farmer_cache_worker: FarmerCacheWorker, diff --git a/src/backend/node.rs b/src/backend/node.rs index 23a4b32..c6fb1b6 100644 --- a/src/backend/node.rs +++ b/src/backend/node.rs @@ -34,6 +34,7 @@ use std::sync::Arc; use std::time::Duration; use subspace_core_primitives::solutions::SolutionRange; use subspace_core_primitives::{BlockNumber, PublicKey}; +use subspace_data_retrieval::piece_getter::PieceGetter; use subspace_fake_runtime_api::RuntimeApi; use subspace_networking::libp2p::identity::ed25519::Keypair; use subspace_networking::libp2p::Multiaddr; @@ -43,7 +44,6 @@ use subspace_service::config::{ ChainSyncMode, SubspaceConfiguration, SubspaceNetworking, SubstrateConfiguration, SubstrateNetworkConfiguration, SubstrateRpcConfiguration, }; -use subspace_service::sync_from_dsn::DsnSyncPieceGetter; use subspace_service::{FullClient, NewFull}; use tokio::time::MissedTickBehavior; use tracing::{error, info, info_span}; @@ -504,7 +504,7 @@ pub(super) async fn create_consensus_node( base_path: PathBuf, substrate_port: u16, chain_spec: ChainSpec, - piece_getter: Arc, + piece_getter: Arc, node: Node, maybe_node_client: &MaybeNodeClient, ) -> Result {