diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index d354930215..191fe78ed9 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -151,7 +151,7 @@ impl Accounts { } if solana_sdk::sysvar::instructions::check_id(key) - && feature_set.active(&feature_set::instructions_sysvar_enabled::id()) + && feature_set.is_active(&feature_set::instructions_sysvar_enabled::id()) { if message.is_writable(i) { return Err(TransactionError::InvalidAccountIndex); @@ -307,7 +307,7 @@ impl Accounts { let fee_config = FeeConfig { secp256k1_program_enabled: feature_set - .active(&feature_set::secp256k1_program_enabled::id()), + .is_active(&feature_set::secp256k1_program_enabled::id()), }; OrderedIterator::new(txs, txs_iteration_order) .zip(lock_results.into_iter()) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 411b0dccb5..83c8794455 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3465,7 +3465,7 @@ impl Bank { pub fn secp256k1_program_enabled(&self) -> bool { self.feature_set - .active(&feature_set::secp256k1_program_enabled::id()) + .is_active(&feature_set::secp256k1_program_enabled::id()) } // This is called from snapshot restore AND for each epoch boundary @@ -3531,7 +3531,7 @@ impl Bank { } for (program, feature) in get_feature_builtins() { - let should_populate = init_or_warp && self.feature_set.active(&feature) + let should_populate = init_or_warp && self.feature_set.is_active(&feature) || !init_or_warp && new_feature_activations.contains(&feature); if should_populate { self.add_builtin(&program.name, program.id, program.entrypoint); @@ -9009,13 +9009,13 @@ mod tests { let new_activations = bank.compute_active_feature_set(true); assert!(new_activations.is_empty()); - assert!(!bank.feature_set.active(&test_feature)); + assert!(!bank.feature_set.is_active(&test_feature)); // Depositing into the `test_feature` account should do nothing bank.deposit(&test_feature, 42); let new_activations = bank.compute_active_feature_set(true); assert!(new_activations.is_empty()); - assert!(!bank.feature_set.active(&test_feature)); + assert!(!bank.feature_set.is_active(&test_feature)); // Request `test_feature` activation let feature = Feature::default(); @@ -9025,7 +9025,7 @@ mod tests { // Run `compute_active_feature_set` disallowing new activations let new_activations = bank.compute_active_feature_set(false); assert!(new_activations.is_empty()); - assert!(!bank.feature_set.active(&test_feature)); + assert!(!bank.feature_set.is_active(&test_feature)); let feature = Feature::from_account(&bank.get_account(&test_feature).expect("get_account")) .expect("from_account"); assert_eq!(feature.activated_at, None); @@ -9033,19 +9033,19 @@ mod tests { // Run `compute_active_feature_set` allowing new activations let new_activations = bank.compute_active_feature_set(true); assert_eq!(new_activations.len(), 1); - assert!(bank.feature_set.active(&test_feature)); + assert!(bank.feature_set.is_active(&test_feature)); let feature = Feature::from_account(&bank.get_account(&test_feature).expect("get_account")) .expect("from_account"); assert_eq!(feature.activated_at, Some(1)); // Reset the bank's feature set bank.feature_set = Arc::new(feature_set); - assert!(!bank.feature_set.active(&test_feature)); + assert!(!bank.feature_set.is_active(&test_feature)); // Running `compute_active_feature_set` will not cause new activations, but // `test_feature` is now be active let new_activations = bank.compute_active_feature_set(true); assert!(new_activations.is_empty()); - assert!(bank.feature_set.active(&test_feature)); + assert!(bank.feature_set.is_active(&test_feature)); } } diff --git a/runtime/src/feature_set.rs b/runtime/src/feature_set.rs index 19acb5430f..6d17f2ddbc 100644 --- a/runtime/src/feature_set.rs +++ b/runtime/src/feature_set.rs @@ -44,7 +44,7 @@ pub struct FeatureSet { } impl FeatureSet { - pub fn active(&self, feature_id: &Pubkey) -> bool { + pub fn is_active(&self, feature_id: &Pubkey) -> bool { self.active.contains(feature_id) } } diff --git a/runtime/src/message_processor.rs b/runtime/src/message_processor.rs index ae10a48ed8..43a48d8fba 100644 --- a/runtime/src/message_processor.rs +++ b/runtime/src/message_processor.rs @@ -685,7 +685,7 @@ impl MessageProcessor { ) -> Result<(), InstructionError> { // Fixup the special instructions key if present // before the account pre-values are taken care of - if feature_set.active(&feature_set::instructions_sysvar_enabled::id()) { + if feature_set.is_active(&feature_set::instructions_sysvar_enabled::id()) { for (i, key) in message.account_keys.iter().enumerate() { if solana_sdk::sysvar::instructions::check_id(key) { let mut mut_account_ref = accounts[i].borrow_mut();