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

v1.16: Make active stake consistent in split (backport of #33295) #33319

Merged
merged 2 commits into from
Sep 20, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 20, 2023

This is an automatic backport of pull request #33295 done by Mergify.
Cherry-pick of bca41ed has failed:

On branch mergify/bp/v1.16/pr-33295
Your branch is up to date with 'origin/v1.16'.

You are currently cherry-picking commit bca41edf20.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .github/workflows/downstream-project-spl.yml
	modified:   cli/src/cli.rs
	modified:   cli/src/stake.rs
	modified:   tokens/src/arg_parser.rs
	modified:   tokens/src/args.rs
	modified:   tokens/src/commands.rs
	modified:   tokens/src/lib.rs
	modified:   tokens/src/main.rs
	new file:   tokens/src/stake.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cli/tests/stake.rs
	both modified:   programs/stake/src/stake_instruction.rs
	both modified:   programs/stake/src/stake_state.rs
	both modified:   runtime/tests/stake.rs
	both modified:   sdk/src/feature_set.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* Add feature gate

* Add helper fn

* Require split destination to be rent-exempt if it is active

* Update cli to prefund split accounts

* cli: require rent param with sign-only

* Update tokens to prefund split accounts

* Update split tests with sysvar accounts

* Fix test_split_to_account_with_rent_exempt_reserve

* Fix test_staked_split_destination_minimum_balance

* Fix test_split_more_than_staked

* Fix test_split_minimum_stake_delegation and remove misleading StakeState::Initialized case

* Fix test_split_from_larger_sized_account

* Add test for pre-/post-activation behavior splitting some or all of stake account

* Assert active stake

* Fix runtime test

* Ignore stake-pool downstream

* Review comments

* Feature gate sysvar reads

(cherry picked from commit bca41ed)

# Conflicts:
#	cli/tests/stake.rs
#	programs/stake/src/stake_instruction.rs
#	programs/stake/src/stake_state.rs
#	runtime/tests/stake.rs
#	sdk/src/feature_set.rs
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #33319 (9eb709c) into v1.16 (d87681e) will increase coverage by 0.0%.
Report is 1 commits behind head on v1.16.
The diff coverage is 96.4%.

@@           Coverage Diff            @@
##            v1.16   #33319    +/-   ##
========================================
  Coverage    81.9%    82.0%            
========================================
  Files         762      763     +1     
  Lines      207841   208251   +410     
========================================
+ Hits       170368   170770   +402     
- Misses      37473    37481     +8     

Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

i didn't re-review the tests, but logic lgtm. seems like a mostly clean cherry-pick?

:shipit:

@CriesofCarrots
Copy link
Contributor

seems like a mostly clean cherry-pick?

Yep, the conflicts were all StakeStateV2 => StakeState, plus the feature-set list.

@CriesofCarrots CriesofCarrots merged commit 3159e2a into v1.16 Sep 20, 2023
17 checks passed
@CriesofCarrots CriesofCarrots deleted the mergify/bp/v1.16/pr-33295 branch September 20, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants