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

Make test_next_leader_slot_next_epoch() aware of stake minimum delegation #24660

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

brooksprumo
Copy link
Contributor

@brooksprumo brooksprumo commented Apr 25, 2022

Problem

The ledger test test_next_leader_slot_next_epoch() fails once the stake minimum delegation is raised. See #24603 for more context.

Summary of Changes

  • Update ledger test_next_leader_slot_next_epoch() to be aware of stake minimum delegation
  • Make get_minimum_delegation public

@brooksprumo brooksprumo requested a review from joncinque April 25, 2022 22:35
@brooksprumo brooksprumo marked this pull request as ready for review April 25, 2022 22:35
@@ -19,7 +19,7 @@ pub fn add_genesis_accounts(genesis_config: &mut GenesisConfig) -> u64 {
/// NOTE: This is also used to calculate the minimum balance of a stake account, which is the
/// rent exempt reserve _plus_ the minimum stake delegation.
#[inline(always)]
pub(crate) fn get_minimum_delegation(_feature_set: &FeatureSet) -> u64 {
pub fn get_minimum_delegation(_feature_set: &FeatureSet) -> u64 {
Copy link
Member

Choose a reason for hiding this comment

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

how about moving this into solana-program, so we don’t need a new dep in ledger/
When it’s moved into solana-program, we could probably remove the FeatureSet as well (since that’s only available in solana-sdk) and instead just always use 1 SOL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mvines Sorry 😢 I already merged this specific part via #24659. I like this suggestion though as it sounds like it'll simplify a number of testing/impl details. So, going forward I could:

  1. Revert Make rpc test_account_subscribe aware of stake minimum delegation #24659, then move get_minimum_delegation(), then re-do/fix these tests
  2. Merge this PR (which will end up not having this specific change since it has already been merged), then move get_minimum_delegation()
  3. Move get_minimum_delegation(), then fixup this PR, then redo Make rpc test_account_subscribe aware of stake minimum delegation #24659

Do you have a preference here? I feel like (2) is going to be the fastest and most straight forward. Maybe there's another option too?

Copy link
Member

Choose a reason for hiding this comment

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

(2), or whatever is easiest wfm!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tracking this in #24690

@codecov
Copy link

codecov bot commented Apr 26, 2022

Codecov Report

Merging #24660 (46d4428) into master (3155270) will increase coverage by 12.0%.
The diff coverage is 78.7%.

@@             Coverage Diff             @@
##           master   #24660       +/-   ##
===========================================
+ Coverage    70.0%    82.0%    +12.0%     
===========================================
  Files          36      595      +559     
  Lines        2255   165075   +162820     
  Branches      322        0      -322     
===========================================
+ Hits         1580   135491   +133911     
- Misses        560    29584    +29024     
+ Partials      115        0      -115     

@brooksprumo brooksprumo merged commit edf3f05 into solana-labs:master Apr 26, 2022
@brooksprumo brooksprumo deleted the fix-tests/ledger branch April 26, 2022 12:31
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Apr 27, 2022
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
jeffwashington pushed a commit to jeffwashington/solana that referenced this pull request Jun 29, 2022
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.

3 participants