1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use LAMPORTS_PER_SOL;
declare_id!;
// feature_set::reduce_stake_warmup_cooldown changed the warmup/cooldown from
// 25% to 9%. a function is provided by the sdk,
// new_warmup_cooldown_rate_epoch(), which returns the epoch this change
// happened. this function is not available to bpf programs. however, we dont
// need it. the number is necessary to calculate historical effective stake from
// stake history, but we only care that stake we are dealing with in the present
// epoch has been fully (de)activated. this means, as long as one epoch has
// passed since activation where all prior stake had escaped warmup/cooldown,
// we can pretend the rate has always beein 9% without issue. so we do that
const PERPETUAL_NEW_WARMUP_COOLDOWN_RATE_EPOCH: = Some;
// Historically, `Meta.rent_exempt_reserve` contained the canonical rent
// reservation for a stake account. This implicitly depended on
// lamports-per-byte remaining fixed over time. This value will be allowed
// to fluctuate, which means the stake program must calculate rent from the
// `Rent` sysvar directly. However, downstream programs may still rely on the
// `Meta` value being set. For maximum predictability, we set `rent_exempt_reserve`
// to its historical value unconditionally, but ignore it in the stake program.
const PSEUDO_RENT_EXEMPT_RESERVE: u64 = 2_282_880;
/// The minimum stake amount that can be delegated, in lamports.
/// NOTE: This is also used to calculate the minimum balance of a delegated
/// stake account, which is the rent exempt reserve _plus_ the minimum stake
/// delegation.