diff --git a/.changelog/unreleased/improvements/2460-refactor-shielded-inflation.md b/.changelog/unreleased/improvements/2460-refactor-shielded-inflation.md new file mode 100644 index 00000000000..fff07ba5852 --- /dev/null +++ b/.changelog/unreleased/improvements/2460-refactor-shielded-inflation.md @@ -0,0 +1,3 @@ +- MASP inflation for a given token now is adjusted based on a target amount + of total locked (shielded) tokens rather than a ratio relative to some total + supply. ([\#2460](https://github.com/anoma/namada/pull/2460)) \ No newline at end of file diff --git a/crates/apps/src/lib/client/rpc.rs b/crates/apps/src/lib/client/rpc.rs index 3557bd51a17..cedc239b3fb 100644 --- a/crates/apps/src/lib/client/rpc.rs +++ b/crates/apps/src/lib/client/rpc.rs @@ -2523,7 +2523,7 @@ pub async fn query_masp_reward_tokens(context: &impl Namada) { max_reward_rate, kp_gain, kd_gain, - locked_ratio_target, + locked_amount_target, } in tokens { display_line!(context.io(), "{}: {}", name, address); @@ -2532,8 +2532,8 @@ pub async fn query_masp_reward_tokens(context: &impl Namada) { display_line!(context.io(), " Kd gain: {}", kd_gain); display_line!( context.io(), - " Locked ratio target: {}", - locked_ratio_target + " Locked amount target: {}", + locked_amount_target ); } } diff --git a/crates/apps/src/lib/node/ledger/shell/init_chain.rs b/crates/apps/src/lib/node/ledger/shell/init_chain.rs index 636bf3a5853..a881171b51f 100644 --- a/crates/apps/src/lib/node/ledger/shell/init_chain.rs +++ b/crates/apps/src/lib/node/ledger/shell/init_chain.rs @@ -435,6 +435,7 @@ where masp_params, &mut self.wl_storage, address, + denom, ) .unwrap(); if masp_params.is_some() { diff --git a/crates/core/src/ledger/inflation.rs b/crates/core/src/ledger/inflation.rs index f9c9e8d6247..d7600a2d5c3 100644 --- a/crates/core/src/ledger/inflation.rs +++ b/crates/core/src/ledger/inflation.rs @@ -5,30 +5,24 @@ use crate::types::dec::Dec; use crate::types::uint::Uint; -/// The domains of inflation -pub enum RewardsType { - /// Proof-of-stake rewards - Staking, - /// Rewards for locking tokens in the multi-asset shielded pool - Masp, - /// Rewards for public goods funding (PGF) - PubGoodsFunding, +/// Holds the PD controller values that should be updated in storage +#[allow(missing_docs)] +pub struct PosValsToUpdate { + pub locked_ratio: Dec, + pub inflation: Uint, } /// Holds the PD controller values that should be updated in storage #[allow(missing_docs)] -pub struct ValsToUpdate { - pub locked_ratio: Dec, +pub struct ShieldedValsToUpdate { pub inflation: Uint, } /// PD controller used to dynamically adjust the rewards rates #[derive(Debug, Clone)] -pub struct RewardsController { +pub struct PosRewardsController { /// Locked token amount in the relevant system pub locked_tokens: Uint, - /// Total token supply - pub total_tokens: Uint, /// Total native token supply pub total_native_tokens: Uint, /// PD target locked ratio @@ -47,12 +41,13 @@ pub struct RewardsController { pub epochs_per_year: u64, } -impl RewardsController { - /// Calculate a new rewards rate - pub fn run(self) -> ValsToUpdate { +impl PosRewardsController { + /// Calculate a new inflation rate for the Proof-of-stake rewards system. + /// Uses the ratios of locked (staked) tokens to the total native token + /// supply to determine the new inflation amount. + pub fn run(self) -> PosValsToUpdate { let Self { locked_tokens, - total_tokens, total_native_tokens, locked_ratio_target, locked_ratio_last, @@ -63,31 +58,35 @@ impl RewardsController { epochs_per_year, } = self; - // Token amounts must be expressed in terms of the raw amount (namnam) + // Token amounts must be expressed in terms of the raw amount // to properly run the PD controller let locked = Dec::try_from(locked_tokens) .expect("Should not fail to convert Uint to Dec"); - let total = Dec::try_from(total_tokens) - .expect("Should not fail to convert Uint to Dec"); let total_native = Dec::try_from(total_native_tokens) .expect("Should not fail to convert Uint to Dec"); + let last_inflation_amount = Dec::try_from(last_inflation_amount) + .expect("Should not fail to convert Uint to Dec"); + let epochs_py: Dec = epochs_per_year.into(); - let locked_ratio = if total.is_zero() { + // Staked ratio + let locked_ratio = if total_native.is_zero() { Dec::one() } else { - locked / total + locked / total_native }; + + // Max inflation amount for this epoch let max_inflation = total_native * max_reward_rate / epochs_py; + + // Intermediate values let p_gain = p_gain_nom * max_inflation; let d_gain = d_gain_nom * max_inflation; - let error = locked_ratio_target - locked_ratio; let delta_error = locked_ratio_last - locked_ratio; let control_val = p_gain * error - d_gain * delta_error; - let last_inflation_amount = Dec::try_from(last_inflation_amount) - .expect("Should not fail to convert Uint to Dec"); + // New inflation amount let new_inflation_amount_raw = last_inflation_amount + control_val; let new_inflation_amount = if new_inflation_amount_raw.is_negative() { Uint::zero() @@ -96,19 +95,101 @@ impl RewardsController { .to_uint() .expect("Should not fail to convert Dec to Uint") }; - let max_inflation = max_inflation .to_uint() .expect("Should not fail to convert Dec to Uint"); let inflation = std::cmp::min(new_inflation_amount, max_inflation); - ValsToUpdate { + PosValsToUpdate { locked_ratio, inflation, } } } +/// PD controller used to dynamically adjust the rewards rates +#[derive(Debug, Clone)] +pub struct ShieldedRewardsController { + /// Locked token amount in the relevant system + pub locked_tokens: Uint, + /// Total native token supply + pub total_native_tokens: Uint, + /// PD target locked amount + pub locked_tokens_target: Uint, + /// PD last locked amount + pub locked_tokens_last: Uint, + /// Maximum reward rate + pub max_reward_rate: Dec, + /// Last inflation amount + pub last_inflation_amount: Uint, + /// Nominal proportional gain + pub p_gain_nom: Dec, + /// Nominal derivative gain + pub d_gain_nom: Dec, + /// Number of epochs per year + pub epochs_per_year: u64, +} + +impl ShieldedRewardsController { + /// Calculate a new inflation rate for the Proof-of-stake rewards system. + /// Uses the ratios of locked (staked) tokens to the total native token + /// supply to determine the new inflation amount. + pub fn run(self) -> ShieldedValsToUpdate { + let Self { + locked_tokens, + total_native_tokens, + locked_tokens_target, + locked_tokens_last, + max_reward_rate, + last_inflation_amount, + p_gain_nom, + d_gain_nom, + epochs_per_year, + } = self; + + // Token amounts must be expressed in terms of the raw amount + // to properly run the PD controller + let locked = Dec::try_from(locked_tokens) + .expect("Should not fail to convert Uint to Dec"); + let locked_amount_target = Dec::try_from(locked_tokens_target) + .expect("Should not fail to convert Uint to Dec"); + let locked_amount_last = Dec::try_from(locked_tokens_last) + .expect("Should not fail to convert Uint to Dec"); + let total_native = Dec::try_from(total_native_tokens) + .expect("Should not fail to convert Uint to Dec"); + let last_inflation_amount = Dec::try_from(last_inflation_amount) + .expect("Should not fail to convert Uint to Dec"); + + let epochs_py: Dec = epochs_per_year.into(); + + // Max inflation amount for this epoch + let max_inflation = total_native * max_reward_rate / epochs_py; + + // Intermediate values + let p_gain = p_gain_nom * max_reward_rate / epochs_py; + let d_gain = d_gain_nom * max_reward_rate / epochs_py; + let error = locked_amount_target - locked; + let delta_error = locked_amount_last - locked; + let control_val = p_gain * error - d_gain * delta_error; + + // New inflation amount + let new_inflation_amount_raw = last_inflation_amount + control_val; + let new_inflation_amount = if new_inflation_amount_raw.is_negative() { + Uint::zero() + } else { + new_inflation_amount_raw + .to_uint() + .expect("Should not fail to convert Dec to Uint") + }; + let max_inflation = max_inflation + .to_uint() + .expect("Should not fail to convert Dec to Uint"); + + let inflation = std::cmp::min(new_inflation_amount, max_inflation); + ShieldedValsToUpdate { inflation } + } +} + #[cfg(test)] mod test { use std::str::FromStr; @@ -117,9 +198,8 @@ mod test { #[test] fn test_inflation_calc_up() { - let mut controller = RewardsController { + let mut controller = PosRewardsController { locked_tokens: Uint::from(2_000_000_000), - total_tokens: Uint::from(4_000_000_000_u64), total_native_tokens: Uint::from(4_000_000_000_u64), locked_ratio_target: Dec::from_str("0.66666666").unwrap(), locked_ratio_last: Dec::from_str("0.5").unwrap(), @@ -131,7 +211,7 @@ mod test { }; dbg!(&controller); - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_0, inflation: inflation_0, } = controller.clone().run(); @@ -143,10 +223,9 @@ mod test { controller.locked_ratio_last = locked_ratio_0; controller.last_inflation_amount = inflation_0; - controller.total_tokens += inflation_0; controller.locked_tokens += inflation_0; - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_1, inflation: inflation_1, } = controller.clone().run(); @@ -160,10 +239,9 @@ mod test { controller.locked_ratio_last = locked_ratio_1; controller.last_inflation_amount = inflation_1; - controller.total_tokens += inflation_1; controller.locked_tokens += inflation_1; - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_2, inflation: inflation_2, } = controller.run(); @@ -178,9 +256,8 @@ mod test { #[test] fn test_inflation_calc_down() { - let mut controller = RewardsController { + let mut controller = PosRewardsController { locked_tokens: Uint::from(900_000_000), - total_tokens: Uint::from(1_000_000_000), total_native_tokens: Uint::from(1_000_000_000), locked_ratio_target: Dec::from_str("0.66666666").unwrap(), locked_ratio_last: Dec::from_str("0.9").unwrap(), @@ -192,7 +269,7 @@ mod test { }; dbg!(&controller); - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_0, inflation: inflation_0, } = controller.clone().run(); @@ -204,10 +281,9 @@ mod test { controller.locked_ratio_last = locked_ratio_0; controller.last_inflation_amount = inflation_0; - controller.total_tokens += inflation_0; controller.locked_tokens += inflation_0; - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_1, inflation: inflation_1, } = controller.clone().run(); @@ -221,10 +297,9 @@ mod test { controller.locked_ratio_last = locked_ratio_1; controller.last_inflation_amount = inflation_1; - controller.total_tokens += inflation_1; controller.locked_tokens += inflation_1; - let ValsToUpdate { + let PosValsToUpdate { locked_ratio: locked_ratio_2, inflation: inflation_2, } = controller.run(); @@ -247,11 +322,10 @@ mod test { // let a = (init_locked_ratio * total_tokens).to_uint().unwrap(); let num_rounds = 100; - let mut controller = RewardsController { + let mut controller = PosRewardsController { locked_tokens: (init_locked_ratio * total_tokens) .to_uint() .unwrap(), - total_tokens: Uint::from(total_tokens), total_native_tokens: Uint::from(total_tokens), locked_ratio_target: Dec::from_str("0.66666666").unwrap(), locked_ratio_last: init_locked_ratio, @@ -264,7 +338,7 @@ mod test { dbg!(&controller); for round in 0..num_rounds { - let ValsToUpdate { + let PosValsToUpdate { locked_ratio, inflation, } = controller.clone().run(); @@ -276,7 +350,6 @@ mod test { {rate}", ); controller.last_inflation_amount = inflation; - controller.total_tokens += inflation; controller.total_native_tokens += inflation; // if rate.abs_diff(&controller.max_reward_rate) @@ -285,11 +358,12 @@ mod test { // controller.locked_tokens = controller.total_tokens; // } - let tot_tokens = u64::try_from(controller.total_tokens).unwrap(); + let tot_tokens = + u64::try_from(controller.total_native_tokens).unwrap(); let change_staked_tokens = (staking_growth * tot_tokens).to_uint().unwrap(); controller.locked_tokens = std::cmp::min( - controller.total_tokens, + controller.total_native_tokens, controller.locked_tokens + change_staked_tokens, ); diff --git a/crates/core/src/types/token.rs b/crates/core/src/types/token.rs index 28fa10ebfb3..0ae72ed74a6 100644 --- a/crates/core/src/types/token.rs +++ b/crates/core/src/types/token.rs @@ -1009,8 +1009,9 @@ pub struct MaspParams { pub kd_gain_nom: Dec, /// Shielded Pool nominal proportional gain for the given token pub kp_gain_nom: Dec, - /// Locked ratio for the given token - pub locked_ratio_target: Dec, + /// Target amount for the given token that is locked in the shielded pool + /// TODO: should this be a Uint or DenominatedAmount??? + pub locked_amount_target: u64, } impl Default for MaspParams { @@ -1019,7 +1020,7 @@ impl Default for MaspParams { max_reward_rate: Dec::from_str("0.1").unwrap(), kp_gain_nom: Dec::from_str("0.25").unwrap(), kd_gain_nom: Dec::from_str("0.25").unwrap(), - locked_ratio_target: Dec::from_str("0.6667").unwrap(), + locked_amount_target: 10_000_u64, } } } diff --git a/crates/proof_of_stake/src/rewards.rs b/crates/proof_of_stake/src/rewards.rs index edd5df9e101..78e7accdb4a 100644 --- a/crates/proof_of_stake/src/rewards.rs +++ b/crates/proof_of_stake/src/rewards.rs @@ -292,9 +292,8 @@ where let pos_max_inflation_rate = params.max_inflation_rate; // Run rewards PD controller - let pos_controller = inflation::RewardsController { + let pos_controller = inflation::PosRewardsController { locked_tokens: pos_locked_supply.raw_amount(), - total_tokens: total_tokens.raw_amount(), total_native_tokens: total_tokens.raw_amount(), locked_ratio_target: pos_locked_ratio_target, locked_ratio_last: pos_last_staked_ratio, @@ -305,7 +304,7 @@ where epochs_per_year, }; // Run the rewards controllers - let inflation::ValsToUpdate { + let inflation::PosValsToUpdate { locked_ratio, inflation, } = pos_controller.run(); @@ -313,6 +312,8 @@ where let inflation = token::Amount::from_uint(inflation, 0).into_storage_result()?; + // Mint inflation and partition rewards among all accounts that earn a + // portion of it update_rewards_products_and_mint_inflation( storage, ¶ms, diff --git a/crates/sdk/src/masp.rs b/crates/sdk/src/masp.rs index eed4197cb42..7fd4fe97416 100644 --- a/crates/sdk/src/masp.rs +++ b/crates/sdk/src/masp.rs @@ -59,6 +59,7 @@ use namada_core::types::masp::{ }; use namada_core::types::storage::{BlockHeight, Epoch, IndexedTx, TxIndex}; use namada_core::types::time::{DateTimeUtc, DurationSecs}; +use namada_core::types::uint::Uint; use namada_ibc::IbcMessage; use namada_token::{self as token, Denomination, MaspDigitPos, Transfer}; use namada_tx::data::{TxResult, WrapperTx}; @@ -133,7 +134,7 @@ pub struct MaspTokenRewardData { pub max_reward_rate: Dec, pub kp_gain: Dec, pub kd_gain: Dec, - pub locked_ratio_target: Dec, + pub locked_amount_target: Uint, } #[cfg(feature = "testing")] diff --git a/crates/sdk/src/queries/shell.rs b/crates/sdk/src/queries/shell.rs index 65ea76118e4..3450425eff0 100644 --- a/crates/sdk/src/queries/shell.rs +++ b/crates/sdk/src/queries/shell.rs @@ -16,6 +16,7 @@ use namada_core::types::storage::{ self, BlockHeight, BlockResults, Epoch, KeySeg, PrefixValue, }; use namada_core::types::token::{Denomination, MaspDigitPos}; +use namada_core::types::uint::Uint; use namada_state::{DBIter, LastBlock, StorageHasher, DB}; use namada_storage::{self, ResultExt, StorageRead}; #[cfg(any(test, feature = "async-client"))] @@ -269,10 +270,10 @@ where ), )) })?; - let locked_ratio_target = ctx + let locked_amount_target = ctx .wl_storage - .read::( - &namada_token::storage_key::masp_locked_ratio_target_key( + .read::( + &namada_token::storage_key::masp_locked_amount_target_key( &token, ), )? @@ -293,7 +294,7 @@ where max_reward_rate, kp_gain, kd_gain, - locked_ratio_target, + locked_amount_target, }); } Ok(data) diff --git a/crates/shielded_token/src/conversion.rs b/crates/shielded_token/src/conversion.rs index 8efb2cee415..23db438d42b 100644 --- a/crates/shielded_token/src/conversion.rs +++ b/crates/shielded_token/src/conversion.rs @@ -1,6 +1,8 @@ //! MASP rewards conversions -use namada_core::ledger::inflation::{RewardsController, ValsToUpdate}; +use namada_core::ledger::inflation::{ + ShieldedRewardsController, ShieldedValsToUpdate, +}; use namada_core::types::address::{Address, MASP}; use namada_core::types::dec::Dec; use namada_core::types::uint::Uint; @@ -12,7 +14,7 @@ use namada_trans_token::{read_denom, Amount, DenominatedAmount, Denomination}; use crate::storage_key::{ masp_kd_gain_key, masp_kp_gain_key, masp_last_inflation_key, - masp_last_locked_ratio_key, masp_locked_ratio_target_key, + masp_last_locked_amount_key, masp_locked_amount_target_key, masp_max_reward_rate_key, }; @@ -45,31 +47,27 @@ where /// parameters and the last inflation and last locked rewards ratio values. pub fn calculate_masp_rewards( wl_storage: &mut WlStorage, - addr: &Address, + token: &Address, ) -> namada_storage::Result<((u128, u128), Denomination)> where D: 'static + DB + for<'iter> DBIter<'iter>, H: 'static + StorageHasher, { let (precision, denomination) = - calculate_masp_rewards_precision(wl_storage, addr)?; + calculate_masp_rewards_precision(wl_storage, token)?; let masp_addr = MASP; - // Query the storage for information - //// information about the amount of tokens on the chain - let total_tokens: Amount = wl_storage - .read(&minted_balance_key(addr))? - .expect("the total supply key should be here"); + // Query the storage for information ------------------------- //// information about the amount of native tokens on the chain let total_native_tokens: Amount = wl_storage .read(&minted_balance_key(&wl_storage.storage.native_token))? .expect("the total supply key should be here"); - // total staked amount in the Shielded pool - let total_token_in_masp: Amount = wl_storage - .read(&balance_key(addr, &masp_addr))? + // total locked amount in the Shielded pool + let total_tokens_in_masp: Amount = wl_storage + .read(&balance_key(token, &masp_addr))? .unwrap_or_default(); let epochs_per_year: u64 = wl_storage @@ -78,37 +76,36 @@ where //// Values from the last epoch let last_inflation: Amount = wl_storage - .read(&masp_last_inflation_key(addr))? + .read(&masp_last_inflation_key(token))? .expect("failure to read last inflation"); - let last_locked_ratio: Dec = wl_storage - .read(&masp_last_locked_ratio_key(addr))? + let last_locked_amount: Amount = wl_storage + .read(&masp_last_locked_amount_key(token))? .expect("failure to read last inflation"); //// Parameters for each token let max_reward_rate: Dec = wl_storage - .read(&masp_max_reward_rate_key(addr))? + .read(&masp_max_reward_rate_key(token))? .expect("max reward should properly decode"); let kp_gain_nom: Dec = wl_storage - .read(&masp_kp_gain_key(addr))? + .read(&masp_kp_gain_key(token))? .expect("kp_gain_nom reward should properly decode"); let kd_gain_nom: Dec = wl_storage - .read(&masp_kd_gain_key(addr))? + .read(&masp_kd_gain_key(token))? .expect("kd_gain_nom reward should properly decode"); - let locked_target_ratio: Dec = wl_storage - .read(&masp_locked_ratio_target_key(addr))? + let target_locked_amount: Amount = wl_storage + .read(&masp_locked_amount_target_key(token))? .expect("locked ratio target should properly decode"); // Creating the PD controller for handing out tokens - let controller = RewardsController { - locked_tokens: total_token_in_masp.raw_amount(), - total_tokens: total_tokens.raw_amount(), + let controller = ShieldedRewardsController { + locked_tokens: total_tokens_in_masp.raw_amount(), total_native_tokens: total_native_tokens.raw_amount(), - locked_ratio_target: locked_target_ratio, - locked_ratio_last: last_locked_ratio, + locked_tokens_target: target_locked_amount.raw_amount(), + locked_tokens_last: last_locked_amount.raw_amount(), max_reward_rate, last_inflation_amount: last_inflation.raw_amount(), p_gain_nom: kp_gain_nom, @@ -116,22 +113,20 @@ where epochs_per_year, }; - let ValsToUpdate { - locked_ratio, - inflation, - } = RewardsController::run(controller); + let ShieldedValsToUpdate { inflation } = + ShieldedRewardsController::run(controller); // inflation-per-token = inflation / locked tokens = n/PRECISION // ∴ n = (inflation * PRECISION) / locked tokens // Since we must put the notes in a compatible format with the // note format, we must make the inflation amount discrete. - let noterized_inflation = if total_token_in_masp.is_zero() { + let noterized_inflation = if total_tokens_in_masp.is_zero() { 0u128 } else { inflation .checked_mul_div( Uint::from(precision), - total_token_in_masp.raw_amount(), + total_tokens_in_masp.raw_amount(), ) .and_then(|x| x.0.try_into().ok()) .unwrap_or_else(|| { @@ -139,40 +134,38 @@ where "MASP inflation for {} assumed to be 0 because the \ computed value is too large. Please check the inflation \ parameters.", - *addr + *token ); 0u128 }) }; let inflation_amount = Amount::from_uint( - (total_token_in_masp.raw_amount() / precision) + (total_tokens_in_masp.raw_amount() / precision) * Uint::from(noterized_inflation), 0, ) .unwrap(); let denom_amount = DenominatedAmount::new(inflation_amount, denomination); - tracing::info!("MASP inflation for {addr} is {denom_amount}"); + tracing::info!("MASP inflation for {token} is {denom_amount}"); tracing::debug!( - "Controller, call: total_in_masp {:?}, total_tokens {:?}, \ - total_native_tokens {:?}, locked_target_ratio {:?}, \ - last_locked_ratio {:?}, max_reward_rate {:?}, last_inflation {:?}, \ - kp_gain_nom {:?}, kd_gain_nom {:?}, epochs_per_year {:?}", - total_token_in_masp, - total_tokens, + "Controller, call: total_in_masp {:?}, total_native_tokens {:?}, \ + locked_target_amount {:?}, last_locked_amount {:?}, max_reward_rate \ + {:?}, last_inflation {:?}, kp_gain_nom {:?}, kd_gain_nom {:?}, \ + epochs_per_year {:?}", + total_tokens_in_masp, total_native_tokens, - locked_target_ratio, - last_locked_ratio, + target_locked_amount, + last_locked_amount, max_reward_rate, last_inflation, kp_gain_nom, kd_gain_nom, epochs_per_year, ); - tracing::debug!("Token address: {:?}", addr); - tracing::debug!("Ratio {:?}", locked_ratio); + tracing::debug!("Token address: {:?}", token); tracing::debug!("inflation from the pd controller {:?}", inflation); - tracing::debug!("total in the masp {:?}", total_token_in_masp); + tracing::debug!("total in the masp {:?}", total_tokens_in_masp); tracing::debug!("precision {}", precision); tracing::debug!("Noterized inflation: {}", noterized_inflation); @@ -180,9 +173,10 @@ where // but we should make sure the return value's ratio matches // this new inflation rate in 'update_allowed_conversions', // otherwise we will have an inaccurate view of inflation - wl_storage.write(&masp_last_inflation_key(addr), inflation_amount)?; + wl_storage.write(&masp_last_inflation_key(token), inflation_amount)?; - wl_storage.write(&masp_last_locked_ratio_key(addr), locked_ratio)?; + wl_storage + .write(&masp_last_locked_amount_key(token), total_tokens_in_masp)?; Ok(((noterized_inflation, precision), denomination)) } @@ -285,12 +279,12 @@ where calculate_masp_rewards_precision(wl_storage, &native_token)?.0; // Reward all tokens according to above reward rates - for addr in &masp_reward_keys { - let (reward, denom) = calculate_masp_rewards(wl_storage, addr)?; - masp_reward_denoms.insert(addr.clone(), denom); + for token in &masp_reward_keys { + let (reward, denom) = calculate_masp_rewards(wl_storage, token)?; + masp_reward_denoms.insert(token.clone(), denom); // Dispense a transparent reward in parallel to the shielded rewards let addr_bal: Amount = wl_storage - .read(&balance_key(addr, &masp_addr))? + .read(&balance_key(token, &masp_addr))? .unwrap_or_default(); // Get the last rewarded amount of the native token let normed_inflation = wl_storage @@ -304,20 +298,20 @@ where // negative sign allows each instance of the old asset to be // cancelled out/replaced with the new asset let old_asset = encode_asset_type( - addr.clone(), + token.clone(), denom, digit, Some(wl_storage.storage.last_epoch), ) .into_storage_result()?; let new_asset = encode_asset_type( - addr.clone(), + token.clone(), denom, digit, Some(wl_storage.storage.block.epoch), ) .into_storage_result()?; - if *addr == native_token { + if *token == native_token { // The amount that will be given of the new native token for // every amount of the native token given in the // previous epoch @@ -332,7 +326,7 @@ where "MASP reward for {} assumed to be 0 because the \ computed value is too large. Please check the \ inflation parameters.", - addr + token ); *normed_inflation }); @@ -341,7 +335,7 @@ where // intermediate native tokens cancel/ // telescope out current_convs.insert( - (addr.clone(), denom, digit), + (token.clone(), denom, digit), (MaspAmount::from_pair( old_asset, -(*normed_inflation as i128), @@ -382,7 +376,7 @@ where "MASP reward for {} assumed to be 0 because the \ computed value is too large. Please check the \ inflation parameters.", - addr + token ); 0u128 }); @@ -390,7 +384,7 @@ where // conversions are added together, the // intermediate tokens cancel/ telescope out current_convs.insert( - (addr.clone(), denom, digit), + (token.clone(), denom, digit), (MaspAmount::from_pair(old_asset, -(reward.1 as i128)) .unwrap() + MaspAmount::from_pair(new_asset, reward.1 as i128) @@ -413,7 +407,7 @@ where wl_storage.storage.conversion_state.assets.insert( old_asset, ( - (addr.clone(), denom, digit), + (token.clone(), denom, digit), wl_storage.storage.last_epoch, MaspAmount::zero().into(), 0, @@ -592,12 +586,12 @@ mod tests { max_reward_rate: Dec::from_str("0.1").unwrap(), kp_gain_nom: Dec::from_str("0.1").unwrap(), kd_gain_nom: Dec::from_str("0.1").unwrap(), - locked_ratio_target: Dec::from_str("0.6667").unwrap(), + locked_amount_target: 10_000_u64, }; for (token_addr, (alias, denom)) in tokens() { namada_trans_token::write_params(&mut s, &token_addr).unwrap(); - crate::write_params(&token_params, &mut s, &token_addr) + crate::write_params(&token_params, &mut s, &token_addr, &denom) .unwrap(); write_denom(&mut s, &token_addr, denom).unwrap(); diff --git a/crates/shielded_token/src/storage.rs b/crates/shielded_token/src/storage.rs index eb084e29286..4fe2127aecf 100644 --- a/crates/shielded_token/src/storage.rs +++ b/crates/shielded_token/src/storage.rs @@ -1,9 +1,10 @@ use namada_core::types::address::Address; -use namada_core::types::dec::Dec; use namada_core::types::token; use namada_core::types::token::Amount; +use namada_core::types::uint::Uint; use namada_storage as storage; use namada_storage::{StorageRead, StorageWrite}; +use storage::ResultExt; use crate::storage_key::*; @@ -12,6 +13,7 @@ pub fn write_params( params: &token::MaspParams, storage: &mut S, address: &Address, + denom: &token::Denomination, ) -> storage::Result<()> where S: StorageRead + StorageWrite, @@ -20,13 +22,17 @@ where max_reward_rate: max_rate, kd_gain_nom, kp_gain_nom, - locked_ratio_target: locked_target, + locked_amount_target, } = params; storage.write(&masp_last_inflation_key(address), Amount::zero())?; - storage.write(&masp_last_locked_ratio_key(address), Dec::zero())?; + storage.write(&masp_last_locked_amount_key(address), Amount::zero())?; storage.write(&masp_max_reward_rate_key(address), max_rate)?; - storage.write(&masp_locked_ratio_target_key(address), locked_target)?; storage.write(&masp_kp_gain_key(address), kp_gain_nom)?; storage.write(&masp_kd_gain_key(address), kd_gain_nom)?; + + let raw_target = Uint::from(*locked_amount_target) + * Uint::from(10).checked_pow(Uint::from(denom.0)).unwrap(); + let raw_target = Amount::from_uint(raw_target, 0).into_storage_result()?; + storage.write(&masp_locked_amount_target_key(address), raw_target)?; Ok(()) } diff --git a/crates/shielded_token/src/storage_key.rs b/crates/shielded_token/src/storage_key.rs index 9483da0b689..e58ffe93a0e 100644 --- a/crates/shielded_token/src/storage_key.rs +++ b/crates/shielded_token/src/storage_key.rs @@ -20,14 +20,14 @@ pub const MASP_CONVERT_ANCHOR_KEY: &str = "convert_anchor"; /// Last calculated inflation value handed out pub const MASP_LAST_INFLATION_KEY: &str = "last_inflation"; /// The last locked ratio -pub const MASP_LAST_LOCKED_RATIO_KEY: &str = "last_locked_ratio"; +pub const MASP_LAST_LOCKED_AMOUNT_KEY: &str = "last_locked_ratio"; /// The key for the nominal proportional gain of a shielded pool for a given /// asset pub const MASP_KP_GAIN_KEY: &str = "proportional_gain"; /// The key for the nominal derivative gain of a shielded pool for a given asset pub const MASP_KD_GAIN_KEY: &str = "derivative_gain"; /// The key for the locked ratio target for a given asset -pub const MASP_LOCKED_RATIO_TARGET_KEY: &str = "locked_ratio_target"; +pub const MASP_LOCKED_AMOUNT_TARGET_KEY: &str = "locked_ratio_target"; /// The key for the max reward rate for a given asset pub const MASP_MAX_REWARD_RATE_KEY: &str = "max_reward_rate"; @@ -48,15 +48,15 @@ pub fn masp_max_reward_rate_key(token_addr: &Address) -> storage::Key { } /// Obtain the locked target ratio key for the given token -pub fn masp_locked_ratio_target_key(token_addr: &Address) -> storage::Key { +pub fn masp_locked_amount_target_key(token_addr: &Address) -> storage::Key { parameter_prefix(token_addr) - .with_segment(MASP_LOCKED_RATIO_TARGET_KEY.to_owned()) + .with_segment(MASP_LOCKED_AMOUNT_TARGET_KEY.to_owned()) } /// Obtain the storage key for the last locked ratio of a token -pub fn masp_last_locked_ratio_key(token_address: &Address) -> storage::Key { +pub fn masp_last_locked_amount_key(token_address: &Address) -> storage::Key { parameter_prefix(token_address) - .with_segment(MASP_LAST_LOCKED_RATIO_KEY.to_owned()) + .with_segment(MASP_LAST_LOCKED_AMOUNT_KEY.to_owned()) } /// Obtain the storage key for the last inflation of a token diff --git a/crates/tests/src/integration/masp.rs b/crates/tests/src/integration/masp.rs index 3142116a914..deef3c1061f 100644 --- a/crates/tests/src/integration/masp.rs +++ b/crates/tests/src/integration/masp.rs @@ -132,7 +132,7 @@ fn masp_incentives() -> Result<()> { }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.023")); + assert!(captured.contains("nam: 0.031")); // Assert NAM balance at MASP pool is exclusively the // rewards from the shielded BTC @@ -152,7 +152,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.023")); + assert!(captured.contains("nam: 0.031")); // Wait till epoch boundary node.next_epoch(); @@ -194,7 +194,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.09189")); + assert!(captured.contains("nam: 0.09292")); // Assert NAM balance at MASP pool is exclusively the // rewards from the shielded BTC @@ -214,7 +214,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.092966")); + assert!(captured.contains("nam: 0.09331")); // Wait till epoch boundary node.next_epoch(); @@ -317,7 +317,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.021504")); + assert!(captured.contains("nam: 0.359578")); // Assert NAM balance at MASP pool is an accumulation of // rewards from both the shielded BTC and shielded ETH @@ -337,7 +337,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.395651")); + assert!(captured.contains("nam: 0.671183")); // Wait till epoch boundary node.next_epoch(); @@ -403,7 +403,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.09112")); + assert!(captured.contains("nam: 0.719514")); node.next_epoch(); @@ -425,7 +425,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 1.210964")); + assert!(captured.contains("nam: 1.58943")); // Wait till epoch boundary node.next_epoch(); @@ -488,7 +488,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 1.417948")); + assert!(captured.contains("nam: 1.113911")); // Assert NAM balance at MASP pool is // the accumulation of rewards from the shielded assets (BTC and ETH) @@ -508,7 +508,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 1.55888")); + assert!(captured.contains("nam: 1.83743")); // Wait till epoch boundary node.next_epoch(); @@ -532,7 +532,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 1.587938")); + assert!(captured.contains("nam: 1.113911")); // Assert NAM balance at VK(B) is the rewards dispensed earlier // (since VK(A) has no shielded assets, no further rewards should @@ -553,7 +553,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.13393")); + assert!(captured.contains("nam: 0.719514")); // Assert NAM balance at MASP pool is // the accumulation of rewards from the shielded assets (BTC and ETH) @@ -573,7 +573,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 1.745105")); + assert!(captured.contains("nam: 1.83743")); // Wait till epoch boundary to prevent conversion expiry during transaction // construction @@ -592,7 +592,7 @@ fn masp_incentives() -> Result<()> { "--token", NAM, "--amount", - "0.14998", + "0.719514", "--signing-keys", BERTHA_KEY, "--node", @@ -617,7 +617,7 @@ fn masp_incentives() -> Result<()> { "--token", NAM, "--amount", - "2.007662", + "1.113911", "--signing-keys", ALBERT_KEY, "--node", @@ -681,7 +681,7 @@ fn masp_incentives() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.027953")); + assert!(captured.contains("nam: 0.004005")); Ok(()) } @@ -1661,7 +1661,7 @@ fn dynamic_assets() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.022462")); + assert!(captured.contains("nam: 0.0303")); // Assert BTC balance at VK(A) is still 2 let captured = CapturedOutput::of(|| { @@ -1732,7 +1732,7 @@ fn dynamic_assets() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.055134")); + assert!(captured.contains("nam: 0.07575")); { // Stop decoding and distributing shielded rewards for BTC in next epoch @@ -1779,7 +1779,7 @@ fn dynamic_assets() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.055134")); + assert!(captured.contains("nam: 0.07575")); // Wait till epoch boundary node.next_epoch(); @@ -1820,7 +1820,7 @@ fn dynamic_assets() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.055134")); + assert!(captured.contains("nam: 0.07575")); { // Start distributing shielded rewards for NAM in next epoch @@ -1872,7 +1872,7 @@ fn dynamic_assets() -> Result<()> { ) }); assert!(captured.result.is_ok()); - assert!(captured.contains("nam: 0.063288")); + assert!(captured.contains("nam: 0.075825")); Ok(()) } diff --git a/crates/tests/src/integration/setup.rs b/crates/tests/src/integration/setup.rs index 2a7f1ec96ed..f8c2b0c0663 100644 --- a/crates/tests/src/integration/setup.rs +++ b/crates/tests/src/integration/setup.rs @@ -54,7 +54,7 @@ pub fn initialize_genesis() -> Result<(MockNode, MockServicesController)> { max_reward_rate: Dec::from_str("0.1").unwrap(), kp_gain_nom: Dec::from_str("0.1").unwrap(), kd_gain_nom: Dec::from_str("0.1").unwrap(), - locked_ratio_target: Dec::from_str("0.6667").unwrap(), + locked_amount_target: 1_000_000u64, }); } let genesis_path = test_dir.path().join("int-test-genesis-src"); diff --git a/crates/token/src/lib.rs b/crates/token/src/lib.rs index a9a7bc7b1f6..9a97c4f89f9 100644 --- a/crates/token/src/lib.rs +++ b/crates/token/src/lib.rs @@ -17,13 +17,14 @@ pub fn write_params( params: &Option, storage: &mut S, address: &Address, + denom: &Denomination, ) -> Result<()> where S: StorageRead + StorageWrite, { namada_trans_token::write_params(storage, address)?; if let Some(params) = params { - namada_shielded_token::write_params(params, storage, address)?; + namada_shielded_token::write_params(params, storage, address, denom)?; } Ok(()) } diff --git a/genesis/localnet/parameters.toml b/genesis/localnet/parameters.toml index 6ae8aacb356..f99f9e0a50b 100644 --- a/genesis/localnet/parameters.toml +++ b/genesis/localnet/parameters.toml @@ -61,7 +61,7 @@ light_client_attack_min_slash_rate = "0.001" cubic_slashing_window_length = 1 # The minimum amount of bonded tokens that a validator needs to be in # either the `consensus` or `below_capacity` validator sets -validator_stake_threshold = "1" +validator_stake_threshold = "1000000" # The length, in blocks, of the sliding window for consensus validators # inactivity verification liveness_window_check = 100 diff --git a/genesis/localnet/tokens.toml b/genesis/localnet/tokens.toml index 2208d9b3281..3a851f7102a 100644 --- a/genesis/localnet/tokens.toml +++ b/genesis/localnet/tokens.toml @@ -4,61 +4,61 @@ denom = 6 [token.NAM.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.1" +locked_amount_target = 10000 [token.BTC] denom = 8 [token.BTC.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" +locked_amount_target = 10000 [token.ETH] denom = 18 [token.ETH.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" +locked_amount_target = 10000 [token.DOT] denom = 10 [token.DOT.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" +locked_amount_target = 10000 [token.Schnitzel] denom = 6 [token.Schnitzel.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" +locked_amount_target = 10000 [token.Apfel] denom = 6 [token.Apfel.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" +locked_amount_target = 10000 [token.Kartoffel] denom = 6 [token.Kartoffel.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.6667" \ No newline at end of file +locked_amount_target = 10000 diff --git a/genesis/starter/parameters.toml b/genesis/starter/parameters.toml index 5e3d062e1b6..ccbf9c95bb0 100644 --- a/genesis/starter/parameters.toml +++ b/genesis/starter/parameters.toml @@ -61,7 +61,7 @@ light_client_attack_min_slash_rate = "0.001" cubic_slashing_window_length = 1 # The minimum amount of bonded tokens that a validator needs to be in # either the `consensus` or `below_capacity` validator sets -validator_stake_threshold = "1" +validator_stake_threshold = "1000000" # The length, in blocks, of the sliding window for consensus validators # inactivity verification liveness_window_check = 10_000 diff --git a/genesis/starter/tokens.toml b/genesis/starter/tokens.toml index 4ac2e1701a8..f01cd78fae3 100644 --- a/genesis/starter/tokens.toml +++ b/genesis/starter/tokens.toml @@ -5,7 +5,7 @@ vp = "vp_token" denom = 6 [token.NAM.masp_params] -max_reward_rate = "0.1" +max_reward_rate = "0.01" kd_gain_nom = "0.25" kp_gain_nom = "0.25" -locked_ratio_target = "0.1" \ No newline at end of file +locked_amount_target = 10000 diff --git a/test_fixtures/masp_proofs/11BBC6FA2A8493A11DD5E488B2582DAD9FBD3ACA2E0F8314642810FC958594E7.bin b/test_fixtures/masp_proofs/11BBC6FA2A8493A11DD5E488B2582DAD9FBD3ACA2E0F8314642810FC958594E7.bin new file mode 100644 index 00000000000..d8d0752e4d7 Binary files /dev/null and b/test_fixtures/masp_proofs/11BBC6FA2A8493A11DD5E488B2582DAD9FBD3ACA2E0F8314642810FC958594E7.bin differ diff --git a/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin b/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin deleted file mode 100644 index 95f2016509f..00000000000 Binary files a/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin b/test_fixtures/masp_proofs/2B6C3CEF478B4971AF997B08C8D4D70154B89179E7DA6F14C700AAE1EC531E80.bin similarity index 54% rename from test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin rename to test_fixtures/masp_proofs/2B6C3CEF478B4971AF997B08C8D4D70154B89179E7DA6F14C700AAE1EC531E80.bin index 47fbaf511dd..896302b0a08 100644 Binary files a/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin and b/test_fixtures/masp_proofs/2B6C3CEF478B4971AF997B08C8D4D70154B89179E7DA6F14C700AAE1EC531E80.bin differ diff --git a/test_fixtures/masp_proofs/3E93E8F4FC3498BA19EF4D4D70FD0A13DAD049EAA1ECA95234C8AB02601FC0F0.bin b/test_fixtures/masp_proofs/3E93E8F4FC3498BA19EF4D4D70FD0A13DAD049EAA1ECA95234C8AB02601FC0F0.bin new file mode 100644 index 00000000000..5747b31c017 Binary files /dev/null and b/test_fixtures/masp_proofs/3E93E8F4FC3498BA19EF4D4D70FD0A13DAD049EAA1ECA95234C8AB02601FC0F0.bin differ diff --git a/test_fixtures/masp_proofs/3FDD781F73CEEE5426EF9EF03811DFBCF2AAA7876CE5FACD48AD18CB552E7349.bin b/test_fixtures/masp_proofs/3FDD781F73CEEE5426EF9EF03811DFBCF2AAA7876CE5FACD48AD18CB552E7349.bin new file mode 100644 index 00000000000..7ab7add9ba1 Binary files /dev/null and b/test_fixtures/masp_proofs/3FDD781F73CEEE5426EF9EF03811DFBCF2AAA7876CE5FACD48AD18CB552E7349.bin differ diff --git a/test_fixtures/masp_proofs/5355FAACD2BC8B1D4E226738EADB8CE4F984EEA5DE6991947DC46912C5EEEC72.bin b/test_fixtures/masp_proofs/5355FAACD2BC8B1D4E226738EADB8CE4F984EEA5DE6991947DC46912C5EEEC72.bin new file mode 100644 index 00000000000..c3af4cfd0cd Binary files /dev/null and b/test_fixtures/masp_proofs/5355FAACD2BC8B1D4E226738EADB8CE4F984EEA5DE6991947DC46912C5EEEC72.bin differ diff --git a/test_fixtures/masp_proofs/55CC69CC552A02161C1C9EED1AF2741B2A24802E41AF7F56081564BF2A160464.bin b/test_fixtures/masp_proofs/55CC69CC552A02161C1C9EED1AF2741B2A24802E41AF7F56081564BF2A160464.bin new file mode 100644 index 00000000000..180c2c668fa Binary files /dev/null and b/test_fixtures/masp_proofs/55CC69CC552A02161C1C9EED1AF2741B2A24802E41AF7F56081564BF2A160464.bin differ diff --git a/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin b/test_fixtures/masp_proofs/59CC89A38C2D211F8765F502B6753FB3BE606A5729D43A6EA8F79007D34F6C60.bin similarity index 51% rename from test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin rename to test_fixtures/masp_proofs/59CC89A38C2D211F8765F502B6753FB3BE606A5729D43A6EA8F79007D34F6C60.bin index 0082545ab08..0e4ff13fd5a 100644 Binary files a/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin and b/test_fixtures/masp_proofs/59CC89A38C2D211F8765F502B6753FB3BE606A5729D43A6EA8F79007D34F6C60.bin differ diff --git a/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin b/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin deleted file mode 100644 index 08cf80e5507..00000000000 Binary files a/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin b/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin deleted file mode 100644 index 6b8904c64fb..00000000000 Binary files a/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin b/test_fixtures/masp_proofs/6A12E11EEAA83A0D00BF7470DD0F3AD4FA4AB61D0B965BB9ED02971491A2B7FC.bin similarity index 57% rename from test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin rename to test_fixtures/masp_proofs/6A12E11EEAA83A0D00BF7470DD0F3AD4FA4AB61D0B965BB9ED02971491A2B7FC.bin index 31a03777602..492c021d126 100644 Binary files a/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin and b/test_fixtures/masp_proofs/6A12E11EEAA83A0D00BF7470DD0F3AD4FA4AB61D0B965BB9ED02971491A2B7FC.bin differ diff --git a/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin b/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin deleted file mode 100644 index a7061642ee9..00000000000 Binary files a/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin b/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin deleted file mode 100644 index e26ca530b8f..00000000000 Binary files a/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/AF6B3A470013460A05E8A522EC0DF6893C1C09CF3101C402BFE1465005639F14.bin b/test_fixtures/masp_proofs/AF6B3A470013460A05E8A522EC0DF6893C1C09CF3101C402BFE1465005639F14.bin new file mode 100644 index 00000000000..9526b74cec1 Binary files /dev/null and b/test_fixtures/masp_proofs/AF6B3A470013460A05E8A522EC0DF6893C1C09CF3101C402BFE1465005639F14.bin differ diff --git a/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin b/test_fixtures/masp_proofs/B0876E15DE7B2C742912E048F583E61BED82F25C4452CA41B769C3BABEB62D2B.bin similarity index 53% rename from test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin rename to test_fixtures/masp_proofs/B0876E15DE7B2C742912E048F583E61BED82F25C4452CA41B769C3BABEB62D2B.bin index 7f38d847ded..dd3f26ba0b5 100644 Binary files a/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin and b/test_fixtures/masp_proofs/B0876E15DE7B2C742912E048F583E61BED82F25C4452CA41B769C3BABEB62D2B.bin differ diff --git a/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin b/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin deleted file mode 100644 index 912f1a275d1..00000000000 Binary files a/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin b/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin deleted file mode 100644 index 85738271471..00000000000 Binary files a/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/BE09EB8FF98C0CAF7BA8278C4ADC5356710DE7B6F6FA2B23C19412005669DC2B.bin b/test_fixtures/masp_proofs/BE09EB8FF98C0CAF7BA8278C4ADC5356710DE7B6F6FA2B23C19412005669DC2B.bin new file mode 100644 index 00000000000..a3563067752 Binary files /dev/null and b/test_fixtures/masp_proofs/BE09EB8FF98C0CAF7BA8278C4ADC5356710DE7B6F6FA2B23C19412005669DC2B.bin differ diff --git a/test_fixtures/masp_proofs/BEDD60F57C8F73C0266B1DFF869384EF0421F46F7732EE62196DEB73ECB4C225.bin b/test_fixtures/masp_proofs/BEDD60F57C8F73C0266B1DFF869384EF0421F46F7732EE62196DEB73ECB4C225.bin new file mode 100644 index 00000000000..5d5f606f6a8 Binary files /dev/null and b/test_fixtures/masp_proofs/BEDD60F57C8F73C0266B1DFF869384EF0421F46F7732EE62196DEB73ECB4C225.bin differ diff --git a/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin b/test_fixtures/masp_proofs/C614F20521BADE7CE91F2399B81E2DCE33145F68A217FD50B065966646F59116.bin similarity index 54% rename from test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin rename to test_fixtures/masp_proofs/C614F20521BADE7CE91F2399B81E2DCE33145F68A217FD50B065966646F59116.bin index 7675d3a6a86..f30214b8c8e 100644 Binary files a/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin and b/test_fixtures/masp_proofs/C614F20521BADE7CE91F2399B81E2DCE33145F68A217FD50B065966646F59116.bin differ diff --git a/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin b/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin deleted file mode 100644 index e50d2b08951..00000000000 Binary files a/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin b/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin deleted file mode 100644 index 93832d8f317..00000000000 Binary files a/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin b/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin deleted file mode 100644 index cc07075be18..00000000000 Binary files a/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/CCDB111327E4189EC4C6FE2D429AFB3B6AE2AA3ADCACF75E6520A66B2F7D184C.bin b/test_fixtures/masp_proofs/CCDB111327E4189EC4C6FE2D429AFB3B6AE2AA3ADCACF75E6520A66B2F7D184C.bin new file mode 100644 index 00000000000..db2f1b978d4 Binary files /dev/null and b/test_fixtures/masp_proofs/CCDB111327E4189EC4C6FE2D429AFB3B6AE2AA3ADCACF75E6520A66B2F7D184C.bin differ diff --git a/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin b/test_fixtures/masp_proofs/D1DF6FEDD8C02C1506E1DCA61CA81A7DF315190329C7C2F708876D51F60D2D60.bin similarity index 63% rename from test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin rename to test_fixtures/masp_proofs/D1DF6FEDD8C02C1506E1DCA61CA81A7DF315190329C7C2F708876D51F60D2D60.bin index 6bcb3823bee..8357cbe5ed1 100644 Binary files a/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin and b/test_fixtures/masp_proofs/D1DF6FEDD8C02C1506E1DCA61CA81A7DF315190329C7C2F708876D51F60D2D60.bin differ diff --git a/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin b/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin deleted file mode 100644 index 3ad1b783d7d..00000000000 Binary files a/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin b/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin deleted file mode 100644 index aba2dfd24fe..00000000000 Binary files a/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin b/test_fixtures/masp_proofs/E1D883F9C9E7FD5C51D39AE1809BC3BBACE79DF98801EB8154EA1904597854A1.bin similarity index 65% rename from test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin rename to test_fixtures/masp_proofs/E1D883F9C9E7FD5C51D39AE1809BC3BBACE79DF98801EB8154EA1904597854A1.bin index cacde020e4b..a25fa32cf0c 100644 Binary files a/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin and b/test_fixtures/masp_proofs/E1D883F9C9E7FD5C51D39AE1809BC3BBACE79DF98801EB8154EA1904597854A1.bin differ diff --git a/test_fixtures/masp_proofs/EA7A88B1429EFFF0AE7167F6FBEF52D368B771AD525817E722EA3E12B0A96971.bin b/test_fixtures/masp_proofs/EA7A88B1429EFFF0AE7167F6FBEF52D368B771AD525817E722EA3E12B0A96971.bin new file mode 100644 index 00000000000..b1fcfa75c24 Binary files /dev/null and b/test_fixtures/masp_proofs/EA7A88B1429EFFF0AE7167F6FBEF52D368B771AD525817E722EA3E12B0A96971.bin differ diff --git a/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin b/test_fixtures/masp_proofs/EF7D15FBFB9CC557CC8F9D4D18F7858007C4DA521F8E3BF250A46E9342178EEB.bin similarity index 53% rename from test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin rename to test_fixtures/masp_proofs/EF7D15FBFB9CC557CC8F9D4D18F7858007C4DA521F8E3BF250A46E9342178EEB.bin index 9d77c2aedb6..e23e43bbb9a 100644 Binary files a/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin and b/test_fixtures/masp_proofs/EF7D15FBFB9CC557CC8F9D4D18F7858007C4DA521F8E3BF250A46E9342178EEB.bin differ diff --git a/test_fixtures/masp_proofs/F4F0D829373DDA78336CF39EBA3356453E412F862D949ABE9671C24A3903909E.bin b/test_fixtures/masp_proofs/F4F0D829373DDA78336CF39EBA3356453E412F862D949ABE9671C24A3903909E.bin new file mode 100644 index 00000000000..2c8eec82a42 Binary files /dev/null and b/test_fixtures/masp_proofs/F4F0D829373DDA78336CF39EBA3356453E412F862D949ABE9671C24A3903909E.bin differ diff --git a/test_fixtures/masp_proofs/F7D91D1E43AA598631284A69E9861C7F98EA4325D94989648024831E350D8F98.bin b/test_fixtures/masp_proofs/F7D91D1E43AA598631284A69E9861C7F98EA4325D94989648024831E350D8F98.bin new file mode 100644 index 00000000000..c3214e3d343 Binary files /dev/null and b/test_fixtures/masp_proofs/F7D91D1E43AA598631284A69E9861C7F98EA4325D94989648024831E350D8F98.bin differ