Add new inflation feature-ids (#13671)
* Add new inflation feature-ids, and full_inflation default values * Compute inflation start from full_inflation activation * Include pico_inflation in inflation start computation * Add full-inflation constructor * Align inflation taper with rewards accrual start and catch overflow edge case
This commit is contained in:
@ -19,11 +19,11 @@ pub mod consistent_recent_blockhashes_sysvar {
|
||||
}
|
||||
|
||||
pub mod pico_inflation {
|
||||
solana_sdk::declare_id!("GaBtBJvmS4Arjj5W1NmFcyvPjsHN38UGYDq2MDwbs9Qu");
|
||||
solana_sdk::declare_id!("4RWNif6C2WCNiKVW7otP4G7dkmkHGyKQWRpuZ1pxKU5m");
|
||||
}
|
||||
|
||||
pub mod inflation_kill_switch {
|
||||
solana_sdk::declare_id!("SECCKV5UVUsr8sTVSVAzULjdm87r7mLPaqH2FGZjevR");
|
||||
pub mod full_inflation {
|
||||
solana_sdk::declare_id!("DT4n6ABDqs6w4bnfwrXT9rsprcPf6cdDga1egctaPkLC");
|
||||
}
|
||||
|
||||
pub mod spl_token_v2_multisig_fix {
|
||||
@ -97,7 +97,7 @@ lazy_static! {
|
||||
(secp256k1_program_enabled::id(), "secp256k1 program"),
|
||||
(consistent_recent_blockhashes_sysvar::id(), "consistent recentblockhashes sysvar"),
|
||||
(pico_inflation::id(), "pico-inflation"),
|
||||
(inflation_kill_switch::id(), "inflation kill switch"),
|
||||
(full_inflation::id(), "full-inflation"),
|
||||
(spl_token_v2_multisig_fix::id(), "spl-token multisig fix"),
|
||||
(bpf_loader2_program::id(), "bpf_loader2 program"),
|
||||
(bpf_compute_budget_balancing::id(), "compute budget balancing"),
|
||||
|
@ -69,6 +69,17 @@ impl Inflation {
|
||||
Self::new_fixed(0.0001) // 0.01% inflation
|
||||
}
|
||||
|
||||
pub fn full() -> Self {
|
||||
Self {
|
||||
initial: DEFAULT_INITIAL,
|
||||
terminal: DEFAULT_TERMINAL,
|
||||
taper: DEFAULT_TAPER,
|
||||
foundation: 0.0,
|
||||
foundation_term: 0.0,
|
||||
__unused: 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
/// inflation rate at year
|
||||
pub fn total(&self, year: f64) -> f64 {
|
||||
assert!(year >= 0.0);
|
||||
|
Reference in New Issue
Block a user