poh_verify => run_verification: Rename to be more accurate (#30811)

`poh_verify` actually disables transaction signature, tick count and
built in program argument verifications as well.  It is somewhat
confusing to call it `poh_verify`.
This commit is contained in:
Illia Bobyr 2023-03-22 11:03:30 -07:00 committed by GitHub
parent 9adb321bed
commit 809041b151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 66 additions and 33 deletions

View File

@ -152,7 +152,9 @@ pub struct ValidatorConfig {
pub accounts_hash_interval_slots: u64, pub accounts_hash_interval_slots: u64,
pub max_genesis_archive_unpacked_size: u64, pub max_genesis_archive_unpacked_size: u64,
pub wal_recovery_mode: Option<BlockstoreRecoveryMode>, pub wal_recovery_mode: Option<BlockstoreRecoveryMode>,
pub poh_verify: bool, // Perform PoH verification during blockstore processing at boo /// Run PoH, transaction signature and other transaction verifications during blockstore
/// processing.
pub run_verification: bool,
pub require_tower: bool, pub require_tower: bool,
pub tower_storage: Arc<dyn TowerStorage>, pub tower_storage: Arc<dyn TowerStorage>,
pub debug_keys: Option<Arc<HashSet<Pubkey>>>, pub debug_keys: Option<Arc<HashSet<Pubkey>>>,
@ -216,7 +218,7 @@ impl Default for ValidatorConfig {
accounts_hash_interval_slots: std::u64::MAX, accounts_hash_interval_slots: std::u64::MAX,
max_genesis_archive_unpacked_size: MAX_GENESIS_ARCHIVE_UNPACKED_SIZE, max_genesis_archive_unpacked_size: MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
wal_recovery_mode: None, wal_recovery_mode: None,
poh_verify: true, run_verification: true,
require_tower: false, require_tower: false,
tower_storage: Arc::new(crate::tower_storage::NullTowerStorage::default()), tower_storage: Arc::new(crate::tower_storage::NullTowerStorage::default()),
debug_keys: None, debug_keys: None,
@ -1483,7 +1485,7 @@ fn load_blockstore(
.or_else(|| blockstore.highest_slot().unwrap_or(None)); .or_else(|| blockstore.highest_slot().unwrap_or(None));
let process_options = blockstore_processor::ProcessOptions { let process_options = blockstore_processor::ProcessOptions {
poh_verify: config.poh_verify, run_verification: config.run_verification,
halt_at_slot, halt_at_slot,
new_hard_forks: config.new_hard_forks.clone(), new_hard_forks: config.new_hard_forks.clone(),
debug_keys: config.debug_keys.clone(), debug_keys: config.debug_keys.clone(),

View File

@ -1931,7 +1931,16 @@ fn main() {
Arg::with_name("skip_poh_verify") Arg::with_name("skip_poh_verify")
.long("skip-poh-verify") .long("skip-poh-verify")
.takes_value(false) .takes_value(false)
.help("Skip ledger PoH verification"), .help(
"Deprecated, please use --skip-verification.\n\
Skip ledger PoH and transaction verification."
),
)
.arg(
Arg::with_name("skip_verification")
.long("skip-verification")
.takes_value(false)
.help("Skip ledger PoH and transaction verification."),
) )
.arg( .arg(
Arg::with_name("print_accounts_stats") Arg::with_name("print_accounts_stats")
@ -2529,7 +2538,7 @@ fn main() {
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
halt_at_slot: Some(0), halt_at_slot: Some(0),
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
let genesis_config = open_genesis_config_by(&ledger_path, arg_matches); let genesis_config = open_genesis_config_by(&ledger_path, arg_matches);
@ -2620,7 +2629,7 @@ fn main() {
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
halt_at_slot: value_t!(arg_matches, "halt_at_slot", Slot).ok(), halt_at_slot: value_t!(arg_matches, "halt_at_slot", Slot).ok(),
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
let genesis_config = open_genesis_config_by(&ledger_path, arg_matches); let genesis_config = open_genesis_config_by(&ledger_path, arg_matches);
@ -2828,9 +2837,16 @@ fn main() {
let debug_keys = pubkeys_of(arg_matches, "debug_key") let debug_keys = pubkeys_of(arg_matches, "debug_key")
.map(|pubkeys| Arc::new(pubkeys.into_iter().collect::<HashSet<_>>())); .map(|pubkeys| Arc::new(pubkeys.into_iter().collect::<HashSet<_>>()));
if arg_matches.is_present("skip_poh_verify") {
eprintln!(
"--skip-poh-verify is deprecated. Replace with --skip-verification."
);
}
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
poh_verify: !arg_matches.is_present("skip_poh_verify"), run_verification: !(arg_matches.is_present("skip_poh_verify")
|| arg_matches.is_present("skip_verification")),
on_halt_store_hash_raw_data_for_debug: arg_matches on_halt_store_hash_raw_data_for_debug: arg_matches
.is_present("halt_at_slot_store_hash_raw_data"), .is_present("halt_at_slot_store_hash_raw_data"),
// ledger tool verify always runs the accounts hash calc at the end of processing the blockstore // ledger tool verify always runs the accounts hash calc at the end of processing the blockstore
@ -2898,7 +2914,7 @@ fn main() {
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
halt_at_slot: value_t!(arg_matches, "halt_at_slot", Slot).ok(), halt_at_slot: value_t!(arg_matches, "halt_at_slot", Slot).ok(),
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -3082,7 +3098,7 @@ fn main() {
ProcessOptions { ProcessOptions {
new_hard_forks, new_hard_forks,
halt_at_slot: Some(snapshot_slot), halt_at_slot: Some(snapshot_slot),
poh_verify: false, run_verification: false,
accounts_db_config: Some(get_accounts_db_config(&ledger_path, arg_matches)), accounts_db_config: Some(get_accounts_db_config(&ledger_path, arg_matches)),
accounts_db_skip_shrink: arg_matches.is_present("accounts_db_skip_shrink"), accounts_db_skip_shrink: arg_matches.is_present("accounts_db_skip_shrink"),
..ProcessOptions::default() ..ProcessOptions::default()
@ -3434,7 +3450,7 @@ fn main() {
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
halt_at_slot, halt_at_slot,
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
let genesis_config = open_genesis_config_by(&ledger_path, arg_matches); let genesis_config = open_genesis_config_by(&ledger_path, arg_matches);
@ -3523,7 +3539,7 @@ fn main() {
let process_options = ProcessOptions { let process_options = ProcessOptions {
new_hard_forks: hardforks_of(arg_matches, "hard_forks"), new_hard_forks: hardforks_of(arg_matches, "hard_forks"),
halt_at_slot, halt_at_slot,
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
let genesis_config = open_genesis_config_by(&ledger_path, arg_matches); let genesis_config = open_genesis_config_by(&ledger_path, arg_matches);

View File

@ -595,7 +595,8 @@ pub type ProcessCallback = Arc<dyn Fn(&Bank) + Sync + Send>;
#[derive(Default, Clone)] #[derive(Default, Clone)]
pub struct ProcessOptions { pub struct ProcessOptions {
pub poh_verify: bool, /// Run PoH, transaction signature and other transaction verifications on the entries.
pub run_verification: bool,
pub full_leader_cache: bool, pub full_leader_cache: bool,
pub halt_at_slot: Option<Slot>, pub halt_at_slot: Option<Slot>,
pub new_hard_forks: Option<Vec<Slot>>, pub new_hard_forks: Option<Vec<Slot>>,
@ -885,7 +886,7 @@ fn confirm_full_slot(
timing: &mut ExecuteTimings, timing: &mut ExecuteTimings,
) -> result::Result<(), BlockstoreProcessorError> { ) -> result::Result<(), BlockstoreProcessorError> {
let mut confirmation_timing = ConfirmationTiming::default(); let mut confirmation_timing = ConfirmationTiming::default();
let skip_verification = !opts.poh_verify; let skip_verification = !opts.run_verification;
let _ignored_prioritization_fee_cache = PrioritizationFeeCache::new(0u64); let _ignored_prioritization_fee_cache = PrioritizationFeeCache::new(0u64);
confirm_slot( confirm_slot(
@ -1896,7 +1897,7 @@ pub mod tests {
&genesis_config, &genesis_config,
&blockstore, &blockstore,
&ProcessOptions { &ProcessOptions {
poh_verify: true, run_verification: true,
..ProcessOptions::default() ..ProcessOptions::default()
}, },
blockstore_access_type.clone(), blockstore_access_type.clone(),
@ -1951,7 +1952,7 @@ pub mod tests {
&genesis_config, &genesis_config,
&blockstore, &blockstore,
&ProcessOptions { &ProcessOptions {
poh_verify: true, run_verification: true,
..ProcessOptions::default() ..ProcessOptions::default()
}, },
&Arc::default(), &Arc::default(),
@ -1966,7 +1967,7 @@ pub mod tests {
&genesis_config, &genesis_config,
&blockstore, &blockstore,
&ProcessOptions { &ProcessOptions {
poh_verify: true, run_verification: true,
..ProcessOptions::default() ..ProcessOptions::default()
}, },
&Arc::default(), &Arc::default(),
@ -2020,7 +2021,7 @@ pub mod tests {
); );
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2085,7 +2086,7 @@ pub mod tests {
fill_blockstore_slot_with_ticks(&blockstore, ticks_per_slot, 2, 1, blockhash); fill_blockstore_slot_with_ticks(&blockstore, ticks_per_slot, 2, 1, blockhash);
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2103,7 +2104,7 @@ pub mod tests {
slot 2 (all ticks) slot 2 (all ticks)
*/ */
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2172,7 +2173,7 @@ pub mod tests {
blockstore.set_roots(vec![0, 1, 4].iter()).unwrap(); blockstore.set_roots(vec![0, 1, 4].iter()).unwrap();
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2252,7 +2253,7 @@ pub mod tests {
blockstore.set_roots(vec![0, 1].iter()).unwrap(); blockstore.set_roots(vec![0, 1].iter()).unwrap();
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2466,7 +2467,7 @@ pub mod tests {
// Check that we can properly restart the ledger / leader scheduler doesn't fail // Check that we can properly restart the ledger / leader scheduler doesn't fail
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2611,7 +2612,7 @@ pub mod tests {
) )
.unwrap(); .unwrap();
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -2642,7 +2643,7 @@ pub mod tests {
let blockstore = Blockstore::open(ledger_path.path()).unwrap(); let blockstore = Blockstore::open(ledger_path.path()).unwrap();
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -3316,7 +3317,7 @@ pub mod tests {
// Specify halting at slot 0 // Specify halting at slot 0
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
halt_at_slot: Some(0), halt_at_slot: Some(0),
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
@ -3370,7 +3371,7 @@ pub mod tests {
let mut bank_forks = BankForks::new(Bank::new_for_tests(&genesis_config)); let mut bank_forks = BankForks::new(Bank::new_for_tests(&genesis_config));
let bank0 = bank_forks.get(0).unwrap(); let bank0 = bank_forks.get(0).unwrap();
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
@ -3834,7 +3835,7 @@ pub mod tests {
} }
let opts = ProcessOptions { let opts = ProcessOptions {
poh_verify: true, run_verification: true,
accounts_db_test_hash_calculation: true, accounts_db_test_hash_calculation: true,
..ProcessOptions::default() ..ProcessOptions::default()
}; };

View File

@ -36,7 +36,7 @@ pub fn safe_clone_config(config: &ValidatorConfig) -> ValidatorConfig {
accounts_hash_interval_slots: config.accounts_hash_interval_slots, accounts_hash_interval_slots: config.accounts_hash_interval_slots,
max_genesis_archive_unpacked_size: config.max_genesis_archive_unpacked_size, max_genesis_archive_unpacked_size: config.max_genesis_archive_unpacked_size,
wal_recovery_mode: config.wal_recovery_mode.clone(), wal_recovery_mode: config.wal_recovery_mode.clone(),
poh_verify: config.poh_verify, run_verification: config.run_verification,
require_tower: config.require_tower, require_tower: config.require_tower,
tower_storage: config.tower_storage.clone(), tower_storage: config.tower_storage.clone(),
debug_keys: config.debug_keys.clone(), debug_keys: config.debug_keys.clone(),

View File

@ -23,7 +23,7 @@ use {
}, },
solana_local_cluster::{ solana_local_cluster::{
cluster::{Cluster, ClusterValidatorInfo}, cluster::{Cluster, ClusterValidatorInfo},
cluster_tests::{self}, cluster_tests,
local_cluster::{ClusterConfig, LocalCluster}, local_cluster::{ClusterConfig, LocalCluster},
validator_configs::*, validator_configs::*,
}, },
@ -2154,7 +2154,7 @@ fn create_snapshot_to_hard_fork(
let process_options = ProcessOptions { let process_options = ProcessOptions {
halt_at_slot: Some(snapshot_slot), halt_at_slot: Some(snapshot_slot),
new_hard_forks: Some(hard_forks), new_hard_forks: Some(hard_forks),
poh_verify: false, run_verification: false,
..ProcessOptions::default() ..ProcessOptions::default()
}; };
let ledger_path = blockstore.ledger_path(); let ledger_path = blockstore.ledger_path();

View File

@ -941,7 +941,7 @@ impl TestValidator {
.unwrap() .unwrap()
.0, .0,
], ],
poh_verify: false, // Skip PoH verification of ledger on startup for speed run_verification: false, // Skip PoH verification of ledger on startup for speed
snapshot_config: SnapshotConfig { snapshot_config: SnapshotConfig {
full_snapshot_archive_interval_slots: 100, full_snapshot_archive_interval_slots: 100,
incremental_snapshot_archive_interval_slots: Slot::MAX, incremental_snapshot_archive_interval_slots: Slot::MAX,

View File

@ -613,7 +613,16 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
Arg::with_name("skip_poh_verify") Arg::with_name("skip_poh_verify")
.long("skip-poh-verify") .long("skip-poh-verify")
.takes_value(false) .takes_value(false)
.help("Skip ledger verification at validator bootup"), .help(
"Deprecated, please use --skip-verification.\n\
Skip ledger verification at validator bootup."
),
)
.arg(
Arg::with_name("skip_verification")
.long("skip-verification")
.takes_value(false)
.help("Skip ledger verification at validator bootup."),
) )
.arg( .arg(
Arg::with_name("cuda") Arg::with_name("cuda")

View File

@ -1188,6 +1188,10 @@ pub fn main() {
} }
let full_api = matches.is_present("full_rpc_api"); let full_api = matches.is_present("full_rpc_api");
if matches.is_present("skip_poh_verify") {
eprintln!("--skip-poh-verify is deprecated. Replace with --skip-verification.");
}
let mut validator_config = ValidatorConfig { let mut validator_config = ValidatorConfig {
require_tower: matches.is_present("require_tower"), require_tower: matches.is_present("require_tower"),
tower_storage, tower_storage,
@ -1272,7 +1276,8 @@ pub fn main() {
repair_whitelist, repair_whitelist,
gossip_validators, gossip_validators,
wal_recovery_mode, wal_recovery_mode,
poh_verify: !matches.is_present("skip_poh_verify"), run_verification: !(matches.is_present("skip_poh_verify")
|| matches.is_present("skip_verification")),
debug_keys, debug_keys,
contact_debug_interval, contact_debug_interval,
send_transaction_service_config: send_transaction_service::Config { send_transaction_service_config: send_transaction_service::Config {