Skip to content

alpenglow: add feature gate #6330

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions feature-set/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,10 @@ pub mod enable_extend_program_checked {
solana_pubkey::declare_id!("2oMRZEDWT2tqtYMofhmmfQ8SsjqUFzT6sYXppQDavxwz");
}

pub mod alpenglow {
solana_pubkey::declare_id!("mustRekeyVm2QHYB3JPefBiU4BY3Z6JkW2k3Scw5GWP");
}

pub static FEATURE_NAMES: LazyLock<AHashMap<Pubkey, &'static str>> = LazyLock::new(|| {
[
(secp256k1_program_enabled::id(), "secp256k1 program"),
Expand Down Expand Up @@ -1330,6 +1334,7 @@ pub static FEATURE_NAMES: LazyLock<AHashMap<Pubkey, &'static str>> = LazyLock::n
(mask_out_rent_epoch_in_vm_serialization::id(), "SIMD-0267: Sets rent_epoch to a constant in the VM"),
(enshrine_slashing_program::id(), "SIMD-0204: Slashable event verification"),
(enable_extend_program_checked::id(), "Enable ExtendProgramChecked instruction"),
(alpenglow::id(), "Enable Alpenglow"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down
12 changes: 11 additions & 1 deletion runtime/src/genesis_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,20 @@ pub fn create_genesis_config_with_leader_with_mint_keypair(
}
}

pub fn activate_all_features_alpenglow(genesis_config: &mut GenesisConfig) {
do_activate_all_features::<true>(genesis_config);
}

pub fn activate_all_features(genesis_config: &mut GenesisConfig) {
do_activate_all_features::<false>(genesis_config);
}

pub fn do_activate_all_features<const IS_ALPENGLOW: bool>(genesis_config: &mut GenesisConfig) {
// Activate all features at genesis in development mode
for feature_id in FeatureSet::default().inactive() {
activate_feature(genesis_config, *feature_id);
if IS_ALPENGLOW || *feature_id != agave_feature_set::alpenglow::id() {
Copy link

Choose a reason for hiding this comment

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

To confirm, the idea here is keep AG feature disabled by default but to also have a way to enable the gate for testing ?

Copy link
Author

Choose a reason for hiding this comment

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

yeah exactly. it will take several dozen PRs before alpenglow is fully functional on master during which all our existing local cluster tests will be broken.

once functional we can remove this exception to enable the existing tests before we consider rekeying and releasing.

Copy link

Choose a reason for hiding this comment

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

Got it, that seems reasonable if we're going to incrementally move AG stuff over

activate_feature(genesis_config, *feature_id);
}
}
}

Expand Down
Loading