Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
34577eb
service: storage monitor added
michalkucharczyk Jan 5, 2023
b5f970b
Merge remote-tracking branch 'origin/master' into mku-storage-monitor
michalkucharczyk Jan 6, 2023
37bbba4
Cargo.lock updated
michalkucharczyk Jan 6, 2023
ba0f28f
misspell
michalkucharczyk Jan 9, 2023
e360685
fs events throttling added
michalkucharczyk Jan 9, 2023
fd5679f
minor updates
michalkucharczyk Jan 9, 2023
217234f
filter out non mutating events
michalkucharczyk Jan 9, 2023
8b3310b
misspell
michalkucharczyk Jan 9, 2023
931339c
".git/.scripts/commands/fmt/fmt.sh"
Jan 10, 2023
c200159
Update client/service/src/storage_monitor.rs
michalkucharczyk Jan 12, 2023
f5501f2
storage-monitor crate added
michalkucharczyk Jan 13, 2023
45171dc
cleanup: configuration + service builder
michalkucharczyk Jan 13, 2023
f346394
storage_monitor in custom service (wip)
michalkucharczyk Jan 13, 2023
eb49400
copy-paste bad desc fixed
michalkucharczyk Jan 13, 2023
8619766
notify removed
michalkucharczyk Jan 16, 2023
a0cd44d
storage_monitor added to node
michalkucharczyk Jan 16, 2023
d3f143c
Merge remote-tracking branch 'origin/master' into mku-storage-monitor
Jan 16, 2023
a79af9a
fix for clippy
michalkucharczyk Jan 16, 2023
00e7264
publish = false
michalkucharczyk Jan 16, 2023
6c3eb1c
Update bin/node/cli/src/command.rs
michalkucharczyk Jan 17, 2023
58dcf55
Apply suggestions from code review
michalkucharczyk Jan 23, 2023
95b576b
crate name: storage-monitor -> sc-storage-monitor
michalkucharczyk Jan 23, 2023
0b8697e
error handling improved
michalkucharczyk Jan 23, 2023
c0fc2ca
Merge remote-tracking branch 'origin/master' into mku-storage-monitor
michalkucharczyk Jan 23, 2023
de35dda
Apply suggestions from code review
michalkucharczyk Jan 23, 2023
4e32f3d
publish=false removed
michalkucharczyk Jan 24, 2023
0578588
Merge remote-tracking branch 'origin/master' into mku-storage-monitor
Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup: configuration + service builder
  • Loading branch information
michalkucharczyk committed Jan 13, 2023
commit 45171dccb78df43a508d49c0ffaa12c46a19618e
1 change: 0 additions & 1 deletion bin/node/cli/benches/block_production.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
base_path: Some(base_path),
informant_output_format: Default::default(),
wasm_runtime_overrides: None,
available_storage_threshold: 1000,
};

node_cli::service::new_full_base(config, false, |_, _| ())
Expand Down
1 change: 0 additions & 1 deletion bin/node/cli/benches/transaction_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
base_path: Some(base_path),
informant_output_format: Default::default(),
wasm_runtime_overrides: None,
available_storage_threshold: 1000,
};

node_cli::service::new_full_base(config, false, |_, _| ()).expect("Creates node")
Expand Down
11 changes: 0 additions & 11 deletions client/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,6 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
.unwrap_or_else(|| Ok((None, KeystoreConfig::InMemory)))
}

/// Get the database available storage space threshold.
///
/// By default this is retrieved from `DatabaseParams` if it is available.
fn database_storage_threshold(&self) -> Result<u64> {
Ok(self
.database_params()
.map(|x| x.database_storage_threshold())
.unwrap_or_default())
}

/// Get the database cache size.
///
/// By default this is retrieved from `DatabaseParams` if it is available. Otherwise its `None`.
Expand Down Expand Up @@ -572,7 +562,6 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
base_path: Some(base_path),
informant_output_format: Default::default(),
runtime_cache_size,
available_storage_threshold: self.database_storage_threshold()?,
})
}

Expand Down
11 changes: 0 additions & 11 deletions client/cli/src/params/database_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ pub struct DatabaseParams {
/// Limit the memory the database cache can use.
#[arg(long = "db-cache", value_name = "MiB")]
pub database_cache_size: Option<usize>,

/// Required available space on database storage. If available space for DB storage drops below
/// the given threshold, node will be gracefully terminated. If `0` is given monitoring will be
/// disabled.
#[arg(long = "db-storage-threshold", value_name = "MB", default_value_t = 1000)]
pub database_storage_threshold: u64,
}

impl DatabaseParams {
Expand All @@ -47,9 +41,4 @@ impl DatabaseParams {
pub fn database_cache_size(&self) -> Option<usize> {
self.database_cache_size
}

/// Available storage space threshold
pub fn database_storage_threshold(&self) -> u64 {
self.database_storage_threshold
}
}
1 change: 0 additions & 1 deletion client/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ mod tests {
base_path: None,
informant_output_format: Default::default(),
runtime_cache_size: 2,
available_storage_threshold: 1000,
},
runtime,
)
Expand Down
2 changes: 0 additions & 2 deletions client/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ tokio = { version = "1.22.0", features = ["time", "rt-multi-thread", "parking_lo
tempfile = "3.1.0"
directories = "4.0.1"
static_init = "1.0.3"
nix = { version = "0.26.1", features = ["fs"] }
notify = "5.0.0"

[dev-dependencies]
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }
Expand Down
9 changes: 0 additions & 9 deletions client/service/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use crate::{
error::Error,
metrics::MetricsService,
start_rpc_servers,
storage_monitor::StorageMonitorService,
BuildGenesisBlock, GenesisBlockBuilder, RpcHandlers, SpawnTaskHandle, TaskManager,
TransactionPoolAdapter,
};
Expand Down Expand Up @@ -536,14 +535,6 @@ where
metrics_service.run(client.clone(), transaction_pool.clone(), network.clone()),
);

if let Some(storage_monitor_service) = StorageMonitorService::new_for_config(&config)? {
task_manager.spawn_essential_handle().spawn(
"storage-monitor",
None,
storage_monitor_service.run(),
)
}

let rpc_id_provider = config.rpc_id_provider.take();

// jsonrpsee RPC
Expand Down
3 changes: 0 additions & 3 deletions client/service/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ pub struct Configuration {
pub informant_output_format: sc_informant::OutputFormat,
/// Maximum number of different runtime versions that can be cached.
pub runtime_cache_size: u8,
/// Threshold (in megabytes) for available storage space associated with `base_path`. `0` means
/// no storage monitoring.
pub available_storage_threshold: u64,
}

/// Type for tasks spawned by the executor.
Expand Down
1 change: 0 additions & 1 deletion client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ pub mod client;
#[cfg(not(feature = "test-helpers"))]
mod client;
mod metrics;
mod storage_monitor;
mod task_manager;

use std::{collections::HashMap, net::SocketAddr};
Expand Down
1 change: 0 additions & 1 deletion client/service/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ fn node_config<
base_path: Some(BasePath::new(root)),
informant_output_format: Default::default(),
runtime_cache_size: 2,
available_storage_threshold: 1000,
}
}

Expand Down