-
Notifications
You must be signed in to change notification settings - Fork 71
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
stake-program: MoveStake
and MoveLamports
#1415
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1415 +/- ##
=========================================
- Coverage 82.7% 82.7% -0.1%
=========================================
Files 871 871
Lines 369894 370084 +190
=========================================
+ Hits 306158 306222 +64
- Misses 63736 63862 +126 |
67aaa8d
to
060122b
Compare
|
9d5aa08
to
43a839c
Compare
f38ceda
to
797f2a4
Compare
797f2a4
to
1871f45
Compare
ok! my last force push was just to add instruction descriptions and delete some dead test code, previously it passed ci so this version should be final ive split the pr into five commits for ease of reviewing:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really great work! The core logic is sound, and most of my comments are minor
context: &mut ProgramTestContext, | ||
vote_account: &Pubkey, | ||
staked_amount: u64, | ||
) -> (Keypair, Keypair, Keypair) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: not really important, but typically a helper struct is preferable to a 3-tuple
note to future reviewers that 6105c77 is functionally identical to the tip of the branch but there was a structural change in a later commit, but all the important changes are in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at stake-tests at all yet, but here's a first set of comments.
… updated for this)
262b942
to
2eed246
Compare
2eed246
to
53e7779
Compare
Problem
due to split destinations requiring rent-exemption, there isnt a good way to move value between stake accounts without holding
Withdrawer
authority, because split/merge cycles require new lamports to fund split when then results in unreclaimable undelegated lamports accumulating in merge destinationsSummary of Changes
we implement two new instructions,
MoveStake
andMoveLamports
, which move stake and lamports between stake accounts with the same authorized/lockup, usingStaker
authority. further detail can be found in (simd148)[https://github.com/solana-foundation/solana-improvement-documents/pull/148], which this intends to implementFeature Gate Issue: #1610