Skip to content

Commit 1af28ee

Browse files
authored
validator: Avoid AccountsDbConfig::default() (#10806)
Using a default trait implementation can be convenient for cases like tests where the config is inconsequential to the test. However, the convenience makes it easy to miss things in production cases where the consequences are greater. Make the validator specify each field in AccountsDbConfig instead of filling in the rest of the struct with ..AccountsDbConfig::default()
1 parent af4edcd commit 1af28ee

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

validator/src/commands/run/execute.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use {
2424
AccountSecondaryIndexes, AccountsIndexConfig, DEFAULT_NUM_ENTRIES_OVERHEAD,
2525
DEFAULT_NUM_ENTRIES_TO_EVICT, IndexLimit, IndexLimitThreshold, ScanFilter,
2626
},
27+
partitioned_rewards::PartitionedEpochRewardsConfig,
2728
utils::{
2829
create_all_accounts_run_and_snapshot_dirs, create_and_canonicalize_directories,
2930
create_and_canonicalize_directory,
@@ -683,6 +684,7 @@ pub fn execute(
683684
shrink_paths: account_shrink_run_paths,
684685
shrink_ratio,
685686
read_cache_limit_bytes,
687+
read_cache_evict_sample_size: None,
686688
write_cache_limit_bytes: value_t!(matches, "accounts_db_cache_limit_mb", u64)
687689
.ok()
688690
.map(|mb| mb * MB as u64),
@@ -694,7 +696,9 @@ pub fn execute(
694696
)
695697
.ok(),
696698
max_ancient_storages: value_t!(matches, "accounts_db_max_ancient_storages", usize).ok(),
699+
skip_initial_hash_calc: false,
697700
exhaustively_verify_refcounts: matches.is_present("accounts_db_verify_refcounts"),
701+
partitioned_epoch_rewards_config: PartitionedEpochRewardsConfig::default(),
698702
storage_access,
699703
scan_filter_for_shrinking,
700704
num_background_threads: Some(accounts_db_background_threads),
@@ -703,7 +707,7 @@ pub fn execute(
703707
use_registered_io_uring_buffers: resource_limits::check_memlock_limit_for_disk_io(
704708
solana_accounts_db::accounts_db::TOTAL_IO_URING_BUFFERS_SIZE_LIMIT,
705709
),
706-
..AccountsDbConfig::default()
710+
snapshots_use_direct_io: false,
707711
};
708712

709713
let on_start_geyser_plugin_config_files = if matches.is_present("geyser_plugin_config") {

0 commit comments

Comments
 (0)