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

Commit 02a83e7

Browse files
authored
Allow lower shred count (#9410) (#9451)
automerge
1 parent 83263e1 commit 02a83e7

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
@@ -13,7 +13,9 @@ use solana_clap_utils::{
1313
keypair::SKIP_SEED_PHRASE_VALIDATION_ARG,
1414
};
1515
use solana_client::rpc_client::RpcClient;
16-
use solana_core::ledger_cleanup_service::DEFAULT_MAX_LEDGER_SHREDS;
16+
use solana_core::ledger_cleanup_service::{
17+
DEFAULT_MAX_LEDGER_SHREDS, DEFAULT_MIN_MAX_LEDGER_SHREDS,
18+
};
1719
use solana_core::{
1820
cluster_info::{ClusterInfo, Node, VALIDATOR_PORT_RANGE},
1921
contact_info::ContactInfo,
@@ -1027,10 +1029,10 @@ pub fn main() {
10271029

10281030
if matches.is_present("limit_ledger_size") {
10291031
let limit_ledger_size = value_t_or_exit!(matches, "limit_ledger_size", u64);
1030-
if limit_ledger_size < DEFAULT_MAX_LEDGER_SHREDS {
1032+
if limit_ledger_size < DEFAULT_MIN_MAX_LEDGER_SHREDS {
10311033
eprintln!(
10321034
"The provided --limit-ledger-size value was too small, the minimum value is {}",
1033-
DEFAULT_MAX_LEDGER_SHREDS
1035+
DEFAULT_MIN_MAX_LEDGER_SHREDS
10341036
);
10351037
exit(1);
10361038
}

0 commit comments

Comments
 (0)