Skip to content

Commit

Permalink
Merge pull request #2247 from subspace/minor-node-tweaks
Browse files Browse the repository at this point in the history
Minor node tweaks
  • Loading branch information
nazar-pc authored Nov 19, 2023
2 parents f54777f + 00345fc commit 7136a10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 13 additions & 10 deletions crates/subspace-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ where
executor.clone(),
)?;

let kzg = Kzg::new(embedded_kzg_settings());
let kzg = tokio::task::block_in_place(|| Kzg::new(embedded_kzg_settings()));

let client = Arc::new(client);

Expand Down Expand Up @@ -461,8 +461,9 @@ where

let select_chain = sc_consensus::LongestChain::new(backend.clone());

let segment_headers_store = SegmentHeadersStore::new(client.clone())
.map_err(|error| ServiceError::Application(error.into()))?;
let segment_headers_store =
tokio::task::block_in_place(|| SegmentHeadersStore::new(client.clone()))
.map_err(|error| ServiceError::Application(error.into()))?;

let (block_import, subspace_link) = sc_consensus_subspace::block_import::<
PosTable,
Expand Down Expand Up @@ -802,13 +803,15 @@ where

let sync_oracle = SubspaceSyncOracle::new(config.base.force_authoring, sync_service.clone());

let subspace_archiver = create_subspace_archiver(
segment_headers_store.clone(),
&subspace_link,
client.clone(),
sync_oracle.clone(),
telemetry.as_ref().map(|telemetry| telemetry.handle()),
)
let subspace_archiver = tokio::task::block_in_place(|| {
create_subspace_archiver(
segment_headers_store.clone(),
&subspace_link,
client.clone(),
sync_oracle.clone(),
telemetry.as_ref().map(|telemetry| telemetry.handle()),
)
})
.map_err(ServiceError::Client)?;

task_manager
Expand Down
4 changes: 3 additions & 1 deletion shared/subspace-metrics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ pub fn start_prometheus_metrics_server(
let data = Data::new(shared_registry);

let app_factory = move || App::new().app_data(data.clone()).service(metrics);
let result = HttpServer::new(app_factory.clone()).bind(endpoints.as_slice());
let result = HttpServer::new(app_factory.clone())
.workers(2)
.bind(endpoints.as_slice());

let server = match result {
Ok(server) => server,
Expand Down

0 comments on commit 7136a10

Please sign in to comment.