Skip to content

Conversation

@buffalojoec
Copy link

Problem

As described in #9377, development clusters who deactivate the vote state v4 feature are stalling since the genesis config will create vote state v4 accounts anyway.

Unfortunately, the pattern for declaring which features should be activated or deactivated when working with a genesis config is sporadic and needs refactor in order to tie it to vote state.

Summary of Changes

Unifies the feature (de)activation in genesis configs by requiring a FeatureSet parameter for all API methods save for the one dubbed _no_features. Then, inside of the private core function, conditionally use a v3 or v4 vote account based on the vote_state_v4 feature.

Also updates callsites and renames the v3 vote account creator.

Fixes #9377

@mergify
Copy link

mergify bot commented Dec 9, 2025

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

Copy link
Author

Choose a reason for hiding this comment

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

Here I dropped helpers that were sparingly used to avoid any confusion if someone was to activate/deactivate the vote state v4 feature, but they already were vended a vote account for their validator.


genesis_config
#[allow(clippy::too_many_arguments)]
pub fn create_genesis_config_with_leader_ex(
Copy link
Author

Choose a reason for hiding this comment

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

Functionally equivalent to its original.

Comment on lines +968 to +969
} else if feature_set.inactive().contains(feature) {
// Continue silently if the user provided a feature ID twice.
Copy link
Author

Choose a reason for hiding this comment

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

This is a small fix to repair a "not a warning" scenario that I noticed while implementing this fix.

@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 75.78125% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.6%. Comparing base (66c7c08) to head (63c88b8).
⚠️ Report is 94 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9467   +/-   ##
=======================================
  Coverage    82.6%    82.6%           
=======================================
  Files         893      893           
  Lines      321477   321552   +75     
=======================================
+ Hits       265610   265674   +64     
- Misses      55867    55878   +11     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@buffalojoec buffalojoec marked this pull request as ready for review December 9, 2025 23:38
do_activate_all_features::<true>(genesis_config);
}

pub fn activate_all_features(genesis_config: &mut GenesisConfig) {

Choose a reason for hiding this comment

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

i do think we want to keep alpenglow out of this for now.
I see a lot of our testing code uses activate_all_features, and not sure if this is used elsewhere. I would hate for Alpenglow to be active while it's not complete and cause problems.

Copy link
Author

Choose a reason for hiding this comment

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

Ok sure, added a commit for this but I renamed the function.

@mergify
Copy link

mergify bot commented Dec 11, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/kit (example)

Thank you for keeping the RPC clients in sync with the server API @buffalojoec.

Copy link

@AshwinSekar AshwinSekar left a comment

Choose a reason for hiding this comment

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

LGTM, cc @t-nelson for approval since I believe we want to backport this to 3.1

@AshwinSekar AshwinSekar added the v3.1 Backport to v3.1 branch label Dec 12, 2025
@mergify
Copy link

mergify bot commented Dec 12, 2025

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3.1 Backport to v3.1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature gate genesis vote account creation

3 participants