Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSN sync refactoring and optimizations #1806

Merged
merged 8 commits into from
Aug 14, 2023
12 changes: 7 additions & 5 deletions crates/sc-consensus-subspace/src/archiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,14 @@ where

// TODO: Do compaction when we have too many keys: combine multiple segment headers into a
// single entry for faster retrievals and more compact storage
let key_index = self.inner.next_key_index.fetch_add(1, Ordering::SeqCst);
let key = Self::key(key_index);
let value = segment_headers_to_store.encode();
let insert_data = vec![(key.as_slice(), value.as_slice())];
{
let key_index = self.inner.next_key_index.fetch_add(1, Ordering::SeqCst);
let key = Self::key(key_index);
let value = segment_headers_to_store.encode();
let insert_data = vec![(key.as_slice(), value.as_slice())];

self.inner.aux_store.insert_aux(&insert_data, &[])?;
self.inner.aux_store.insert_aux(&insert_data, &[])?;
}
self.inner.cache.lock().extend(segment_headers_to_store);

Ok(())
Expand Down
2 changes: 0 additions & 2 deletions crates/subspace-service/src/dsn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pub mod import_blocks;

use crate::piece_cache::PieceCache;
use sc_client_api::AuxStore;
use sc_consensus_subspace::SegmentHeadersStore;
Expand Down
310 changes: 0 additions & 310 deletions crates/subspace-service/src/dsn/import_blocks.rs

This file was deleted.

Loading