Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Showing 9 changed files with 79 additions and 83 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,9 @@ env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
MAX_TARGET_SIZE: 1024 # MB
RUSTFLAGS: -C debuginfo=0
# TODO: AES flag is such that we have decent performance on ARMv8, remove once `aes` crate bumps MSRV to at least
# 1.61: https://github.com/RustCrypto/block-ciphers/issues/373
RUSTFLAGS: -C strip=symbols -C opt-level=s --cfg aes_armv8

jobs:
fmt:
77 changes: 38 additions & 39 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ sdk-dsn = { path = "dsn" }
sdk-substrate = { path = "substrate" }
sdk-farmer = { path = "farmer" }

subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }

# The only triple tested and confirmed as working in `jemallocator` crate is `x86_64-unknown-linux-gnu`
[target.'cfg(all(target_arch = "x86_64", target_vendor = "unknown", target_os = "linux", target_env = "gnu"))'.dev-dependencies]
@@ -35,7 +35,7 @@ tracing = "0.1"
tracing-futures = "0.2"
tracing-subscriber = "0.3"

subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }

# The list of dependencies below (which can be both direct and indirect dependencies) are crates
# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
10 changes: 5 additions & 5 deletions dsn/Cargo.toml
Original file line number Diff line number Diff line change
@@ -24,8 +24,8 @@ sc-client-api = { version = "4.0.0-dev", git = "https://github.com/subspace/subs
sp-runtime = { version = "24.0.0", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }
sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }

subspace-networking = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-service = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-networking = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-service = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
14 changes: 7 additions & 7 deletions farmer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -25,10 +25,10 @@ sdk-utils = { path = "../utils" }
sdk-dsn = { path = "../dsn" }
sdk-traits = { path = "../traits" }

subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-networking = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221", features = ["parallel", "chia"] }
subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-erasure-coding = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-networking = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec", features = ["parallel", "chia"] }
subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
7 changes: 1 addition & 6 deletions farmer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -446,9 +446,8 @@ impl Config {
Box::pin({
let piece_cache = piece_cache.clone();
let piece_getter = piece_getter.clone();
let dsn_node = node.dsn().node.clone();

populate_pieces_cache(dsn_node, last_segment_index, piece_getter, piece_cache)
populate_pieces_cache(last_segment_index, piece_getter, piece_cache)
}),
format!("subspace-sdk-farmer-{node_name}-pieces-cache-population"),
)
@@ -933,22 +932,18 @@ impl<T: subspace_proof_of_space::Table> Farmer<T> {

const GET_PIECE_MAX_RETRIES_COUNT: u16 = 3;
const GET_PIECE_DELAY_IN_SECS: u64 = 3;
const POPULATE_PIECE_DELAY: Duration = Duration::from_secs(10);

/// Populates piece cache on startup. It waits for the new segment index and
/// check all pieces from previous segments to see if they are already in the
/// cache. If they are not, they are added from DSN.
async fn populate_pieces_cache<PV, PC>(
dsn_node: subspace_networking::Node,
segment_index: SegmentIndex,
piece_getter: Arc<FarmerPieceGetter<PV, PC>>,
piece_cache: Arc<tokio::sync::Mutex<FarmerPieceCache>>,
) where
PV: PieceValidator + Send + Sync + 'static,
PC: PieceCache + Send + 'static,
{
let _ = dsn_node.wait_for_connected_peers(POPULATE_PIECE_DELAY).await;

debug!(%segment_index, "Started syncing piece cache...");
let final_piece_index =
u64::from(segment_index.first_piece_index()) + ArchivedHistorySegment::NUM_PIECES as u64;
28 changes: 14 additions & 14 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -42,17 +42,17 @@ sp-core = { version = "21.0.0", git = "https://github.com/subspace/substrate", r
sp-runtime = { version = "24.0.0", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }
sp-version = { version = "22.0.0", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }

pallet-rewards = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
pallet-subspace = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sp-domains = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-networking = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-service = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-transaction-pool = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
pallet-rewards = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
pallet-subspace = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
sc-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
sc-subspace-chain-specs = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
sp-domains = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
sp-consensus-subspace = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer-components = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-networking = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-service = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-transaction-pool = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
6 changes: 3 additions & 3 deletions traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -10,8 +10,8 @@ async-trait = "0.1"
parking_lot = "0.12"
sdk-dsn = { path = "../dsn" }

subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-proof-of-space = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }

sc-client-api = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }
12 changes: 6 additions & 6 deletions utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@ sp-core-hashing = { version = "9.0.0", git = "https://github.com/subspace/substr
sp-runtime = { version = "24.0.0", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }
sp-storage = { version = "13.0.0", git = "https://github.com/subspace/substrate", rev = "55c157cff49b638a59d81a9f971f0f9a66829c71" }

sc-consensus-subspace-rpc = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
sc-consensus-subspace-rpc = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-farmer = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-rpc-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-runtime = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }
subspace-runtime-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }

# Unused for now. TODO: add `serde` feature to `subspace-core-primitives` in `subspace-archiver`
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "cad1704bb1ea49b4ee145b480711a632e64dd221" }
subspace-core-primitives = { git = "https://github.com/subspace/subspace", rev = "ed9c3baea6b9d917bd8a6c5118f089e4230bf7ec" }

0 comments on commit b90e07b

Please sign in to comment.