Skip to content

Commit bdcd02b

Browse files
committed
Add more info based on feedback
1 parent 3f336ca commit bdcd02b

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

proposals/0488-rent-adjusted-delegations.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ feature: (fill in with feature key and github tracking issues once accepted)
1313
## Summary
1414

1515
A new calculation is proposed to adjust stake delegation amounts during the
16-
partitioned rewards payout system of
16+
epoch rewards payout system of
1717
[SIMD-118](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0118-partitioned-epoch-reward-distribution.md),
1818
based on the Rent sysvar parameters at the beginning of that epoch.
1919

2020
## Motivation
2121

22-
If
23-
[SIMD-0438 (Rent Increase)](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0438-rent-increase-safeguard.md)
24-
is enabled after any of the Rent decreases described in
22+
This proposal is a prerequisite for
23+
[SIMD-0438 (Rent Increase)](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0438-rent-increase-safeguard.md).
24+
25+
If SIMD-0438 is enabled after any of the Rent decreases described in
2526
[SIMD-0437](https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0437-incremental-rent-reduction.md),
2627
a stake account created with lower Rent may have an inflated delegation amount,
2728
consisting of the delta between the previous (decreased) minimum balance and the
@@ -43,27 +44,27 @@ During the partitioned epoch rewards calculation outlined in
4344
a stake's updated delegation MUST be calculated with the following formula:
4445

4546
```
46-
max(
47-
min(
48-
delegation + stake_rewards,
47+
post_delegation = min(
48+
pre_delegation + stake_rewards,
4949
lamports + stake_rewards - rent_exempt_reserve
50-
),
51-
0
5250
)
5351
```
5452

5553
Where:
5654

57-
* `delegation`: the account's pre-reward delegated lamport amount
55+
* `post_delegation`: the account's post-reward delegated lamport amount
56+
* `pre_delegation`: the account's pre-reward delegated lamport amount
5857
* `stake_rewards`: the account's calculated stake reward lamport amount for the
5958
past epoch
6059
* `lamports`: the account's pre-reward lamports
6160
* `rent_exempt_reserve`: the minimum lamport balance required for the stake
6261
account
6362

64-
The `rent_exempt_reserve` calculation MUST use current `Rent` sysvar parameters,
65-
which MAY be updated immediately prior to reward calculation, during the epoch
66-
boundary.
63+
All arithmetic operations MUST be saturating and use unsigned 64-bit integers.
64+
65+
The `rent_exempt_reserve` calculation MUST use current `Rent` sysvar parameters.
66+
Any updates to the `Rent` sysvar values MUST take place before epoch rewards
67+
calculation takes place.
6768

6869
During distribution, the `delegation.stake` field (offset `[156,164)`) in the
6970
stake account's data MUST be set to the new delegation amount, expressed as a
@@ -90,12 +91,9 @@ block rewards MUST be used to cover the new required minimum balance, so
9091
the formula becomes:
9192

9293
```
93-
max(
94-
min(
94+
post_delegation = min(
9595
delegation + stake_rewards,
9696
lamports + stake_rewards + block_rewards - rent_exempt_reserve
97-
),
98-
0
9997
)
10098
```
10199

@@ -119,10 +117,11 @@ delegation amounts will always be correct when new stake weights are calculated.
119117

120118
## Impact
121119

122-
The biggest impact is that a delegation MAY decrease between epochs. Protocols
123-
MUST relax assumptions that delegation amounts only increase or stay the same.
120+
The biggest impact is that a delegation MAY decrease between epochs. Any
121+
consumer (on-chain program, dApp, etc) MUST relax assumptions that delegation
122+
amounts only increase or stay the same.
124123

125-
Protocols MUST allow for stake accounts to become inactive as a result of reward
124+
Consumers MUST allow for stake accounts to become inactive as a result of reward
126125
distribution, without an explicit call to `Deactivate` or `DeactivateDelinquent`.
127126

128127
## Security Considerations

0 commit comments

Comments
 (0)