diff --git a/core/src/tvu.rs b/core/src/tvu.rs index be5929570..2d0e8398a 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -98,7 +98,6 @@ pub struct TvuConfig { pub accounts_hash_fault_injection_slots: u64, pub accounts_db_caching_enabled: bool, pub test_hash_calculation: bool, - pub use_index_hash_calculation: bool, pub rocksdb_compaction_interval: Option, pub rocksdb_max_compaction_jitter: Option, pub wait_for_vote_to_start_leader: bool, @@ -358,7 +357,6 @@ impl Tvu { accounts_background_request_handler, tvu_config.accounts_db_caching_enabled, tvu_config.test_hash_calculation, - tvu_config.use_index_hash_calculation, last_full_snapshot_slot, ); diff --git a/core/src/validator.rs b/core/src/validator.rs index f71f0cd83..bb1fbab9a 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -162,7 +162,6 @@ pub struct ValidatorConfig { pub warp_slot: Option, pub accounts_db_test_hash_calculation: bool, pub accounts_db_skip_shrink: bool, - pub accounts_db_use_index_hash_calculation: bool, pub tpu_coalesce_ms: u64, pub validator_exit: Arc>, pub no_wait_for_vote_to_start_leader: bool, @@ -223,7 +222,6 @@ impl Default for ValidatorConfig { warp_slot: None, accounts_db_test_hash_calculation: false, accounts_db_skip_shrink: false, - accounts_db_use_index_hash_calculation: true, tpu_coalesce_ms: DEFAULT_TPU_COALESCE_MS, validator_exit: Arc::new(RwLock::new(Exit::default())), no_wait_for_vote_to_start_leader: true, @@ -915,7 +913,6 @@ impl Validator { accounts_hash_fault_injection_slots: config.accounts_hash_fault_injection_slots, accounts_db_caching_enabled: config.accounts_db_caching_enabled, test_hash_calculation: config.accounts_db_test_hash_calculation, - use_index_hash_calculation: config.accounts_db_use_index_hash_calculation, rocksdb_compaction_interval: config.rocksdb_compaction_interval, rocksdb_max_compaction_jitter: config.rocksdb_compaction_interval, wait_for_vote_to_start_leader, diff --git a/core/tests/snapshots.rs b/core/tests/snapshots.rs index 63657cfe3..02350295c 100644 --- a/core/tests/snapshots.rs +++ b/core/tests/snapshots.rs @@ -265,8 +265,7 @@ mod tests { // set_root should send a snapshot request bank_forks.set_root(bank.slot(), &request_sender, None); bank.update_accounts_hash(); - snapshot_request_handler - .handle_snapshot_requests(false, false, false, 0, &mut None); + snapshot_request_handler.handle_snapshot_requests(false, false, 0, &mut None); } } @@ -707,7 +706,6 @@ mod tests { bank_forks.set_root(bank.slot(), &request_sender, None); bank.update_accounts_hash(); snapshot_request_handler.handle_snapshot_requests( - false, false, false, 0, @@ -947,7 +945,6 @@ mod tests { &exit, abs_request_handler, false, - false, true, None, ); diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index 2c05fae4b..5b9b83bc9 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -1260,7 +1260,7 @@ fn load_frozen_forks( new_root_bank.exhaustively_free_unused_resource(*last_full_snapshot_slot); last_free = Instant::now(); new_root_bank.update_accounts_hash_with_index_option( - snapshot_config.accounts_hash_use_index, + false, snapshot_config.accounts_hash_debug_verify, false, ); diff --git a/local-cluster/src/validator_configs.rs b/local-cluster/src/validator_configs.rs index 46f4d206a..6ae588f02 100644 --- a/local-cluster/src/validator_configs.rs +++ b/local-cluster/src/validator_configs.rs @@ -55,7 +55,6 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig { warp_slot: config.warp_slot, accounts_db_test_hash_calculation: config.accounts_db_test_hash_calculation, accounts_db_skip_shrink: config.accounts_db_skip_shrink, - accounts_db_use_index_hash_calculation: config.accounts_db_use_index_hash_calculation, tpu_coalesce_ms: config.tpu_coalesce_ms, validator_exit: Arc::new(RwLock::new(Exit::default())), poh_hashes_per_batch: config.poh_hashes_per_batch, diff --git a/runtime/src/accounts_background_service.rs b/runtime/src/accounts_background_service.rs index e51fa7749..369f9d7a1 100644 --- a/runtime/src/accounts_background_service.rs +++ b/runtime/src/accounts_background_service.rs @@ -94,7 +94,6 @@ impl SnapshotRequestHandler { &self, accounts_db_caching_enabled: bool, test_hash_calculation: bool, - use_index_hash_calculation: bool, non_snapshot_time_us: u128, last_full_snapshot_slot: &mut Option, ) -> Option> { @@ -145,6 +144,7 @@ impl SnapshotRequestHandler { } flush_accounts_cache_time.stop(); + let use_index_hash_calculation = false; let mut hash_time = Measure::start("hash_time"); let this_hash = snapshot_root_bank.update_accounts_hash_with_index_option( use_index_hash_calculation, @@ -320,7 +320,6 @@ impl AbsRequestHandler { &self, accounts_db_caching_enabled: bool, test_hash_calculation: bool, - use_index_hash_calculation: bool, non_snapshot_time_us: u128, last_full_snapshot_slot: &mut Option, ) -> Option> { @@ -330,7 +329,6 @@ impl AbsRequestHandler { snapshot_request_handler.handle_snapshot_requests( accounts_db_caching_enabled, test_hash_calculation, - use_index_hash_calculation, non_snapshot_time_us, last_full_snapshot_slot, ) @@ -362,7 +360,6 @@ impl AccountsBackgroundService { request_handler: AbsRequestHandler, accounts_db_caching_enabled: bool, test_hash_calculation: bool, - use_index_hash_calculation: bool, mut last_full_snapshot_slot: Option, ) -> Self { info!("AccountsBackgroundService active"); @@ -421,7 +418,6 @@ impl AccountsBackgroundService { .handle_snapshot_requests( accounts_db_caching_enabled, test_hash_calculation, - use_index_hash_calculation, non_snapshot_time, &mut last_full_snapshot_slot, ); diff --git a/runtime/src/snapshot_config.rs b/runtime/src/snapshot_config.rs index 4a6061d3f..40190b744 100644 --- a/runtime/src/snapshot_config.rs +++ b/runtime/src/snapshot_config.rs @@ -32,9 +32,6 @@ pub struct SnapshotConfig { /// NOTE: Incremental snapshots will only be kept for the latest full snapshot pub maximum_incremental_snapshot_archives_to_retain: usize, - /// This is the `use_index` parameter to use when calling `update_accounts_hash()` - pub accounts_hash_use_index: bool, - /// This is the `debug_verify` parameter to use when calling `update_accounts_hash()` pub accounts_hash_debug_verify: bool, @@ -57,7 +54,6 @@ impl Default for SnapshotConfig { snapshot_utils::DEFAULT_MAX_FULL_SNAPSHOT_ARCHIVES_TO_RETAIN, maximum_incremental_snapshot_archives_to_retain: snapshot_utils::DEFAULT_MAX_INCREMENTAL_SNAPSHOT_ARCHIVES_TO_RETAIN, - accounts_hash_use_index: false, accounts_hash_debug_verify: false, packager_thread_niceness_adj: 0, } diff --git a/validator/src/main.rs b/validator/src/main.rs index c03bd16d6..6826e0c13 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -1618,14 +1618,16 @@ pub fn main() { Arg::with_name("accounts_db_index_hashing") .long("accounts-db-index-hashing") .help("Enables the use of the index in hash calculation in \ - AccountsHashVerifier/Accounts Background Service."), + AccountsHashVerifier/Accounts Background Service.") + .hidden(true), ) .arg( Arg::with_name("no_accounts_db_index_hashing") .long("no-accounts-db-index-hashing") .help("This is obsolete. See --accounts-db-index-hashing. \ Disables the use of the index in hash calculation in \ - AccountsHashVerifier/Accounts Background Service."), + AccountsHashVerifier/Accounts Background Service.") + .hidden(true), ) .arg( // legacy nop argument @@ -2329,6 +2331,12 @@ pub fn main() { None }; + if matches.is_present("accounts_db_index_hashing") { + info!("The accounts hash is only calculated without using the index. --accounts-db-index-hashing is deprecated and can be removed from the command line"); + } + if matches.is_present("no_accounts_db_index_hashing") { + info!("The accounts hash is only calculated without using the index. --no-accounts-db-index-hashing is deprecated and can be removed from the command line"); + } let mut validator_config = ValidatorConfig { require_tower: matches.is_present("require_tower"), tower_storage, @@ -2443,7 +2451,6 @@ pub fn main() { accounts_db_test_hash_calculation: matches.is_present("accounts_db_test_hash_calculation"), accounts_db_config, accounts_db_skip_shrink: matches.is_present("accounts_db_skip_shrink"), - accounts_db_use_index_hash_calculation: matches.is_present("accounts_db_index_hashing"), tpu_coalesce_ms, no_wait_for_vote_to_start_leader: matches.is_present("no_wait_for_vote_to_start_leader"), accounts_shrink_ratio, @@ -2586,7 +2593,6 @@ pub fn main() { snapshot_version, maximum_full_snapshot_archives_to_retain, maximum_incremental_snapshot_archives_to_retain, - accounts_hash_use_index: validator_config.accounts_db_use_index_hash_calculation, accounts_hash_debug_verify: validator_config.accounts_db_test_hash_calculation, packager_thread_niceness_adj: snapshot_packager_niceness_adj, });