diff --git a/apps/src/lib/config/genesis.rs b/apps/src/lib/config/genesis.rs index b7281fd4ce..eac5f5bdca 100644 --- a/apps/src/lib/config/genesis.rs +++ b/apps/src/lib/config/genesis.rs @@ -213,6 +213,8 @@ pub mod genesis_config { pub vp: Option, // Initial balances held by accounts defined elsewhere. pub balances: Option>, + // Token parameters + pub parameters: Option, } #[derive(Clone, Debug, Deserialize, Serialize)] @@ -404,6 +406,9 @@ pub mod genesis_config { implicit_accounts: &HashMap, ) -> TokenAccount { TokenAccount { + last_locked_ratio: Dec::zero(), + last_inflation: token::Amount::zero(), + parameters: config.parameters.as_ref().unwrap().to_owned(), address: Address::decode(config.address.as_ref().unwrap()).unwrap(), denom: config.denom, balances: config @@ -818,6 +823,12 @@ pub struct TokenAccount { /// Accounts' balances of this token #[derivative(PartialOrd = "ignore", Ord = "ignore")] pub balances: HashMap, + /// Token parameters + pub parameters: token::Parameters, + /// Token inflation from the last epoch (read + write for every epoch) + pub last_inflation: token::Amount, + /// Token shielded ratio from the last epoch (read + write for every epoch) + pub last_locked_ratio: Dec, } #[derive( @@ -1100,6 +1111,9 @@ pub fn genesis(num_validators: u64) -> Genesis { .into_iter() .map(|(k, v)| (k, token::Amount::from_uint(v, denom).unwrap())) .collect(), + parameters: token::Parameters::default(), + last_inflation: token::Amount::zero(), + last_locked_ratio: Dec::zero(), }) .collect(); Genesis { diff --git a/apps/src/lib/node/ledger/shell/finalize_block.rs b/apps/src/lib/node/ledger/shell/finalize_block.rs index 53252065f1..346a3f916b 100644 --- a/apps/src/lib/node/ledger/shell/finalize_block.rs +++ b/apps/src/lib/node/ledger/shell/finalize_block.rs @@ -3,6 +3,7 @@ use std::collections::HashMap; use data_encoding::HEXUPPER; +use namada::core::ledger::inflation; use namada::core::ledger::pgf::ADDRESS as pgf_address; use namada::ledger::events::EventType; use namada::ledger::gas::{GasMetering, TxGasMeter}; @@ -11,7 +12,7 @@ use namada::ledger::pos::{namada_proof_of_stake, staking_token_address}; use namada::ledger::storage::EPOCH_SWITCH_BLOCKS_DELAY; use namada::ledger::storage_api::token::credit_tokens; use namada::ledger::storage_api::{pgf, StorageRead, StorageWrite}; -use namada::ledger::{inflation, protocol, replay_protection}; +use namada::ledger::{protocol, replay_protection}; use namada::proof_of_stake::{ delegator_rewards_products_handle, find_validator_by_raw_hash, read_last_block_proposer_address, read_pos_params, read_total_stake, @@ -665,6 +666,7 @@ where let pos_controller = inflation::RewardsController { locked_tokens: pos_locked_supply, total_tokens, + total_native_tokens: total_tokens, locked_ratio_target: pos_locked_ratio_target, locked_ratio_last: pos_last_staked_ratio, max_reward_rate: pos_max_inflation_rate, @@ -676,6 +678,7 @@ where let _masp_controller = inflation::RewardsController { locked_tokens: masp_locked_supply, total_tokens, + total_native_tokens: total_tokens, locked_ratio_target: masp_locked_ratio_target, locked_ratio_last: masp_locked_ratio_last, max_reward_rate: masp_max_inflation_rate, diff --git a/apps/src/lib/node/ledger/shell/init_chain.rs b/apps/src/lib/node/ledger/shell/init_chain.rs index d6b2efe4dd..46d4222983 100644 --- a/apps/src/lib/node/ledger/shell/init_chain.rs +++ b/apps/src/lib/node/ledger/shell/init_chain.rs @@ -330,14 +330,38 @@ where address, denom, balances, + parameters, + last_inflation, + last_locked_ratio, } in accounts { + // Init token parameters and last inflation and caching rates + parameters.init_storage(&address, &mut self.wl_storage); + self.wl_storage + .write(&token::masp_last_inflation(&address), last_inflation) + .unwrap(); + self.wl_storage + .write( + &token::masp_last_locked_ratio(&address), + last_locked_ratio, + ) + .unwrap(); // associate a token with its denomination. write_denom(&mut self.wl_storage, &address, denom).unwrap(); + + let mut total_balance_for_token = token::Amount::default(); for (owner, amount) in balances { + total_balance_for_token += amount; credit_tokens(&mut self.wl_storage, &address, &owner, amount) .unwrap(); } + // Write the total amount of tokens for the ratio + self.wl_storage + .write( + &token::minted_balance_key(&address), + total_balance_for_token, + ) + .unwrap(); } } diff --git a/apps/src/lib/node/ledger/shell/mod.rs b/apps/src/lib/node/ledger/shell/mod.rs index a1c17fe450..8230ce2a76 100644 --- a/apps/src/lib/node/ledger/shell/mod.rs +++ b/apps/src/lib/node/ledger/shell/mod.rs @@ -1980,6 +1980,7 @@ mod test_utils { /// We test that on shell shutdown, the tx queue gets persisted in a DB, and /// on startup it is read successfully + #[cfg(feature = "testing")] #[test] fn test_tx_queue_persistence() { let base_dir = tempdir().unwrap().as_ref().canonicalize().unwrap(); @@ -2017,6 +2018,7 @@ mod test_utils { .storage .begin_block(BlockHash::default(), BlockHeight(1)) .expect("begin_block failed"); + token::testing::init_token_storage(&mut shell.wl_storage, 60); let keypair = gen_keypair(); // enqueue a wrapper tx let mut wrapper = diff --git a/apps/src/lib/node/ledger/storage/mod.rs b/apps/src/lib/node/ledger/storage/mod.rs index 659f561cce..43617879c8 100644 --- a/apps/src/lib/node/ledger/storage/mod.rs +++ b/apps/src/lib/node/ledger/storage/mod.rs @@ -118,6 +118,7 @@ mod tests { assert_eq!(result, None); } + #[cfg(feature = "testing")] #[test] fn test_commit_block() { let db_path = @@ -144,6 +145,7 @@ mod tests { storage.block.pred_epochs.new_epoch(BlockHeight(100)); // make wl_storage to update conversion for a new epoch let mut wl_storage = WlStorage::new(WriteLog::default(), storage); + namada::types::token::testing::init_token_storage(&mut wl_storage, 60); update_allowed_conversions(&mut wl_storage) .expect("update conversions failed"); wl_storage.commit_block().expect("commit failed"); diff --git a/shared/src/ledger/inflation.rs b/core/src/ledger/inflation.rs similarity index 92% rename from shared/src/ledger/inflation.rs rename to core/src/ledger/inflation.rs index da2d5ed1e1..46e2c7ba8f 100644 --- a/shared/src/ledger/inflation.rs +++ b/core/src/ledger/inflation.rs @@ -2,8 +2,7 @@ //! proof-of-stake, providing liquity to shielded asset pools, and public goods //! funding. -use namada_core::types::dec::Dec; - +use crate::types::dec::Dec; use crate::types::token; /// The domains of inflation @@ -30,6 +29,8 @@ pub struct RewardsController { pub locked_tokens: token::Amount, /// Total token supply pub total_tokens: token::Amount, + /// Total native token supply + pub total_native_tokens: token::Amount, /// PD target locked ratio pub locked_ratio_target: Dec, /// PD last locked ratio @@ -52,6 +53,7 @@ impl RewardsController { let Self { locked_tokens, total_tokens, + total_native_tokens, locked_ratio_target, locked_ratio_last, max_reward_rate, @@ -67,10 +69,12 @@ impl RewardsController { .expect("Should not fail to convert token Amount to Dec"); let total = Dec::try_from(total_tokens.raw_amount()) .expect("Should not fail to convert token Amount to Dec"); + let total_native = Dec::try_from(total_native_tokens.raw_amount()) + .expect("Should not fail to convert token Amount to Dec"); let epochs_py: Dec = epochs_per_year.into(); let locked_ratio = locked / total; - let max_inflation = total * max_reward_rate / epochs_py; + let max_inflation = total_native * max_reward_rate / epochs_py; let p_gain = p_gain_nom * max_inflation; let d_gain = d_gain_nom * max_inflation; @@ -114,9 +118,8 @@ impl RewardsController { mod test { use std::str::FromStr; - use namada_core::types::token::NATIVE_MAX_DECIMAL_PLACES; - use super::*; + use crate::types::token::NATIVE_MAX_DECIMAL_PLACES; #[test] fn test_inflation_calc_up() { @@ -131,6 +134,11 @@ mod test { NATIVE_MAX_DECIMAL_PLACES, ) .unwrap(), + total_native_tokens: token::Amount::from_uint( + 4_000, + NATIVE_MAX_DECIMAL_PLACES, + ) + .unwrap(), locked_ratio_target: Dec::from_str("0.66666666").unwrap(), locked_ratio_last: Dec::from_str("0.5").unwrap(), max_reward_rate: Dec::from_str("0.1").unwrap(), @@ -202,6 +210,11 @@ mod test { NATIVE_MAX_DECIMAL_PLACES, ) .unwrap(), + total_native_tokens: token::Amount::from_uint( + 1_000, + NATIVE_MAX_DECIMAL_PLACES, + ) + .unwrap(), locked_ratio_target: Dec::from_str("0.66666666").unwrap(), locked_ratio_last: Dec::from_str("0.9").unwrap(), max_reward_rate: Dec::from_str("0.1").unwrap(), diff --git a/core/src/ledger/mod.rs b/core/src/ledger/mod.rs index 890d58044d..301cf78e08 100644 --- a/core/src/ledger/mod.rs +++ b/core/src/ledger/mod.rs @@ -5,6 +5,7 @@ pub mod gas; pub mod governance; #[cfg(any(feature = "abciplus", feature = "abcipp"))] pub mod ibc; +pub mod inflation; pub mod parameters; pub mod pgf; pub mod replay_protection; diff --git a/core/src/ledger/storage/masp_conversions.rs b/core/src/ledger/storage/masp_conversions.rs index f5d7553516..5b195dd29d 100644 --- a/core/src/ledger/storage/masp_conversions.rs +++ b/core/src/ledger/storage/masp_conversions.rs @@ -8,9 +8,21 @@ use masp_primitives::convert::AllowedConversion; use masp_primitives::merkle_tree::FrozenCommitmentTree; use masp_primitives::sapling::Node; +use crate::ledger::inflation::{RewardsController, ValsToUpdate}; +use crate::ledger::parameters; +use crate::ledger::storage_api::{StorageRead, StorageWrite}; use crate::types::address::Address; +use crate::types::dec::Dec; use crate::types::storage::Epoch; use crate::types::token::MaspDenom; +use crate::types::{address, token}; + +/// Inflation is implicitly denominated by this value. The lower this figure, +/// the less precise inflation computations are. The higher this figure, the +/// larger the fixed-width types that are required to carry out inflation +/// computations. This value should be fixed constant for each asset type - here +/// we have simplified it and made it constant across asset types. +const PRECISION: u64 = 100; /// A representation of the conversion state #[derive(Debug, Default, BorshSerialize, BorshDeserialize)] @@ -27,6 +39,150 @@ pub struct ConversionState { >, } +/// Compute the MASP rewards by applying the PD-controller to the genesis +/// parameters and the last inflation and last locked rewards ratio values. +pub fn calculate_masp_rewards( + wl_storage: &mut super::WlStorage, + addr: &Address, +) -> crate::ledger::storage_api::Result<(u32, u32)> +where + D: 'static + super::DB + for<'iter> super::DBIter<'iter>, + H: 'static + super::StorageHasher, +{ + let masp_addr = address::masp(); + // Query the storage for information + + //// information about the amount of tokens on the chain + let total_tokens: token::Amount = wl_storage + .read(&token::minted_balance_key(addr))? + .expect("the total supply key should be here"); + + //// information about the amount of native tokens on the chain + let total_native_tokens: token::Amount = wl_storage + .read(&token::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: token::Amount = wl_storage + .read(&token::balance_key(addr, &masp_addr))? + .unwrap_or_default(); + + let epochs_per_year: u64 = wl_storage + .read(¶meters::storage::get_epochs_per_year_key())? + .expect(""); + + //// Values from the last epoch + let last_inflation: token::Amount = wl_storage + .read(&token::masp_last_inflation(addr)) + .expect("failure to read last inflation") + .expect(""); + + let last_locked_ratio: Dec = wl_storage + .read(&token::masp_last_locked_ratio(addr)) + .expect("failure to read last inflation") + .expect(""); + + //// Parameters for each token + let max_reward_rate: Dec = wl_storage + .read(&token::masp_max_reward_rate(addr)) + .expect("max reward should properly decode") + .expect(""); + + let kp_gain_nom: Dec = wl_storage + .read(&token::masp_kp_gain(addr)) + .expect("kp_gain_nom reward should properly decode") + .expect(""); + + let kd_gain_nom: Dec = wl_storage + .read(&token::masp_kd_gain(addr)) + .expect("kd_gain_nom reward should properly decode") + .expect(""); + + let locked_target_ratio: Dec = wl_storage + .read(&token::masp_locked_ratio_target(addr))? + .expect(""); + + // Creating the PD controller for handing out tokens + let controller = RewardsController { + locked_tokens: total_token_in_masp, + total_tokens, + total_native_tokens, + locked_ratio_target: locked_target_ratio, + locked_ratio_last: last_locked_ratio, + max_reward_rate, + last_inflation_amount: last_inflation, + p_gain_nom: kp_gain_nom, + d_gain_nom: kd_gain_nom, + epochs_per_year, + }; + + let ValsToUpdate { + locked_ratio, + inflation, + } = RewardsController::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() { + 0u32 + } else { + crate::types::uint::Uint::try_into( + (inflation.raw_amount() * PRECISION) + / total_token_in_masp.raw_amount(), + ) + .unwrap() + }; + + 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, + total_native_tokens, + locked_target_ratio, + last_locked_ratio, + max_reward_rate, + last_inflation, + kp_gain_nom, + kd_gain_nom, + epochs_per_year, + ); + tracing::debug!("Please give me: {:?}", addr); + tracing::debug!("Ratio {:?}", locked_ratio); + tracing::debug!("inflation from the pd controller {:?}", inflation); + tracing::debug!("total in the masp {:?}", total_token_in_masp); + tracing::debug!("Please give me inflation: {:?}", noterized_inflation); + + // Is it fine to write the inflation rate, this is accurate, + // 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( + &token::masp_last_inflation(addr), + (total_token_in_masp / PRECISION) * u64::from(noterized_inflation), + ) + .expect("unable to encode new inflation rate (Decimal)"); + + wl_storage + .write(&token::masp_last_locked_ratio(addr), locked_ratio) + .expect("unable to encode new locked ratio (Decimal)"); + + // to make it conform with the expected output, we need to + // move it to a ratio of x/100 to match the masp_rewards + // function This may be unneeded, as we could describe it as a + // ratio of x/1 + + Ok(( + noterized_inflation, + PRECISION.try_into().expect("inflation precision too large"), + )) +} + // This is only enabled when "wasm-runtime" is on, because we're using rayon #[cfg(feature = "wasm-runtime")] /// Update the MASP's allowed conversions @@ -46,22 +202,22 @@ where }; use rayon::prelude::ParallelSlice; - use crate::ledger::storage_api::{ResultExt, StorageRead, StorageWrite}; + use crate::ledger::storage_api::ResultExt; use crate::types::storage::{self, KeySeg}; - use crate::types::{address, token}; // The derived conversions will be placed in MASP address space let masp_addr = address::masp(); let key_prefix: storage::Key = masp_addr.to_db_key().into(); - let masp_rewards = address::masp_rewards(); - let mut masp_reward_keys: Vec<_> = masp_rewards.keys().collect(); + let tokens = address::tokens(); + let mut masp_reward_keys: Vec<_> = tokens.into_keys().collect(); // Put the native rewards first because other inflation computations depend // on it + let native_token = wl_storage.storage.native_token.clone(); masp_reward_keys.sort_unstable_by(|x, y| { - if (**x == address::nam()) == (**y == address::nam()) { + if (*x == native_token) == (*y == native_token) { Ordering::Equal - } else if **x == address::nam() { + } else if *x == native_token { Ordering::Less } else { Ordering::Greater @@ -75,17 +231,25 @@ where // notes clients have to use. This trick works under the assumption that // reward tokens will then be reinflated back to the current epoch. let reward_assets = [ - encode_asset_type(address::nam(), MaspDenom::Zero, Epoch(0)), - encode_asset_type(address::nam(), MaspDenom::One, Epoch(0)), - encode_asset_type(address::nam(), MaspDenom::Two, Epoch(0)), - encode_asset_type(address::nam(), MaspDenom::Three, Epoch(0)), + encode_asset_type(native_token.clone(), MaspDenom::Zero, Epoch(0)), + encode_asset_type(native_token.clone(), MaspDenom::One, Epoch(0)), + encode_asset_type(native_token.clone(), MaspDenom::Two, Epoch(0)), + encode_asset_type(native_token.clone(), MaspDenom::Three, Epoch(0)), ]; // Conversions from the previous to current asset for each address let mut current_convs = BTreeMap::<(Address, MaspDenom), AllowedConversion>::new(); + // Native token inflation values are always with respect to this + let mut ref_inflation = 0; // Reward all tokens according to above reward rates - for addr in masp_reward_keys { - let reward = masp_rewards[addr]; + for addr in &masp_reward_keys { + let reward = calculate_masp_rewards(wl_storage, addr) + .expect("Calculating the masp rewards should not fail"); + if *addr == native_token { + // The reference inflation is the denominator of the native token + // inflation, which is always a constant + ref_inflation = reward.1; + } // Dispense a transparent reward in parallel to the shielded rewards let addr_bal: token::Amount = wl_storage .read(&token::balance_key(addr, &masp_addr))? @@ -104,15 +268,13 @@ where denom, wl_storage.storage.block.epoch, ); - // Native token inflation values are always with respect to this - let ref_inflation = masp_rewards[&address::nam()].1; // Get the last rewarded amount of the native token let normed_inflation = wl_storage .storage .conversion_state .normed_inflation .get_or_insert(ref_inflation); - if *addr == address::nam() { + if *addr == 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 @@ -224,7 +386,7 @@ where // Update the MASP's transparent reward token balance to ensure that it // is sufficiently backed to redeem rewards - let reward_key = token::balance_key(&address::nam(), &masp_addr); + let reward_key = token::balance_key(&native_token, &masp_addr); let addr_bal: token::Amount = wl_storage.read(&reward_key)?.unwrap_or_default(); let new_bal = addr_bal + total_reward; @@ -249,7 +411,7 @@ where // Add purely decoding entries to the assets map. These will be // overwritten before the creation of the next commitment tree - for addr in masp_rewards.keys() { + for addr in masp_reward_keys { for denom in token::MaspDenom::iter() { // Add the decoding entry for the new asset type. An uncommited // node position is used since this is not a conversion. diff --git a/core/src/ledger/storage/mod.rs b/core/src/ledger/storage/mod.rs index 81be7e48a6..868e49fbdd 100644 --- a/core/src/ledger/storage/mod.rs +++ b/core/src/ledger/storage/mod.rs @@ -26,7 +26,9 @@ pub use wl_storage::{ #[cfg(feature = "wasm-runtime")] pub use self::masp_conversions::update_allowed_conversions; -pub use self::masp_conversions::{encode_asset_type, ConversionState}; +pub use self::masp_conversions::{ + calculate_masp_rewards, encode_asset_type, ConversionState, +}; use super::replay_protection::is_replay_protection_key; use crate::ledger::eth_bridge::storage::bridge_pool::is_pending_transfer_key; use crate::ledger::gas::{ diff --git a/core/src/types/token.rs b/core/src/types/token.rs index 0ee60b4326..c6fefea9c6 100644 --- a/core/src/types/token.rs +++ b/core/src/types/token.rs @@ -13,8 +13,9 @@ use thiserror::Error; use super::dec::POS_DECIMAL_PRECISION; use crate::ibc::applications::transfer::Amount as IbcAmount; +use crate::ledger::storage as ledger_storage; use crate::ledger::storage_api::token::read_denom; -use crate::ledger::storage_api::{self, StorageRead}; +use crate::ledger::storage_api::{self, StorageRead, StorageWrite}; use crate::types::address::{ masp, Address, DecodeError as AddressError, InternalAddress, }; @@ -814,6 +815,31 @@ pub const TX_KEY_PREFIX: &str = "tx-"; pub const CONVERSION_KEY_PREFIX: &str = "conv"; /// Key segment prefix for pinned shielded transactions pub const PIN_KEY_PREFIX: &str = "pin-"; +/// Last calculated inflation value handed out +pub const MASP_LAST_INFLATION: &str = "last_inflation"; +/// The last locked ratio +pub const MASP_LAST_LOCKED_RATIO: &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 = "proptional_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"; +/// The key for the max reward rate for a given asset +pub const MASP_MAX_REWARD_RATE: &str = "max_reward_rate"; + +/// Gets the key for the given token address, error with the given +/// message to expect if the key is not in the address +pub fn key_of_token( + token_addr: &Address, + specific_key: &str, + expect_message: &str, +) -> Key { + Key::from(token_addr.to_db_key()) + .push(&specific_key.to_owned()) + .expect(expect_message) +} /// Obtain a storage key for user's balance. pub fn balance_key(token_addr: &Address, owner: &Address) -> Key { @@ -847,6 +873,98 @@ pub fn minted_balance_key(token_addr: &Address) -> Key { .expect("Cannot obtain a storage key") } +/// Obtain the nominal proportional key for the given token +pub fn masp_kp_gain(token_addr: &Address) -> Key { + key_of_token(token_addr, MASP_KP_GAIN_KEY, "nominal proproitonal gains") +} + +/// Obtain the nominal derivative key for the given token +pub fn masp_kd_gain(token_addr: &Address) -> Key { + key_of_token(token_addr, MASP_KD_GAIN_KEY, "nominal proproitonal gains") +} + +/// The max reward rate key for the given token +pub fn masp_max_reward_rate(token_addr: &Address) -> Key { + key_of_token(token_addr, MASP_MAX_REWARD_RATE, "max reward rate") +} + +/// Obtain the locked target ratio key for the given token +pub fn masp_locked_ratio_target(token_addr: &Address) -> Key { + key_of_token( + token_addr, + MASP_LOCKED_RATIO_TARGET_KEY, + "nominal proproitonal gains", + ) +} + +/// Token parameters for each kind of asset held on chain +#[derive( + Clone, + Debug, + PartialEq, + Eq, + PartialOrd, + Ord, + Hash, + BorshSerialize, + BorshDeserialize, + BorshSchema, + Deserialize, + Serialize, +)] +pub struct Parameters { + /// Maximum reward rate + pub max_reward_rate: Dec, + /// Shielded Pool nominal derivative gain + 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_key: Dec, +} + +impl Parameters { + /// Initialize parameters for the token in storage during the genesis block. + pub fn init_storage( + &self, + address: &Address, + wl_storage: &mut ledger_storage::WlStorage, + ) where + DB: ledger_storage::DB + for<'iter> ledger_storage::DBIter<'iter>, + H: ledger_storage::StorageHasher, + { + let Self { + max_reward_rate: max_rate, + kd_gain_nom, + kp_gain_nom, + locked_ratio_target_key: locked_target, + } = self; + wl_storage + .write(&masp_max_reward_rate(address), max_rate) + .expect("max reward rate for the given asset must be initialized"); + wl_storage + .write(&masp_locked_ratio_target(address), locked_target) + .expect("locked ratio must be initialized"); + wl_storage + .write(&masp_kp_gain(address), kp_gain_nom) + .expect("The nominal proportional gain must be initialized"); + wl_storage + .write(&masp_kd_gain(address), kd_gain_nom) + .expect("The nominal derivative gain must be initialized"); + } +} + +impl Default for Parameters { + fn default() -> Self { + Self { + 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_key: Dec::from_str("0.1").unwrap(), + } + } +} + /// Check if the given storage key is balance key for the given token. If it is, /// returns the owner. For minted balances, use [`is_any_minted_balance_key()`]. pub fn is_balance_key<'a>( @@ -914,6 +1032,24 @@ pub fn is_masp_key(key: &Key) -> bool { || key.starts_with(PIN_KEY_PREFIX))) } +/// The last locked ratio of a token +pub fn masp_last_locked_ratio(token_address: &Address) -> Key { + key_of_token( + token_address, + MASP_LAST_LOCKED_RATIO, + "cannot obtain storage key for the last locked ratio", + ) +} + +/// The last inflation of a token +pub fn masp_last_inflation(token_address: &Address) -> Key { + key_of_token( + token_address, + MASP_LAST_INFLATION, + "cannot obtain storage key for the last inflation rate", + ) +} + /// Check if the given storage key is for a minter of a unspecified token. /// If it is, returns the token. pub fn is_any_minter_key(key: &Key) -> Option<&Address> { @@ -1185,4 +1321,50 @@ pub mod testing { ) -> impl Strategy { (1..=max).prop_map(|val| Amount::from_uint(val, 0).unwrap()) } + + /// init_token_storage is useful when the initialization of the network is + /// not properly made. This properly sets up the storage such that + /// inflation calculations can be ran on the token addresses. We assume + /// a total supply that may not be real + pub fn init_token_storage( + wl_storage: &mut ledger_storage::WlStorage, + epochs_per_year: u64, + ) where + D: 'static + + ledger_storage::DB + + for<'iter> ledger_storage::DBIter<'iter>, + H: 'static + ledger_storage::StorageHasher, + { + use crate::ledger::parameters::storage::get_epochs_per_year_key; + use crate::types::address::masp_rewards; + + let masp_rewards = masp_rewards(); + let masp_reward_keys: Vec<_> = masp_rewards.keys().collect(); + + wl_storage + .write(&get_epochs_per_year_key(), epochs_per_year) + .unwrap(); + let params = Parameters { + max_reward_rate: Dec::from_str("0.1").unwrap(), + kd_gain_nom: Dec::from_str("0.1").unwrap(), + kp_gain_nom: Dec::from_str("0.1").unwrap(), + locked_ratio_target_key: Dec::zero(), + }; + + for address in masp_reward_keys { + params.init_storage(address, wl_storage); + wl_storage + .write( + &minted_balance_key(address), + Amount::native_whole(5), // arbitrary amount + ) + .unwrap(); + wl_storage + .write(&masp_last_inflation(address), Amount::zero()) + .expect("inflation ought to be written"); + wl_storage + .write(&masp_last_locked_ratio(address), Dec::zero()) + .expect("last locked set default"); + } + } } diff --git a/genesis/e2e-tests-single-node.toml b/genesis/e2e-tests-single-node.toml index 4a3c02b805..0020dd995a 100644 --- a/genesis/e2e-tests-single-node.toml +++ b/genesis/e2e-tests-single-node.toml @@ -36,6 +36,11 @@ Christel = "1000000" Daewon = "1000000" Ester = "1000000" "validator-0.public_key" = "100" +[token.NAM.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.BTC] address = "atest1v4ehgw36xdzryve5gsc52veeg5cnsv2yx5eygvp38qcrvd29xy6rys6p8yc5xvp4xfpy2v694wgwcp" @@ -46,6 +51,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.BTC.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.ETH] address = "atest1v4ehgw36xqmr2d3nx3ryvd2xxgmrq33j8qcns33sxezrgv6zxdzrydjrxveygd2yxumrsdpsf9jc2p" @@ -56,6 +66,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.ETH.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.DOT] address = "atest1v4ehgw36gg6nvs2zgfpyxsfjgc65yv6pxy6nwwfsxgungdzrggeyzv35gveyxsjyxymyz335hur2jn" @@ -66,6 +81,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.DOT.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.Schnitzel] address = "atest1v4ehgw36xue5xvf5xvuyzvpjx5un2v3k8qeyvd3cxdqns32p89rrxd6xx9zngvpegccnzs699rdnnt" @@ -76,6 +96,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.Schnitzel.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.Apfel] address = "atest1v4ehgw36gfryydj9g3p5zv3kg9znyd358ycnzsfcggc5gvecgc6ygs2rxv6ry3zpg4zrwdfeumqcz9" @@ -86,6 +111,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.Apfel.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [token.Kartoffel] address = "atest1v4ehgw36gep5ysecxq6nyv3jg3zygv3e89qn2vp48pryxsf4xpznvve5gvmy23fs89pryvf5a6ht90" @@ -97,6 +127,11 @@ Bertha = "1000000" Christel = "1000000" Daewon = "1000000" Ester = "1000000" +[token.Kartoffel.parameters] +max_reward_rate = "0.1" +kd_gain_nom = "0.1" +kp_gain_nom = "0.1" +locked_ratio_target_key = "0.6667" [established.Albert] vp = "vp_user" diff --git a/scripts/generator.sh b/scripts/generator.sh index 3fe1792a49..c9635d498d 100755 --- a/scripts/generator.sh +++ b/scripts/generator.sh @@ -9,8 +9,10 @@ # vectors. NAMADA_DIR="$(pwd)" +NAMADA_BASE_DIR_FILE="$(pwd)/namada_base_dir" export NAMADA_LEDGER_LOG_PATH="$(pwd)/vectors.json" export NAMADA_TX_LOG_PATH="$(pwd)/debugs.txt" +export NAMADA_DEV=false if [ "$#" -ne 1 ]; then echo "Illegal number of parameters" @@ -19,11 +21,14 @@ elif [ "$1" = "server" ]; then sed -i 's/^epochs_per_year = 31_536_000$/epochs_per_year = 262_800/' genesis/test-vectors-single-node.toml - NAMADA_GENESIS_FILE=$(cargo run --bin namadac -- utils init-network --genesis-path genesis/test-vectors-single-node.toml --wasm-checksums-path wasm/checksums.json --chain-prefix e2e-test --unsafe-dont-encrypt --localhost --allow-duplicate-ip | grep 'Genesis file generated at ' | sed 's/^Genesis file generated at //') + NAMADA_GENESIS_FILE=$(cargo run --bin namadac --package namada_apps --manifest-path Cargo.toml -- utils init-network --genesis-path genesis/test-vectors-single-node.toml --wasm-checksums-path wasm/checksums.json --chain-prefix e2e-test --unsafe-dont-encrypt --localhost --dont-archive --allow-duplicate-ip | grep 'Genesis file generated at ' | sed 's/^Genesis file generated at //') rm genesis/test-vectors-single-node.toml NAMADA_BASE_DIR=${NAMADA_GENESIS_FILE%.toml} + echo $NAMADA_BASE_DIR > $NAMADA_BASE_DIR_FILE + + sed -i 's/^mode = "RemoteEndpoint"$/mode = "Off"/' $NAMADA_BASE_DIR/config.toml cp wasm/*.wasm $NAMADA_BASE_DIR/wasm/ @@ -31,8 +36,14 @@ elif [ "$1" = "server" ]; then cp $NAMADA_BASE_DIR/setup/other/wallet.toml $NAMADA_BASE_DIR/wallet.toml - cargo run --bin namadan -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada/ ledger + sed -i 's/^mode = "RemoteEndpoint"$/mode = "Off"/' $NAMADA_BASE_DIR/setup/validator-0/.namada/$(basename $NAMADA_BASE_DIR)/config.toml + + cargo run --bin namadan --package namada_apps --manifest-path Cargo.toml -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada/ ledger elif [ "$1" = "client" ]; then + if test -f "$NAMADA_BASE_DIR_FILE"; then + NAMADA_BASE_DIR="$(cat $NAMADA_BASE_DIR_FILE)" + fi + echo > $NAMADA_TX_LOG_PATH echo $'[' > $NAMADA_LEDGER_LOG_PATH @@ -40,120 +51,49 @@ elif [ "$1" = "client" ]; then ALBERT_ADDRESS=$(cargo run --bin namadaw -- address find --alias albert | sed 's/^Found address Established: //') echo '{ - "author":"'$ALBERT_ADDRESS'", - "content":{ - "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", - "authors":"test@test.com", - "created":"2022-03-10T08:54:37Z", - "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", - "discussions-to":"www.github.com/anoma/aip/1", - "license":"MIT", - "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", - "requires":"2", - "title":"TheTitle" - }, - "grace_epoch":30, - "type":{ - "Default":"'$NAMADA_DIR'/wasm_for_tests/tx_proposal_code.wasm" - }, - "voting_end_epoch":24, - "voting_start_epoch":12 -} -' > proposal_submission_valid_proposal.json - + "proposal": { + "author":"'$ALBERT_ADDRESS'", + "content":{ + "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", + "authors":"test@test.com", + "created":"2022-03-10T08:54:37Z", + "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", + "discussions-to":"www.github.com/anoma/aip/1", + "license":"MIT", + "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", + "requires":"2", + "title":"TheTitle" + }, + "grace_epoch":30, + "voting_end_epoch":24, + "voting_start_epoch":12 + } + }' > proposal_default.json + echo '{ - "content": { - "abstract": "Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", - "authors": "test@test.com", - "created": "2022-03-10T08:54:37Z", - "details": "Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", - "discussions-to": "www.github.com/anoma/aip/1", - "license": "MIT", - "motivation": "Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", - "requires": "2", - "title": "TheTitle" - }, - "author": "'$ALBERT_ADDRESS'", - "tally_epoch": 18, - "signature": { - "Ed25519": { - "R_bytes": [ - 113, - 196, - 231, - 134, - 101, - 191, - 75, - 17, - 245, - 19, - 50, - 231, - 183, - 80, - 162, - 38, - 108, - 72, - 72, - 2, - 116, - 112, - 121, - 33, - 197, - 67, - 64, - 116, - 21, - 250, - 196, - 121 - ], - "s_bytes": [ - 87, - 163, - 134, - 87, - 42, - 156, - 121, - 211, - 189, - 19, - 255, - 5, - 23, - 178, - 143, - 39, - 118, - 249, - 37, - 53, - 121, - 136, - 59, - 103, - 190, - 91, - 121, - 95, - 46, - 54, - 168, - 9 - ] + "data":['$(od -An -tu1 -v wasm_for_tests/tx_proposal_code.wasm | tr '\n' ' ' | sed 's/\b\s\+\b/,/g')'], + "proposal": { + "author":"'$ALBERT_ADDRESS'", + "content":{ + "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", + "authors":"test@test.com", + "created":"2022-03-10T08:54:37Z", + "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", + "discussions-to":"www.github.com/anoma/aip/1", + "license":"MIT", + "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", + "requires":"2", + "title":"TheTitle" + }, + "grace_epoch":30, + "voting_end_epoch":24, + "voting_start_epoch":12 } - }, - "address": "'$ALBERT_ADDRESS'" -} -' > proposal_offline_proposal + }' > proposal_default_with_data.json echo '{ - "author":"'$ALBERT_ADDRESS'", - "content":{ + "author":"'$ALBERT_ADDRESS'", + "content":{ "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", "authors":"test@test.com", "created":"2022-03-10T08:54:37Z", @@ -164,59 +104,41 @@ elif [ "$1" = "client" ]; then "requires":"2", "title":"TheTitle" }, - "grace_epoch":18, - "type":{ - "Default":null - }, - "voting_end_epoch":9, - "voting_start_epoch":3 -}' > proposal_offline_valid_proposal.json + "tally_epoch":1 + }' > proposal_offline.json echo '{ - "author":"'$ALBERT_ADDRESS'", - "content":{ - "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", - "authors":"test@test.com", - "created":"2022-03-10T08:54:37Z", - "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", - "discussions-to":"www.github.com/anoma/aip/1", - "license":"MIT", - "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", - "requires":"2", - "title":"TheTitle" + "proposal": { + "author":"'$ALBERT_ADDRESS'", + "content":{ + "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", + "authors":"test@test.com", + "created":"2022-03-10T08:54:37Z", + "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", + "discussions-to":"www.github.com/anoma/aip/1", + "license":"MIT", + "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", + "requires":"2", + "title":"TheTitle" + }, + "grace_epoch":30, + "voting_end_epoch":24, + "voting_start_epoch":12 }, - "grace_epoch":30, - "type":"ETHBridge", - "voting_end_epoch":24, - "voting_start_epoch":12 -}' > eth_governance_proposal_valid_proposal.json + "data": {"add":"'$ALBERT_ADDRESS'","remove":[]} + }' > proposal_pgf_steward_add.json - echo '{ - "author":"'$ALBERT_ADDRESS'", - "content":{ - "abstract":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros. Nullam sed ex justo. Ut at placerat ipsum, sit amet rhoncus libero. Sed blandit non purus non suscipit. Phasellus sed quam nec augue bibendum bibendum ut vitae urna. Sed odio diam, ornare nec sapien eget, congue viverra enim.", - "authors":"test@test.com", - "created":"2022-03-10T08:54:37Z", - "details":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices. Quisque viverra varius cursus. Praesent sed mauris gravida, pharetra turpis non, gravida eros.", - "discussions-to":"www.github.com/anoma/aip/1", - "license":"MIT", - "motivation":"Ut convallis eleifend orci vel venenatis. Duis vulputate metus in lacus sollicitudin vestibulum. Suspendisse vel velit ac est consectetur feugiat nec ac urna. Ut faucibus ex nec dictum fermentum. Morbi aliquet purus at sollicitudin ultrices.", - "requires":"2", - "title":"TheTitle" - }, - "grace_epoch":30, - "type":"PGFCouncil", - "voting_end_epoch":24, - "voting_start_epoch":12 -}' > pgf_governance_proposal_valid_proposal.json + # proposal_default - # proposal_submission + cargo run --bin namadac --features std -- bond --validator validator-0 --source Bertha --amount 900 --gas-token NAM --node 127.0.0.1:27657 - cargo run --bin namadac --features std -- bond --validator validator-0 --source Bertha --amount 900 --gas-amount 0 --gas-limit 0 --gas-token NAM --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- unjail-validator --validator Bertha --gas-token NAM --force --node 127.0.0.1:27657 - cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.02 --gas-amount 0 --gas-limit 0 --gas-token NAM --force --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.02 --gas-token NAM --force --node 127.0.0.1:27657 - PROPOSAL_ID_0=$(cargo run --bin namadac --features std -- init-proposal --force --data-path proposal_submission_valid_proposal.json --node 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') + PROPOSAL_ID_0=$(cargo run --bin namadac --features std -- init-proposal --force --data-path proposal_default.json --node 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') + + cargo run --bin namadac --features std -- init-proposal --force --data-path proposal_default_with_data.json --node 127.0.0.1:27657 cargo run --bin namadac --features std -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --address validator-0 --node 127.0.0.1:27657 @@ -226,41 +148,29 @@ elif [ "$1" = "client" ]; then # proposal_offline - cargo run --bin namadac --features std -- bond --validator validator-0 --source Albert --amount 900 --gas-amount 0 --gas-limit 0 --gas-token NAM --node 127.0.0.1:27657 - - cargo run --bin namadac --features std -- change-commission-rate --validator Albert --commission-rate 0.05 --gas-amount 0 --gas-limit 0 --gas-token NAM --force --node 127.0.0.1:27657 - - cargo run --bin namadac --features std -- init-proposal --force --data-path proposal_offline_valid_proposal.json --offline --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- bond --validator validator-0 --source Albert --amount 900 --gas-token NAM --node 127.0.0.1:27657 - cargo run --bin namadac --features std -- vote-proposal --data-path proposal_offline_proposal --vote yay --address Albert --offline --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- change-commission-rate --validator Albert --commission-rate 0.05 --gas-token NAM --force --node 127.0.0.1:27657 - # eth_governance_proposal + PROPOSAL_OFFLINE_SIGNED=$(cargo run --bin namadac --features std -- init-proposal --force --data-path proposal_offline.json --signing-keys albert-key --offline --node 127.0.0.1:27657 | grep -o -P '(?<=Proposal serialized to:\s).*') - cargo run --bin namadac --features std -- bond --validator validator-0 --source Bertha --amount 900 --gas-amount 0 --gas-limit 0 --gas-token NAM --ledger-address 127.0.0.1:27657 - - cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.07 --gas-amount 0 --gas-limit 0 --gas-token NAM --force --node 127.0.0.1:27657 - - PROPOSAL_ID_0=$(cargo run --bin namadac --features std -- init-proposal --force --data-path eth_governance_proposal_valid_proposal.json --ledger-address 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') - - cargo run --bin namadac --features std -- vote-proposal --force --proposal-id 0 --vote yay --eth '011586062748ba53bc53155e817ec1ea708de75878dcb9a5713bf6986d87fe14e7 fd34672ab5' --address Bertha --ledger-address 127.0.0.1:27657 - - cargo run --bin namadac --features std -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --eth '011586062748ba53bc53155e817ec1ea708de75878dcb9a5713bf6986d87fe14e7 fd34672ab5' --address validator-0 --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- vote-proposal --data-path $PROPOSAL_OFFLINE_SIGNED --vote yay --address Albert --offline --node 127.0.0.1:27657 # pgf_governance_proposal - cargo run --bin namadac --features std -- bond --validator validator-0 --source Bertha --amount 900 --gas-amount 0 --gas-limit 0 --gas-token NAM --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- bond --validator validator-0 --source Bertha --amount 900 --gas-token NAM --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.09 --gas-amount 0 --gas-limit 0 --gas-token NAM --force --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.09 --gas-token NAM --force --node 127.0.0.1:27657 - PROPOSAL_ID_0=$(cargo run --bin namadac --features std -- init-proposal --force --data-path pgf_governance_proposal_valid_proposal.json --ledger-address 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') + PROPOSAL_ID_0=$(cargo run --bin namadac --features std -- init-proposal --pgf-stewards --force --data-path proposal_pgf_steward_add.json --ledger-address 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') - PROPOSAL_ID_1=$(cargo run --bin namadac --features std -- init-proposal --force --data-path pgf_governance_proposal_valid_proposal.json --ledger-address 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') + PROPOSAL_ID_1=$(cargo run --bin namadac --features std -- init-proposal --pgf-stewards --force --data-path proposal_pgf_steward_add.json --ledger-address 127.0.0.1:27657 | grep -o -P '(?<=/proposal/).*(?=/author)') - cargo run --bin namadac --features std -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --pgf "$ALBERT_ADDRESS 1000" --address validator-0 --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- --base-dir $NAMADA_BASE_DIR/setup/validator-0/.namada vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --address validator-0 --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --pgf "$ALBERT_ADDRESS 900" --address Bertha --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- vote-proposal --force --proposal-id $PROPOSAL_ID_0 --vote yay --address Bertha --signing-keys bertha-key --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- vote-proposal --force --proposal-id $PROPOSAL_ID_1 --vote yay --pgf "$ALBERT_ADDRESS 900" --address Bertha --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- vote-proposal --force --proposal-id $PROPOSAL_ID_1 --vote yay --address Bertha --signing-keys bertha-key --ledger-address 127.0.0.1:27657 # non-proposal tests @@ -268,24 +178,38 @@ elif [ "$1" = "client" ]; then cargo run --bin namadac --features std -- bond --validator bertha --amount 25 --signing-keys bertha-key --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.11 --gas-amount 0 --gas-limit 0 --gas-token NAM --force --node 127.0.0.1:27657 + cargo run --bin namadac --features std -- change-commission-rate --validator Bertha --commission-rate 0.11 --gas-token NAM --force --node 127.0.0.1:27657 cargo run --bin namadac --features std -- reveal-pk --public-key albert-key --gas-payer albert-key --force --ledger-address 127.0.0.1:27657 cargo run --bin namadac --features std -- update-account --code-path vp_user.wasm --address bertha --signing-keys bertha-key --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- init-validator --alias bertha-validator --account-keys bertha --commission-rate 0.05 --max-commission-rate-change 0.01 --signing-keys bertha-key --unsafe-dont-encrypt --force --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- update-account --code-path vp_user.wasm --address bertha --public-keys albert-key,bertha-key --force --ledger-address 127.0.0.1:27657 + + cargo run --bin namadac --features std -- update-account --code-path vp_user.wasm --address bertha --public-keys albert-key,bertha-key,christel-key --threshold 2 --force --ledger-address 127.0.0.1:27657 + + cargo run --bin namadac --features std -- init-validator --alias bertha-validator --account-keys bertha-key --commission-rate 0.05 --max-commission-rate-change 0.01 --signing-keys bertha-key --unsafe-dont-encrypt --force --ledger-address 127.0.0.1:27657 + + cargo run --bin namadac --features std -- init-validator --alias validator-mult --account-keys albert-key,bertha-key --commission-rate 0.05 --max-commission-rate-change 0.01 --signing-keys albert-key,bertha-key --threshold 2 --unsafe-dont-encrypt --force --ledger-address 127.0.0.1:27657 + # TODO works but panics cargo run --bin namadac --features std -- unbond --validator christel --amount 5 --signing-keys christel-key --force --ledger-address 127.0.0.1:27657 cargo run --bin namadac --features std -- withdraw --validator albert --signing-keys albert-key --force --ledger-address 127.0.0.1:27657 cargo run --bin namadac --features std -- init-account --alias albert-account --public-keys albert-key --signing-keys albert-key --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- tx --code-path $NAMADA_DIR/wasm_for_tests/tx_no_op.wasm --data-path README.md --signing-keys albert-key --owner albert --force --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- init-account --alias account-mul --public-keys albert-key,bertha-key,christel-key --signing-keys albert-key,bertha-key,christel-key --threshold 2 --force --ledger-address 127.0.0.1:27657 + + # TODO panics, no vector produced + # cargo run --bin namadac --features std -- tx --code-path $NAMADA_DIR/wasm_for_tests/tx_no_op.wasm --data-path README.md --signing-keys albert-key --owner albert --force --ledger-address 127.0.0.1:27657 cargo run --bin namadac --features std -- ibc-transfer --source bertha --receiver christel --token btc --amount 24 --channel-id channel-141 --signing-keys bertha-key --force --ledger-address 127.0.0.1:27657 + cargo run --bin namadac --features std -- ibc-transfer --source albert --receiver bertha --token nam --amount 100000 --channel-id channel-0 --port-id transfer --signing-keys albert-key --force --ledger-address 127.0.0.1:27657 + + cargo run --bin namadac --features std -- ibc-transfer --source albert --receiver bertha --token nam --amount 100000 --channel-id channel-0 --port-id transfer --signing-keys albert-key --timeout-sec-offset 5 --force --ledger-address 127.0.0.1:27657 + cargo run --bin namadaw -- masp add --alias a_spending_key --value xsktest1qqqqqqqqqqqqqq9v0sls5r5de7njx8ehu49pqgmqr9ygelg87l5x8y4s9r0pjlvu69au6gn3su5ewneas486hdccyayx32hxvt64p3d0hfuprpgcgv2q9gdx3jvxrn02f0nnp3jtdd6f5vwscfuyum083cvfv4jun75ak5sdgrm2pthzj3sflxc0jx0edrakx3vdcngrfjmru8ywkguru8mxss2uuqxdlglaz6undx5h8w7g70t2es850g48xzdkqay5qs0yw06rtxcvedhsv --unsafe-dont-encrypt cargo run --bin namadaw -- masp add --alias b_spending_key --value xsktest1qqqqqqqqqqqqqqpagte43rsza46v55dlz8cffahv0fnr6eqacvnrkyuf9lmndgal7c2k4r7f7zu2yr5rjwr374unjjeuzrh6mquzy6grfdcnnu5clzaq2llqhr70a8yyx0p62aajqvrqjxrht3myuyypsvm725uyt5vm0fqzrzuuedtf6fala4r4nnazm9y9hq5yu6pq24arjskmpv4mdgfn3spffxxv8ugvym36kmnj45jcvvmm227vqjm5fq8882yhjsq97p7xrwqqd82s0 --unsafe-dont-encrypt @@ -296,27 +220,31 @@ elif [ "$1" = "client" ]; then cargo run --bin namadaw -- masp add --alias bb_payment_address --value patest1vqe0vyxh6wmhahwa52gthgd6edgqxfmgyv8e94jtwn55mdvpvylcyqnp59595272qrz3zxn0ysg + # TODO vector produced only when epoch boundaries not straddled cargo run --bin namadac --features std -- transfer --source albert --target aa_payment_address --token btc --amount 20 --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- transfer --source a_spending_key --target ab_payment_address --token btc --amount 7 --force --ledger-address 127.0.0.1:27657 + # TODO vector produced only when epoch boundaries not straddled + cargo run --bin namadac --features std -- transfer --gas-payer albert-key --source a_spending_key --target ab_payment_address --token btc --amount 7 --force --ledger-address 127.0.0.1:27657 - until cargo run --bin namadac -- epoch --ledger-address 127.0.0.1:27657 | grep -m1 "Last committed epoch: 2" ; do sleep 10 ; done; + # TODO fragile + until cargo run --bin namadac -- epoch --ledger-address 127.0.0.1:27657 | grep -m1 "Last committed epoch: 2" ; do sleep 10 ; done; - cargo run --bin namadac --features std -- transfer --source a_spending_key --target bb_payment_address --token btc --amount 7 --force --ledger-address 127.0.0.1:27657 + # TODO vector produced only when epoch boundaries not straddled + cargo run --bin namadac --features std -- transfer --gas-payer albert-key --source a_spending_key --target bb_payment_address --token btc --amount 7 --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- transfer --source a_spending_key --target bb_payment_address --token btc --amount 6 --force --ledger-address 127.0.0.1:27657 + # TODO vector produced only when epoch boundaries not straddled + cargo run --bin namadac --features std -- transfer --gas-payer albert-key --source a_spending_key --target bb_payment_address --token btc --amount 6 --force --ledger-address 127.0.0.1:27657 - cargo run --bin namadac --features std -- transfer --source b_spending_key --target bb_payment_address --token btc --amount 6 --force --ledger-address 127.0.0.1:27657 + # TODO vector produced only when epoch boundaries not straddled + cargo run --bin namadac --features std -- transfer --gas-payer albert-key --source b_spending_key --target bb_payment_address --token btc --amount 6 --force --ledger-address 127.0.0.1:27657 - rm proposal_submission_valid_proposal.json - - rm proposal_offline_proposal - - rm proposal_offline_valid_proposal.json + rm -f proposal_default.json + + rm -f proposal_default_with_data.json - rm eth_governance_proposal_valid_proposal.json + rm -f proposal_offline.json - rm pgf_governance_proposal_valid_proposal.json + rm -f proposal_pgf_steward_add.json perl -0777 -i.original -pe 's/,\s*$//igs' $NAMADA_LEDGER_LOG_PATH diff --git a/shared/src/ledger/mod.rs b/shared/src/ledger/mod.rs index 04b5809bc2..a1a6e93c40 100644 --- a/shared/src/ledger/mod.rs +++ b/shared/src/ledger/mod.rs @@ -4,7 +4,6 @@ pub mod eth_bridge; pub mod events; pub mod governance; pub mod ibc; -pub mod inflation; pub mod native_vp; pub mod pgf; pub mod pos; diff --git a/test_fixtures/masp_proofs/1226362759E8F5050B9954234033AC0E46C83B093EAF35D1A0537CE81D282FB9.bin b/test_fixtures/masp_proofs/1226362759E8F5050B9954234033AC0E46C83B093EAF35D1A0537CE81D282FB9.bin deleted file mode 100644 index 1764192dba..0000000000 Binary files a/test_fixtures/masp_proofs/1226362759E8F5050B9954234033AC0E46C83B093EAF35D1A0537CE81D282FB9.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/1362F1CF9B836CF8B05D8189EA9CB1712CCA85B0E96A3330A63BE7CD9E5ECD22.bin b/test_fixtures/masp_proofs/1362F1CF9B836CF8B05D8189EA9CB1712CCA85B0E96A3330A63BE7CD9E5ECD22.bin index 44c77d2521..20634c1de5 100644 Binary files a/test_fixtures/masp_proofs/1362F1CF9B836CF8B05D8189EA9CB1712CCA85B0E96A3330A63BE7CD9E5ECD22.bin and b/test_fixtures/masp_proofs/1362F1CF9B836CF8B05D8189EA9CB1712CCA85B0E96A3330A63BE7CD9E5ECD22.bin differ diff --git a/test_fixtures/masp_proofs/37332141CB34FC30FF51F4BEE8D76149D3088F539CF8372D404609B89B095EF7.bin b/test_fixtures/masp_proofs/37332141CB34FC30FF51F4BEE8D76149D3088F539CF8372D404609B89B095EF7.bin index c702a4e9b7..1fbae64602 100644 Binary files a/test_fixtures/masp_proofs/37332141CB34FC30FF51F4BEE8D76149D3088F539CF8372D404609B89B095EF7.bin and b/test_fixtures/masp_proofs/37332141CB34FC30FF51F4BEE8D76149D3088F539CF8372D404609B89B095EF7.bin differ diff --git a/test_fixtures/masp_proofs/47AAF805508239C602AD831876B062D269F657017C578484081762FB65D9D52E.bin b/test_fixtures/masp_proofs/47AAF805508239C602AD831876B062D269F657017C578484081762FB65D9D52E.bin deleted file mode 100644 index 7e5410e803..0000000000 Binary files a/test_fixtures/masp_proofs/47AAF805508239C602AD831876B062D269F657017C578484081762FB65D9D52E.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/85BDAF3AC6C282F8C767109FBDFBD6BDE6A1BF0BAE7D72FDACCC888A32094C72.bin b/test_fixtures/masp_proofs/85BDAF3AC6C282F8C767109FBDFBD6BDE6A1BF0BAE7D72FDACCC888A32094C72.bin deleted file mode 100644 index d4245c57e2..0000000000 Binary files a/test_fixtures/masp_proofs/85BDAF3AC6C282F8C767109FBDFBD6BDE6A1BF0BAE7D72FDACCC888A32094C72.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/8B29BC2E1A96DF331C7C3A2B227C98D1E5AAAA9988F26B1A47090ACCE693572F.bin b/test_fixtures/masp_proofs/8B29BC2E1A96DF331C7C3A2B227C98D1E5AAAA9988F26B1A47090ACCE693572F.bin index 54421f95dc..fc528241a1 100644 Binary files a/test_fixtures/masp_proofs/8B29BC2E1A96DF331C7C3A2B227C98D1E5AAAA9988F26B1A47090ACCE693572F.bin and b/test_fixtures/masp_proofs/8B29BC2E1A96DF331C7C3A2B227C98D1E5AAAA9988F26B1A47090ACCE693572F.bin differ diff --git a/test_fixtures/masp_proofs/8D37EB2E5C3BD60B88B1257DFF869989A13906D683BC96E27EF50FC037156E25.bin b/test_fixtures/masp_proofs/8D37EB2E5C3BD60B88B1257DFF869989A13906D683BC96E27EF50FC037156E25.bin deleted file mode 100644 index ac98e75b8b..0000000000 Binary files a/test_fixtures/masp_proofs/8D37EB2E5C3BD60B88B1257DFF869989A13906D683BC96E27EF50FC037156E25.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/DA50E59A47A7BE9BC8BFF03D9E755E2583731052033322E25250C780EE322BF4.bin b/test_fixtures/masp_proofs/917B7AD5FD4F2F0CB33924511A59181FA326C06FCA9A49B5A5C394C75942820E.bin similarity index 50% rename from test_fixtures/masp_proofs/DA50E59A47A7BE9BC8BFF03D9E755E2583731052033322E25250C780EE322BF4.bin rename to test_fixtures/masp_proofs/917B7AD5FD4F2F0CB33924511A59181FA326C06FCA9A49B5A5C394C75942820E.bin index a8a8691cd4..4dde0ccf5f 100644 Binary files a/test_fixtures/masp_proofs/DA50E59A47A7BE9BC8BFF03D9E755E2583731052033322E25250C780EE322BF4.bin and b/test_fixtures/masp_proofs/917B7AD5FD4F2F0CB33924511A59181FA326C06FCA9A49B5A5C394C75942820E.bin differ diff --git a/test_fixtures/masp_proofs/992543B7B7B6B9DCB328590D37CE9FF2DA066496E6664F56EB28F67D75C21911.bin b/test_fixtures/masp_proofs/992543B7B7B6B9DCB328590D37CE9FF2DA066496E6664F56EB28F67D75C21911.bin deleted file mode 100644 index 96669ba726..0000000000 Binary files a/test_fixtures/masp_proofs/992543B7B7B6B9DCB328590D37CE9FF2DA066496E6664F56EB28F67D75C21911.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/A08264B610C5903A47D48E90ABA700BB49387329F8FD049D5F66C95B11B55ADE.bin b/test_fixtures/masp_proofs/A08264B610C5903A47D48E90ABA700BB49387329F8FD049D5F66C95B11B55ADE.bin new file mode 100644 index 0000000000..4d88ddcc5d Binary files /dev/null and b/test_fixtures/masp_proofs/A08264B610C5903A47D48E90ABA700BB49387329F8FD049D5F66C95B11B55ADE.bin differ diff --git a/test_fixtures/masp_proofs/A9D6D90370C747C254D4DD4A2D4B1C762CEA0436B0ECA42C52A830A0FD66BC00.bin b/test_fixtures/masp_proofs/A9D6D90370C747C254D4DD4A2D4B1C762CEA0436B0ECA42C52A830A0FD66BC00.bin new file mode 100644 index 0000000000..d67642b43e Binary files /dev/null and b/test_fixtures/masp_proofs/A9D6D90370C747C254D4DD4A2D4B1C762CEA0436B0ECA42C52A830A0FD66BC00.bin differ diff --git a/test_fixtures/masp_proofs/DFDFB1EDE901241995311122C25CE2E0F12C98370D2CDFD6A75236522A4235F5.bin b/test_fixtures/masp_proofs/DFDFB1EDE901241995311122C25CE2E0F12C98370D2CDFD6A75236522A4235F5.bin deleted file mode 100644 index 321b39faef..0000000000 Binary files a/test_fixtures/masp_proofs/DFDFB1EDE901241995311122C25CE2E0F12C98370D2CDFD6A75236522A4235F5.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/ED30921582F7DCEA42D960F73DE905E9DAFDAC88A291E7F1756931C8A85441E6.bin b/test_fixtures/masp_proofs/ED30921582F7DCEA42D960F73DE905E9DAFDAC88A291E7F1756931C8A85441E6.bin deleted file mode 100644 index 259d8ed811..0000000000 Binary files a/test_fixtures/masp_proofs/ED30921582F7DCEA42D960F73DE905E9DAFDAC88A291E7F1756931C8A85441E6.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/EE7C912B7E21F07494D58AA6668DC6BBB31619C7E93A1A5A2E64B694DBE1BD6E.bin b/test_fixtures/masp_proofs/EE7C912B7E21F07494D58AA6668DC6BBB31619C7E93A1A5A2E64B694DBE1BD6E.bin deleted file mode 100644 index 9fa6ccfe2b..0000000000 Binary files a/test_fixtures/masp_proofs/EE7C912B7E21F07494D58AA6668DC6BBB31619C7E93A1A5A2E64B694DBE1BD6E.bin and /dev/null differ diff --git a/test_fixtures/masp_proofs/F068FDF05B8F25DD923E667215344FFFAA6CA273027CD480AEA68DDED57D88CA.bin b/test_fixtures/masp_proofs/F068FDF05B8F25DD923E667215344FFFAA6CA273027CD480AEA68DDED57D88CA.bin index b488689f3e..9d76ce43f2 100644 Binary files a/test_fixtures/masp_proofs/F068FDF05B8F25DD923E667215344FFFAA6CA273027CD480AEA68DDED57D88CA.bin and b/test_fixtures/masp_proofs/F068FDF05B8F25DD923E667215344FFFAA6CA273027CD480AEA68DDED57D88CA.bin differ diff --git a/test_fixtures/masp_proofs/F3FE67606FCCCE54C3BCF643F0C7F5019CA3DF4CB89D10CB4E38DA9CDE3A9A0A.bin b/test_fixtures/masp_proofs/F3FE67606FCCCE54C3BCF643F0C7F5019CA3DF4CB89D10CB4E38DA9CDE3A9A0A.bin new file mode 100644 index 0000000000..b10162bc6b Binary files /dev/null and b/test_fixtures/masp_proofs/F3FE67606FCCCE54C3BCF643F0C7F5019CA3DF4CB89D10CB4E38DA9CDE3A9A0A.bin differ