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

relax stake split destination check #162

Merged
merged 8 commits into from
Mar 14, 2024
Merged

relax stake split destination check #162

merged 8 commits into from
Mar 14, 2024

Conversation

Nagaprasadvr
Copy link

@Nagaprasadvr Nagaprasadvr commented Mar 9, 2024

Issue #147

####Improvements

  1. Removed strict checks for staked_split_account and allowed account owned by system program with no data and some lamports to be allocated as a new stake account to receive stake split

Summary of Changes

1 solana/cli/src/stake.rs
function - process_split_stake
removed some strict checks resulting in allowing system account (without data and some lamports) to be allocated as new stake account to receive split

@mergify mergify bot requested a review from a team March 9, 2024 12:14
@Nagaprasadvr Nagaprasadvr marked this pull request as draft March 9, 2024 12:18
@Nagaprasadvr Nagaprasadvr marked this pull request as ready for review March 9, 2024 12:40
cli/src/stake.rs Outdated Show resolved Hide resolved
cli/src/stake.rs Outdated Show resolved Hide resolved
cli/src/stake.rs Show resolved Hide resolved
@CriesofCarrots CriesofCarrots added the CI Pull Request is ready to enter CI label Mar 14, 2024
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Mar 14, 2024
cli/src/stake.rs Show resolved Hide resolved
cli/src/stake.rs Outdated Show resolved Hide resolved
Copy link

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Thanks! The logic looks correct now.
One nit to add a comment to help elucidate the nested ifs. Then I think this is good, as long as CI is happy.

Also, in future, please don't push merge commits. We much prefer rebase and force push to pick up latest upstream.

@Nagaprasadvr
Copy link
Author

Thanks! The logic looks correct now. One nit to add a comment to help elucidate the nested ifs. Then I think this is good, as long as CI is happy.

Also, in future, please don't push merge commits. We much prefer rebase and force push to pick up latest upstream.

sure !

cli/src/stake.rs Outdated Show resolved Hide resolved
@CriesofCarrots CriesofCarrots added the CI Pull Request is ready to enter CI label Mar 14, 2024
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Mar 14, 2024
Copy link

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Thank you! Will merge once CI passes (macos clippy failures are unrelated)

@Nagaprasadvr
Copy link
Author

Thank you! Will merge once CI passes (macos clippy failures are unrelated)

ty

@CriesofCarrots CriesofCarrots added the CI Pull Request is ready to enter CI label Mar 14, 2024
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Mar 14, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 81.9%. Comparing base (72d6d78) to head (83232e4).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #162   +/-   ##
=======================================
  Coverage    81.8%    81.9%           
=======================================
  Files         837      837           
  Lines      226741   226743    +2     
=======================================
+ Hits       185699   185732   +33     
+ Misses      41042    41011   -31     

@CriesofCarrots
Copy link

Thanks for your contribution @Nagaprasadvr

@CriesofCarrots
Copy link

Merging on red, as CI failures are unrelated

@CriesofCarrots CriesofCarrots merged commit 6bcb77d into anza-xyz:master Mar 14, 2024
35 of 37 checks passed
@Nagaprasadvr
Copy link
Author

Thanks for your contribution @Nagaprasadvr

🙌

@Nagaprasadvr Nagaprasadvr deleted the improv-cli-relax-stake-split-destination-check branch March 16, 2024 12:19
Copy link

mergify bot commented Mar 21, 2024

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.

mergify bot pushed a commit that referenced this pull request Mar 21, 2024
* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment

(cherry picked from commit 6bcb77d)
CriesofCarrots pushed a commit that referenced this pull request Mar 21, 2024
* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment
mergify bot added a commit that referenced this pull request Mar 21, 2024
relax stake split destination check (#162)

* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment

(cherry picked from commit 6bcb77d)

Co-authored-by: Nagaprasad V R <[email protected]>
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…anza-xyz#368)

relax stake split destination check (anza-xyz#162)

* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment

(cherry picked from commit 6bcb77d)

Co-authored-by: Nagaprasad V R <[email protected]>
codebender828 pushed a commit to codebender828/agave that referenced this pull request Oct 3, 2024
* relax stake split destination check

* change stake_account error handling logic

* fmt

* modify logic

* change error message when account is neither owned by stake program or system program

* add a comment explaining nested ifs in stake_account error handling

* fix typos in comments

* update comment
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.

5 participants