Skip to content

Commit

Permalink
L1-290: Set the inflation parameters (#1820)
Browse files Browse the repository at this point in the history
# Description

The Community has decided that the AZERO cap should be equal to 520M
AZERO, and the first year issuance equal to 27M AZERO.

The launch of the new inflation model is scheduled for October 14th. The
estimated total issuance at launch date is 373,948,365 AZERO.

Thus, the inflation horizon is set to 154,283,512,497 milliseconds
(approx. 1785 days).

## Type of change

- Breaking change (fix or feature that would cause existing
functionality to not work as expected)

# Checklist:

- I have added tests
  • Loading branch information
lesniak43 authored Oct 7, 2024
1 parent 3150ced commit 5a47d23
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
22 changes: 11 additions & 11 deletions aleph-client/src/aleph_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2076,9 +2076,9 @@ pub mod api {
.hash();
runtime_metadata_hash
== [
111u8, 233u8, 121u8, 88u8, 247u8, 52u8, 135u8, 105u8, 167u8, 108u8, 97u8, 139u8,
177u8, 122u8, 62u8, 130u8, 3u8, 106u8, 117u8, 91u8, 223u8, 244u8, 111u8, 47u8,
35u8, 184u8, 0u8, 203u8, 98u8, 253u8, 156u8, 92u8,
46u8, 76u8, 121u8, 124u8, 214u8, 182u8, 28u8, 12u8, 114u8, 169u8, 159u8, 10u8,
128u8, 9u8, 179u8, 188u8, 124u8, 56u8, 110u8, 108u8, 24u8, 15u8, 236u8, 3u8, 213u8,
142u8, 207u8, 48u8, 23u8, 113u8, 170u8, 43u8,
]
}
pub mod system {
Expand Down Expand Up @@ -9517,10 +9517,10 @@ pub mod api {
"AzeroCap",
vec![],
[
68u8, 239u8, 10u8, 241u8, 109u8, 153u8, 129u8, 3u8, 237u8, 251u8,
251u8, 221u8, 156u8, 81u8, 117u8, 166u8, 101u8, 196u8, 227u8, 176u8,
209u8, 123u8, 127u8, 146u8, 252u8, 88u8, 138u8, 227u8, 183u8, 117u8,
148u8, 36u8,
232u8, 50u8, 48u8, 200u8, 187u8, 205u8, 197u8, 195u8, 172u8, 140u8,
72u8, 253u8, 63u8, 190u8, 23u8, 70u8, 154u8, 96u8, 238u8, 203u8, 39u8,
129u8, 219u8, 220u8, 119u8, 214u8, 95u8, 174u8, 65u8, 80u8, 25u8,
156u8,
],
)
}
Expand All @@ -9538,10 +9538,10 @@ pub mod api {
"ExponentialInflationHorizon",
vec![],
[
7u8, 241u8, 156u8, 243u8, 174u8, 255u8, 212u8, 252u8, 53u8, 59u8,
145u8, 100u8, 166u8, 17u8, 167u8, 127u8, 41u8, 227u8, 188u8, 149u8,
207u8, 61u8, 65u8, 215u8, 42u8, 241u8, 18u8, 145u8, 24u8, 123u8, 1u8,
65u8,
96u8, 228u8, 98u8, 28u8, 209u8, 210u8, 67u8, 181u8, 1u8, 111u8, 174u8,
131u8, 254u8, 131u8, 238u8, 112u8, 243u8, 203u8, 160u8, 240u8, 65u8,
141u8, 108u8, 235u8, 114u8, 44u8, 115u8, 114u8, 135u8, 217u8, 90u8,
63u8,
],
)
}
Expand Down
8 changes: 4 additions & 4 deletions e2e-tests/src/test/era_payout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ async fn force_era_payout(config: &Config) -> anyhow::Result<()> {
// These must be adjusted every time we change the default values of:
// * AzeroCap
// * ExponentialInflationHorizon
let expected_payout = 1776 * TOKEN;
let delta = 3 * TOKEN;
let expected_payout = 114 * TOKEN;
let delta = TOKEN;

assert_within_delta_interval(
expected_era_duration,
Expand Down Expand Up @@ -101,8 +101,8 @@ async fn normal_era_payout(config: &Config) -> anyhow::Result<()> {
// These must be adjusted every time we change the default values of:
// * AzeroCap
// * ExponentialInflationHorizon
let expected_payout = 1776 * TOKEN;
let delta = 3 * TOKEN;
let expected_payout = 114 * TOKEN;
let delta = TOKEN;

assert_within_delta_interval(
expected_era_duration,
Expand Down
5 changes: 2 additions & 3 deletions pallets/aleph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ pub mod pallet {
/// Default AZERO Cap. Relevant for eras before we set this value by hand.
#[pallet::type_value]
pub fn DefaultAzeroCap() -> Balance {
1_000_000_000 * TOKEN
520_000_000 * TOKEN
}

/// Default length of the exponential inflation horizon.
/// Relevant for eras before we set this value by hand.
#[pallet::type_value]
pub fn DefaultExponentialInflationHorizon() -> u64 {
const MILLISECS_PER_YEAR: u64 = 1000 * 3600 * 24 * 36525 / 100;
MILLISECS_PER_YEAR
154_283_512_497
}

#[pallet::storage]
Expand Down

0 comments on commit 5a47d23

Please sign in to comment.