Offchain: Disable http requests (#4188)

We don't use any http requests in the polkadot offchain workers.
This commit is contained in:
Bastian Köcher
2021-11-03 12:03:00 +01:00
committed by GitHub
parent 05bfc53878
commit ffcab0e78a
3 changed files with 186 additions and 165 deletions
+171 -161
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -24,6 +24,7 @@ sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch
sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" }
+14 -4
View File
@@ -797,11 +797,21 @@ where
})?;
if config.offchain_worker.enabled {
let _ = service::build_offchain_workers(
&config,
task_manager.spawn_handle(),
let offchain_workers = Arc::new(sc_offchain::OffchainWorkers::new_with_options(
client.clone(),
network.clone(),
sc_offchain::OffchainWorkerOptions { enable_http_requests: false },
));
// Start the offchain workers to have
task_manager.spawn_handle().spawn(
"offchain-notifications",
sc_offchain::notification_future(
config.role.is_authority(),
client.clone(),
offchain_workers,
task_manager.spawn_handle().clone(),
network.clone(),
),
);
}