Skip to content

Add create_v4_account_with_authorized and actually populate bls_pubkey_to_rank_map in EpochStakes.#8103

Merged
wen-coding merged 5 commits intoanza-xyz:masterfrom
wen-coding:upstream_bls_pubkey_to_rank_map
Sep 20, 2025
Merged

Add create_v4_account_with_authorized and actually populate bls_pubkey_to_rank_map in EpochStakes.#8103
wen-coding merged 5 commits intoanza-xyz:masterfrom
wen-coding:upstream_bls_pubkey_to_rank_map

Conversation

@wen-coding
Copy link
Copy Markdown

  • To upstream Alpenglow, what we current need:
    • create v4 vote accounts with bls pubkey, this can enable tons of tests
    • create v4 vote accounts in genesis config, this can enable local-cluster tests later
      Since we don't have most of votor upstreamed yet, the former is more important than latter.

Of course, if there is a better API to create v4 vote accounts later, we can totally switch to that. But could we maybe submit this for now to unblock upstreaming Alpenglow?

To illustrate how we use v4 vote accounts in tests, I've also ported rest of bls_pubkey_to_rank_map in
EpochStakes and ported associated tests.

@mergify
Copy link
Copy Markdown

mergify Bot commented Sep 19, 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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.9%. Comparing base (d081c19) to head (9bf9e9f).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #8103    +/-   ##
========================================
  Coverage    82.9%    82.9%            
========================================
  Files         823      823            
  Lines      360972   361121   +149     
========================================
+ Hits       299404   299672   +268     
+ Misses      61568    61449   -119     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Sure, works for me if this is an unblocker.

Comment thread programs/vote/src/vote_state/mod.rs Outdated
Comment on lines +1053 to +1060
let vote_state = VoteStateV4 {
node_pubkey: *node_pubkey,
authorized_voters: AuthorizedVoters::new(0, *authorized_voter),
authorized_withdrawer: *authorized_withdrawer,
bls_pubkey_compressed,
inflation_rewards_commission_bps,
..VoteStateV4::default()
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Since we don't have VoteStateV4::new yet, this might be useful as a standalone helper.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You mean add a helper in this file? okay I've done that, is this what you want?

Comment thread programs/vote/src/vote_state/mod.rs Outdated
@wen-coding wen-coding moved this to In Progress in Alpenglow Sep 19, 2025
Copy link
Copy Markdown

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Lgtm from my side!

@wen-coding wen-coding merged commit 1432ddc into anza-xyz:master Sep 20, 2025
43 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Alpenglow Sep 20, 2025
@wen-coding wen-coding deleted the upstream_bls_pubkey_to_rank_map branch September 20, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants