Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit be77bde

Browse files
authored
Allow lower shred count (#9410)
1 parent f3afe5c commit be77bde

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

core/src/ledger_cleanup_service.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ use std::thread;
1313
use std::thread::{Builder, JoinHandle};
1414
use std::time::Duration;
1515

16-
// - To try and keep the RocksDB size under 512GB:
17-
// Seeing about 1600b/shred, using 2000b/shred for margin, so 250m shreds can be stored in 512gb.
18-
// at 5k shreds/slot at 50k tps, this is 500k slots (~5.5 hours).
16+
// - To try and keep the RocksDB size under 400GB:
17+
// Seeing about 1600b/shred, using 2000b/shred for margin, so 200m shreds can be stored in 400gb.
18+
// at 5k shreds/slot at 50k tps, this is 500k slots (~5 hours).
1919
// At idle, 60 shreds/slot this is about 4m slots (18 days)
2020
// This is chosen to allow enough time for
2121
// - A validator to download a snapshot from a peer and boot from it
2222
// - To make sure that if a validator needs to reboot from its own snapshot, it has enough slots locally
2323
// to catch back up to where it was when it stopped
24-
pub const DEFAULT_MAX_LEDGER_SHREDS: u64 = 250_000_000;
24+
pub const DEFAULT_MAX_LEDGER_SHREDS: u64 = 200_000_000;
25+
26+
// Allow down to 50m, or 3.5 days at idle, 1hr at 50k load, around ~100GB
27+
pub const DEFAULT_MIN_MAX_LEDGER_SHREDS: u64 = 50_000_000;
2528

2629
// Check for removing slots at this interval so we don't purge too often
2730
// and starve other blockstore users.

validator/src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ use solana_clap_utils::{
1010
keypair::SKIP_SEED_PHRASE_VALIDATION_ARG,
1111
};
1212
use solana_client::rpc_client::RpcClient;
13-
use solana_core::ledger_cleanup_service::DEFAULT_MAX_LEDGER_SHREDS;
13+
use solana_core::ledger_cleanup_service::{
14+
DEFAULT_MAX_LEDGER_SHREDS, DEFAULT_MIN_MAX_LEDGER_SHREDS,
15+
};
1416
use solana_core::{
1517
cluster_info::{ClusterInfo, Node, VALIDATOR_PORT_RANGE},
1618
contact_info::ContactInfo,
@@ -872,10 +874,10 @@ pub fn main() {
872874

873875
if matches.is_present("limit_ledger_size") {
874876
let limit_ledger_size = value_t_or_exit!(matches, "limit_ledger_size", u64);
875-
if limit_ledger_size < DEFAULT_MAX_LEDGER_SHREDS {
877+
if limit_ledger_size < DEFAULT_MIN_MAX_LEDGER_SHREDS {
876878
eprintln!(
877879
"The provided --limit-ledger-size value was too small, the minimum value is {}",
878-
DEFAULT_MAX_LEDGER_SHREDS
880+
DEFAULT_MIN_MAX_LEDGER_SHREDS
879881
);
880882
exit(1);
881883
}

0 commit comments

Comments
 (0)