Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solana-genesis: deactivate specific features for development clusters #2246

Merged
merged 4 commits into from
Jul 26, 2024

Conversation

gregcusack
Copy link

Problem

It's not very easy to deactivate specific features in development clusters. This is a step towards increasing feature activation granularity

Summary of Changes

  1. Add --deactivate-feature-set<feature-pubkey0> <feature-pubkey1> ... <feature-pubkeyN>
    • For ClusterType::Development clusters, all features are activated, this lets us deactivate specific ones. Example: in a development cluster we do not want to activate timely_vote_credits for a cluster running both v1.17 and v1.18 validators

Note: naming convention is kept in line with test-validator genesis

@gregcusack gregcusack requested a review from steviez July 23, 2024 16:59
@gregcusack gregcusack changed the title solana-genesos: deactivate specific features for development clusters solana-genesis: deactivate specific features for development clusters Jul 23, 2024
genesis/src/main.rs Outdated Show resolved Hide resolved
genesis/src/main.rs Outdated Show resolved Hide resolved
genesis/src/main.rs Outdated Show resolved Hide resolved
runtime/src/genesis_utils.rs Outdated Show resolved Hide resolved
runtime/src/genesis_utils.rs Outdated Show resolved Hide resolved
@gregcusack gregcusack force-pushed the genesis-deactivate-features branch from c67dff9 to 456552e Compare July 24, 2024 18:49
@gregcusack gregcusack requested a review from steviez July 24, 2024 19:48
Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more nit

@@ -200,6 +201,20 @@ pub fn activate_all_features(genesis_config: &mut GenesisConfig) {
}
}

pub fn deactivate_features(genesis_config: &mut GenesisConfig, features_to_skip: &Vec<Pubkey>) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Since the function name is now deactivate_features, can you change the parameter name to features_to_deactivate ?

runtime/src/genesis_utils.rs Show resolved Hide resolved
runtime/src/genesis_utils.rs Outdated Show resolved Hide resolved
@gregcusack gregcusack requested a review from steviez July 24, 2024 22:58
let features_to_deactivate = pubkeys_of(&matches, "deactivate_feature").unwrap_or_default();

if cluster_type != ClusterType::Development && !features_to_deactivate.is_empty() {
eprintln!("Error: The --deactivate-feature-set argument cannot be used with --cluster-type={cluster_type:?}");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Update the help text to match the new flag name

.value_name("FEATURE_PUBKEY")
.validator(is_pubkey)
.multiple(true)
.help("deactivate this feature in genesis. Compatable with ClusterType::Development"),
Copy link

@steviez steviez Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: compatible

nit: ClusterType::Development is the name of the type in code, but I think it is possibly more clear to use the string that a user would pass on the CLI (development). I think your wording is likely fine as-is, but could also adjust wording to more strongly say only valid when using --cluster-type development or something along those lines

Copy link

@steviez steviez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gregcusack gregcusack merged commit 61bdb3f into anza-xyz:master Jul 26, 2024
41 checks passed
@gregcusack gregcusack deleted the genesis-deactivate-features branch July 26, 2024 16:16
@gregcusack gregcusack restored the genesis-deactivate-features branch August 7, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants