Skip to content

Commit 07c09f6

Browse files
committed
disable mark and sweep GC
1 parent b41a18e commit 07c09f6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/daemon/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ pub async fn start_interruptable(opts: CliOpts, config: Config) -> anyhow::Resul
137137
result
138138
}
139139

140-
// Garbage collection interval, currently set at 10 hours.
141-
const GC_INTERVAL: Duration = Duration::from_secs(60 * 60 * 10);
142-
143140
/// This function initialize Forest with below steps
144141
/// - increase file descriptor limit (for parity-db)
145142
/// - setup proofs parameter cache directory
@@ -278,12 +275,16 @@ async fn maybe_start_metrics_service(
278275
Ok(())
279276
}
280277

281-
fn maybe_start_gc_service(
278+
#[allow(dead_code)]
279+
fn maybe_start_mark_and_sweep_gc_service(
282280
services: &mut JoinSet<anyhow::Result<()>>,
283281
opts: &CliOpts,
284282
config: &Config,
285283
ctx: &AppContext,
286284
) {
285+
// Garbage collection interval, currently set at 10 hours.
286+
const GC_INTERVAL: Duration = Duration::from_secs(60 * 60 * 10);
287+
287288
if !opts.no_gc {
288289
let mut db_garbage_collector = {
289290
let chain_store = ctx.state_manager.chain_store().clone();
@@ -668,7 +669,7 @@ pub(super) async fn start_services(
668669
}
669670
ctx.state_manager.populate_cache();
670671
maybe_start_metrics_service(&mut services, &config, &ctx).await?;
671-
maybe_start_gc_service(&mut services, opts, &config, &ctx);
672+
// maybe_start_mark_and_sweep_gc_service(&mut services, opts, &config, &ctx);
672673
maybe_start_f3_service(opts, &config, &ctx);
673674
maybe_start_health_check_service(&mut services, &config, &p2p_service, &chain_follower, &ctx)
674675
.await?;

src/rpc/methods/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl RpcMethod<0> for ChainPruneSnapshot {
200200
const NAME: &'static str = "Forest.SnapshotGC";
201201
const PARAM_NAMES: [&'static str; 0] = [];
202202
const API_PATHS: BitFlags<ApiPaths> = ApiPaths::all();
203-
const PERMISSION: Permission = Permission::Admin;
203+
const PERMISSION: Permission = Permission::Read;
204204

205205
type Params = ();
206206
type Ok = ();

0 commit comments

Comments
 (0)