program: use Rent over rent_exempt_reserve#542
Conversation
| let user_excess_lamports = post_pool_lamports | ||
| .checked_sub(pool_stake_state.delegation.stake) | ||
| .and_then(|amount| amount.checked_sub(pool_stake_meta.rent_exempt_reserve)) | ||
| .and_then(|amount| amount.checked_sub(pool_rent_exempt_reserve)) |
There was a problem hiding this comment.
Just noting that this is assuming a stake account will be the same size post-merge, which makes sense to me
There was a problem hiding this comment.
yep, it isnt articulated by the stake program but this would be in line with the general principle of current behavior. if you Split, the new account has the currently enforced size asserted and both accounts must meet minimum delegation. if you Merge, we dont enforce size and we dont enforce minimum delegation
the principle i read into this is that an old Merge destination is allowed to continue as it was before, since closing the source is good, and the destination would have kept on existing as it was if there was no merge. so i dont think we would ever change this if we made larger stake accounts
downstream changes to support solana-program/stake#303
also fix a mistake in the cli using the wrong
size_of()note i had to bump quinn-proto in the lockfile for audit, it doesnt affect anything in here though