diff --git a/.changelog/unreleased/features/2474-masp-separate-parallel-sync.md b/.changelog/unreleased/features/2474-masp-separate-parallel-sync.md new file mode 100644 index 0000000000..d200fc16bf --- /dev/null +++ b/.changelog/unreleased/features/2474-masp-separate-parallel-sync.md @@ -0,0 +1,2 @@ +- Separated MASP syncing functionality into a separate subcommand. + ([\#2474](https://github.com/anoma/namada/pull/2474)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/2458-masp-scanning.md b/.changelog/unreleased/improvements/2458-masp-scanning.md new file mode 100644 index 0000000000..cafbd11a83 --- /dev/null +++ b/.changelog/unreleased/improvements/2458-masp-scanning.md @@ -0,0 +1,2 @@ +- Simplified the transaction fetching algorithm to enable it to be saved to + storage more frequently. ([\#2458](https://github.com/anoma/namada/pull/2458)) \ No newline at end of file diff --git a/crates/apps/src/lib/bench_utils.rs b/crates/apps/src/lib/bench_utils.rs index d6364d0d45..81c23756d9 100644 --- a/crates/apps/src/lib/bench_utils.rs +++ b/crates/apps/src/lib/bench_utils.rs @@ -958,8 +958,9 @@ impl BenchShieldedCtx { .find_spending_key(ALBERT_SPENDING_KEY, None) .unwrap(); async_runtime - .block_on(self.shielded.fetch( + .block_on(self.shielded.sync( &self.shell, + None, &[spending_key.into()], &[], )) diff --git a/crates/apps/src/lib/cli.rs b/crates/apps/src/lib/cli.rs index 12c6450850..3ea4e0f07d 100644 --- a/crates/apps/src/lib/cli.rs +++ b/crates/apps/src/lib/cli.rs @@ -267,6 +267,7 @@ pub mod cmds { .subcommand(QueryMetaData::def().display_order(5)) // Actions .subcommand(SignTx::def().display_order(6)) + .subcommand(ShieldedSync::def().display_order(6)) .subcommand(GenIbcShieldedTransafer::def().display_order(6)) // Utils .subcommand(Utils::def().display_order(7)) @@ -346,6 +347,7 @@ pub mod cmds { let add_to_eth_bridge_pool = Self::parse_with_ctx(matches, AddToEthBridgePool); let sign_tx = Self::parse_with_ctx(matches, SignTx); + let shielded_sync = Self::parse_with_ctx(matches, ShieldedSync); let gen_ibc_shielded = Self::parse_with_ctx(matches, GenIbcShieldedTransafer); let utils = SubCmd::parse(matches).map(Self::WithoutContext); @@ -397,6 +399,7 @@ pub mod cmds { .or(query_metadata) .or(query_account) .or(sign_tx) + .or(shielded_sync) .or(gen_ibc_shielded) .or(utils) } @@ -483,6 +486,7 @@ pub mod cmds { QueryValidatorState(QueryValidatorState), QueryRewards(QueryRewards), SignTx(SignTx), + ShieldedSync(ShieldedSync), GenIbcShieldedTransafer(GenIbcShieldedTransafer), } @@ -1344,6 +1348,29 @@ pub mod cmds { } } + #[derive(Clone, Debug)] + pub struct ShieldedSync(pub args::ShieldedSync); + + impl SubCmd for ShieldedSync { + const CMD: &'static str = "shielded-sync"; + + fn parse(matches: &ArgMatches) -> Option { + matches + .subcommand_matches(Self::CMD) + .map(|matches| ShieldedSync(args::ShieldedSync::parse(matches))) + } + + fn def() -> App { + App::new(Self::CMD) + .about( + "Sync the local shielded context with MASP notes owned by \ + the provided viewing / spending keys up to an optional \ + specified block height.", + ) + .add_args::>() + } + } + #[derive(Clone, Debug)] pub struct Bond(pub args::Bond); @@ -3095,6 +3122,8 @@ pub mod args { pub const VALUE: Arg = arg("value"); pub const VOTER_OPT: ArgOpt = arg_opt("voter"); pub const VIEWING_KEY: Arg = arg("key"); + pub const VIEWING_KEYS: ArgMulti = + arg_multi("viewing-keys"); pub const VP: ArgOpt = arg_opt("vp"); pub const WALLET_ALIAS_FORCE: ArgFlag = flag("wallet-alias-force"); pub const WASM_CHECKSUMS_PATH: Arg = arg("wasm-checksums-path"); @@ -5601,6 +5630,45 @@ pub mod args { } } + impl Args for ShieldedSync { + fn parse(matches: &ArgMatches) -> Self { + let ledger_address = LEDGER_ADDRESS_DEFAULT.parse(matches); + let last_query_height = BLOCK_HEIGHT_OPT.parse(matches); + let viewing_keys = VIEWING_KEYS.parse(matches); + Self { + ledger_address, + last_query_height, + viewing_keys, + } + } + + fn def(app: App) -> App { + app.arg(LEDGER_ADDRESS_DEFAULT.def().help(LEDGER_ADDRESS_ABOUT)) + .arg(BLOCK_HEIGHT_OPT.def().help( + "Option block height to sync up to. Default is latest.", + )) + .arg(VIEWING_KEYS.def().help( + "List of new viewing keys with which to check note \ + ownership. These will be added to the shielded context.", + )) + } + } + + impl CliToSdk> for ShieldedSync { + fn to_sdk(self, ctx: &mut Context) -> ShieldedSync { + let chain_ctx = ctx.borrow_mut_chain_or_exit(); + ShieldedSync { + ledger_address: (), + last_query_height: self.last_query_height, + viewing_keys: self + .viewing_keys + .iter() + .map(|vk| chain_ctx.get_cached(vk)) + .collect(), + } + } + } + impl CliToSdk> for GenIbcShieldedTransafer { diff --git a/crates/apps/src/lib/cli/client.rs b/crates/apps/src/lib/cli/client.rs index 2ae441d2d2..94bcc5152c 100644 --- a/crates/apps/src/lib/cli/client.rs +++ b/crates/apps/src/lib/cli/client.rs @@ -1,4 +1,6 @@ use color_eyre::eyre::Result; +use masp_primitives::sapling::ViewingKey; +use masp_primitives::zip32::ExtendedFullViewingKey; use namada::types::io::Io; use namada_sdk::{Namada, NamadaImpl}; @@ -298,6 +300,37 @@ impl CliApi { tx::submit_validator_metadata_change(&namada, args) .await?; } + Sub::ShieldedSync(ShieldedSync(mut args)) => { + let client = client.unwrap_or_else(|| { + C::from_tendermint_address(&mut args.ledger_address) + }); + client.wait_until_node_is_synced(&io).await?; + let args = args.to_sdk(&mut ctx); + let namada = ctx.to_sdk(client, io); + let mut vks: Vec = namada + .wallet() + .await + .get_viewing_keys() + .values() + .copied() + .map(|vk| ExtendedFullViewingKey::from(vk).fvk.vk) + .collect(); + vks.extend( + args.viewing_keys.into_iter().map(|vk| { + ExtendedFullViewingKey::from(vk).fvk.vk + }), + ); + let mut shielded = namada.shielded_mut().await; + let _ = shielded.load().await; + shielded + .sync( + namada.client(), + args.last_query_height, + &[], + &vks, + ) + .await?; + } // Eth bridge Sub::AddToEthBridgePool(args) => { let mut args = args.0; diff --git a/crates/apps/src/lib/client/rpc.rs b/crates/apps/src/lib/client/rpc.rs index 9641ae23d3..61e7937325 100644 --- a/crates/apps/src/lib/client/rpc.rs +++ b/crates/apps/src/lib/client/rpc.rs @@ -135,12 +135,7 @@ pub async fn query_transfers( let _ = shielded.precompute_asset_types(context).await; // Obtain the effects of all shielded and transparent transactions let transfers = shielded - .query_tx_deltas( - context.client(), - &query_owner, - &query_token, - &wallet.get_viewing_keys(), - ) + .query_tx_deltas(context.client(), &query_owner, &query_token) .await .unwrap(); // To facilitate lookups of human-readable token names @@ -878,11 +873,6 @@ pub async fn query_shielded_balance( { let mut shielded = context.shielded_mut().await; let _ = shielded.load().await; - let fvks: Vec<_> = viewing_keys - .iter() - .map(|fvk| ExtendedFullViewingKey::from(*fvk).fvk.vk) - .collect(); - shielded.fetch(context.client(), &[], &fvks).await.unwrap(); // Precompute asset types to increase chances of success in decoding let _ = shielded.precompute_asset_types(context).await; // Save the update state so that future fetches can be short-circuited diff --git a/crates/core/src/types/storage.rs b/crates/core/src/types/storage.rs index 1ac99d11b4..da1ed2920e 100644 --- a/crates/core/src/types/storage.rs +++ b/crates/core/src/types/storage.rs @@ -1463,6 +1463,7 @@ impl GetEventNonce for InnerEthEventsQueue { PartialEq, Ord, PartialOrd, + Hash, )] pub struct IndexedTx { /// The block height of the indexed tx diff --git a/crates/sdk/src/args.rs b/crates/sdk/src/args.rs index ed94a327b3..f96b9ed139 100644 --- a/crates/sdk/src/args.rs +++ b/crates/sdk/src/args.rs @@ -11,7 +11,7 @@ use namada_core::types::ethereum_events::EthAddress; use namada_core::types::keccak::KeccakHash; use namada_core::types::key::{common, SchemeType}; use namada_core::types::masp::PaymentAddress; -use namada_core::types::storage::Epoch; +use namada_core::types::storage::{BlockHeight, Epoch}; use namada_core::types::time::DateTimeUtc; use namada_core::types::{storage, token}; use namada_governance::cli::onchain::{ @@ -1823,6 +1823,19 @@ pub struct SignTx { pub owner: C::Address, } +#[derive(Clone, Debug)] +/// Sync notes from MASP owned by the provided spending / +/// viewing keys. Syncing can be told to stop at a given +/// block height. +pub struct ShieldedSync { + /// The ledger address + pub ledger_address: C::TendermintAddress, + /// Height to sync up to. Defaults to most recent + pub last_query_height: Option, + /// Viewing keys used to determine note ownership + pub viewing_keys: Vec, +} + /// Query PoS commission rate #[derive(Clone, Debug)] pub struct QueryCommissionRate { diff --git a/crates/sdk/src/masp.rs b/crates/sdk/src/masp.rs index 241194feb9..894776713c 100644 --- a/crates/sdk/src/masp.rs +++ b/crates/sdk/src/masp.rs @@ -12,6 +12,8 @@ use std::str::FromStr; // use async_std::io::{self}; use borsh::{BorshDeserialize, BorshSerialize}; use borsh_ext::BorshSerializeExt; +use futures::channel::mpsc::{channel, Receiver, Sender}; +use futures::{try_join, StreamExt}; use itertools::Either; use lazy_static::lazy_static; use masp_primitives::asset_type::AssetType; @@ -55,8 +57,8 @@ use namada_core::types::address::{Address, MASP}; use namada_core::types::dec::Dec; use namada_core::types::ibc::IbcShieldedTransfer; use namada_core::types::masp::{ - encode_asset_type, AssetData, BalanceOwner, ExtendedViewingKey, - PaymentAddress, TransferSource, TransferTarget, + encode_asset_type, AssetData, BalanceOwner, PaymentAddress, TransferSource, + TransferTarget, }; use namada_core::types::storage::{BlockHeight, Epoch, IndexedTx, TxIndex}; use namada_core::types::time::{DateTimeUtc, DurationSecs}; @@ -522,10 +524,11 @@ pub struct ShieldedContext { /// Location where this shielded context is saved #[borsh(skip)] pub utils: U, - /// The last indexed transaction to be processed in this context - pub last_indexed: Option, /// The commitment tree produced by scanning all transactions up to tx_pos pub tree: CommitmentTree, + /// Maps viewing keys to the block height to which they are synced. + /// In particular, the height given by the value *has been scanned*. + pub vk_heights: BTreeMap>, /// Maps viewing keys to applicable note positions pub pos_map: HashMap>, /// Maps a nullifier to the note position to which it applies @@ -547,6 +550,8 @@ pub struct ShieldedContext { pub asset_types: HashMap, /// Maps note positions to their corresponding viewing keys pub vk_map: HashMap, + /// Maps a shielded tx to the index of its first output note. + pub tx_note_map: BTreeMap, } /// Default implementation to ease construction of TxContexts. Derive cannot be @@ -555,7 +560,8 @@ impl Default for ShieldedContext { fn default() -> ShieldedContext { ShieldedContext:: { utils: U::default(), - last_indexed: None, + vk_heights: BTreeMap::new(), + tx_note_map: BTreeMap::default(), tree: CommitmentTree::empty(), pos_map: HashMap::default(), nf_map: HashMap::default(), @@ -583,96 +589,117 @@ impl ShieldedContext { self.utils.save(self).await } - /// Merge data from the given shielded context into the current shielded - /// context. It must be the case that the two shielded contexts share the - /// same last transaction ID and share identical commitment trees. - pub fn merge(&mut self, new_ctx: ShieldedContext) { - debug_assert_eq!(self.last_indexed, new_ctx.last_indexed); - // Merge by simply extending maps. Identical keys should contain - // identical values, so overwriting should not be problematic. - self.pos_map.extend(new_ctx.pos_map); - self.nf_map.extend(new_ctx.nf_map); - self.note_map.extend(new_ctx.note_map); - self.memo_map.extend(new_ctx.memo_map); - self.div_map.extend(new_ctx.div_map); - self.witness_map.extend(new_ctx.witness_map); - self.spents.extend(new_ctx.spents); - self.asset_types.extend(new_ctx.asset_types); - self.vk_map.extend(new_ctx.vk_map); - // The deltas are the exception because different keys can reveal - // different parts of the same transaction. Hence each delta needs to be - // merged separately. - for (height, (ep, ntfer_delta, ntx_delta)) in new_ctx.delta_map { - let (_ep, tfer_delta, tx_delta) = self - .delta_map - .entry(height) - .or_insert((ep, TransferDelta::new(), TransactionDelta::new())); - tfer_delta.extend(ntfer_delta); - tx_delta.extend(ntx_delta); + /// Update the merkle tree of witnesses the first time we + /// scan a new MASP transaction. + fn update_witness_map( + &mut self, + indexed_tx: IndexedTx, + shielded: &Transaction, + ) -> Result<(), Error> { + let mut note_pos = self.tree.size(); + self.tx_note_map.insert(indexed_tx, note_pos); + for so in shielded + .sapling_bundle() + .map_or(&vec![], |x| &x.shielded_outputs) + { + // Create merkle tree leaf node from note commitment + let node = Node::new(so.cmu.to_repr()); + // Update each merkle tree in the witness map with the latest + // addition + for (_, witness) in self.witness_map.iter_mut() { + witness.append(node).map_err(|()| { + Error::Other("note commitment tree is full".to_string()) + })?; + } + self.tree.append(node).map_err(|()| { + Error::Other("note commitment tree is full".to_string()) + })?; + // Finally, make it easier to construct merkle paths to this new + // note + let witness = IncrementalWitness::::from_tree(&self.tree); + self.witness_map.insert(note_pos, witness); + note_pos += 1; } + Ok(()) + } + + /// Process the shielded transactions arriving in the given channel as they + /// come. + pub async fn process_shielded_transfers( + &mut self, + last_witnessed_tx: Option, + mut tx_receiver: Receiver<(IndexedTx, (Epoch, Transfer, Transaction))>, + ) -> Result<(), Error> { + // Keep pulling transactions from the queue until they are finished + while let Some((indexed_tx, (epoch, tx, stx))) = + tx_receiver.next().await + { + // Only modify the Merkle trees and witnesses for heretofore unseen + // transactions + if Some(indexed_tx) > last_witnessed_tx { + self.update_witness_map(indexed_tx, &stx)?; + // Save the new state of the context + let _ = self.save().await; + } + let vk_heights = self.vk_heights.clone(); + // Scan the current transaction with all the outdated viewing keys + for (vk, _h) in + vk_heights.iter().filter(|(_vk, h)| **h < Some(indexed_tx)) + { + self.scan_tx(indexed_tx, epoch, &tx, &stx, vk)?; + // Retimestamp this viewing key + self.vk_heights.insert(*vk, Some(indexed_tx)); + // Save the new state of the context + let _ = self.save().await; + } + } + Ok(()) } /// Fetch the current state of the multi-asset shielded pool into a /// ShieldedContext - pub async fn fetch( + pub async fn sync( &mut self, client: &C, + last_block_height: Option, sks: &[ExtendedSpendingKey], fvks: &[ViewingKey], ) -> Result<(), Error> { - // First determine which of the keys requested to be fetched are new. - // Necessary because old transactions will need to be scanned for new - // keys. - let mut unknown_keys = Vec::new(); + // add new viewing keys for esk in sks { let vk = to_viewing_key(esk).vk; - if !self.pos_map.contains_key(&vk) { - unknown_keys.push(vk); - } + self.vk_heights.entry(vk).or_default(); } for vk in fvks { - if !self.pos_map.contains_key(vk) { - unknown_keys.push(*vk); - } - } - - // If unknown keys are being used, we need to scan older transactions - // for any unspent notes - let (txs, mut tx_iter); - if !unknown_keys.is_empty() { - // Load all transactions accepted until this point - txs = Self::fetch_shielded_transfers(client, None).await?; - tx_iter = txs.iter(); - // Do this by constructing a shielding context only for unknown keys - let mut tx_ctx = Self { - utils: self.utils.clone(), - ..Default::default() - }; - for vk in unknown_keys { - tx_ctx.pos_map.entry(vk).or_insert_with(BTreeSet::new); - } - // Update this unknown shielded context until it is level with self - while tx_ctx.last_indexed != self.last_indexed { - if let Some((indexed_tx, (epoch, tx, stx))) = tx_iter.next() { - tx_ctx.scan_tx(*indexed_tx, *epoch, tx, stx)?; - } else { - break; - } - } - // Merge the context data originating from the unknown keys into the - // current context - self.merge(tx_ctx); - } else { - // Load only transactions accepted from last_txid until this point - txs = Self::fetch_shielded_transfers(client, self.last_indexed) - .await?; - tx_iter = txs.iter(); - } - // Now that we possess the unspent notes corresponding to both old and - // new keys up until tx_pos, proceed to scan the new transactions. - for (indexed_tx, (epoch, tx, stx)) in &mut tx_iter { - self.scan_tx(*indexed_tx, *epoch, tx, stx)?; + self.vk_heights.entry(*vk).or_default(); } + // Save the new keys into the context + let _ = self.save().await; + // the latest block height which has been added to the witness Merkle + // tree + let Some(least_idx) = self.vk_heights.values().min().cloned() else { + return Ok(()); + }; + let last_witnessed_tx = self.tx_note_map.keys().max().cloned(); + // get the bounds on the block heights to fetch + let start_idx = std::cmp::min(last_witnessed_tx, least_idx); + // Maximum number of transactions that can be buffered + const TX_BUFFER_SIZE: usize = 100; + // Make a channel to hold downloaded transactions before they are + // processed + let (tx_sender, tx_receiver) = channel(TX_BUFFER_SIZE); + // Download all transactions accepted until this point + let fetch = Self::fetch_shielded_transfers( + client, + tx_sender, + start_idx, + last_block_height, + ); + // Concurrently process the shielded transactions + let process = + self.process_shielded_transfers(last_witnessed_tx, tx_receiver); + // Wait for both downloading and processing to complete + let _ = try_join!(fetch, process)?; Ok(()) } @@ -680,15 +707,20 @@ impl ShieldedContext { /// transactions from a node. pub async fn fetch_shielded_transfers( client: &C, + mut txs: Sender<(IndexedTx, (Epoch, Transfer, Transaction))>, last_indexed_tx: Option, - ) -> Result, Error> - { + last_block_height: Option, + ) -> Result<(), Error> { // Query for the last produced block height - let last_block_height = query_block(client) - .await? - .map_or_else(BlockHeight::first, |block| block.height); + let last_block_height = + if let Some(last_block_height) = last_block_height { + last_block_height + } else { + query_block(client) + .await? + .map_or_else(BlockHeight::first, |block| block.height) + }; - let mut shielded_txs = BTreeMap::new(); // Fetch all the transactions we do not have yet let first_height_to_query = last_indexed_tx.map_or_else(|| 1, |last| last.height.0); @@ -746,17 +778,22 @@ impl ShieldedContext { .await?; // Collect the current transaction - shielded_txs.insert( + txs.try_send(( IndexedTx { height: height.into(), index: idx, }, (epoch, transfer, masp_transaction), - ); + )) + .map_err(|_| { + Error::Other( + "unable to put transaction into queue".to_string(), + ) + })?; } } - Ok(shielded_txs) + Ok(()) } /// Extract the relevant shield portions of a [`Tx`], if any. @@ -873,81 +910,61 @@ impl ShieldedContext { epoch: Epoch, tx: &Transfer, shielded: &Transaction, + vk: &ViewingKey, ) -> Result<(), Error> { // For tracking the account changes caused by this Transaction let mut transaction_delta = TransactionDelta::new(); + let mut note_pos = self.tx_note_map[&indexed_tx]; // Listen for notes sent to our viewing keys for so in shielded .sapling_bundle() .map_or(&vec![], |x| &x.shielded_outputs) { - // Create merkle tree leaf node from note commitment - let node = Node::new(so.cmu.to_repr()); - // Update each merkle tree in the witness map with the latest - // addition - for (_, witness) in self.witness_map.iter_mut() { - witness.append(node).map_err(|()| { - Error::Other("note commitment tree is full".to_string()) - })?; - } - let note_pos = self.tree.size(); - self.tree.append(node).map_err(|()| { - Error::Other("note commitment tree is full".to_string()) - })?; - // Finally, make it easier to construct merkle paths to this new - // note - let witness = IncrementalWitness::::from_tree(&self.tree); - self.witness_map.insert(note_pos, witness); // Let's try to see if any of our viewing keys can decrypt latest // note - let mut pos_map = HashMap::new(); - std::mem::swap(&mut pos_map, &mut self.pos_map); - for (vk, notes) in pos_map.iter_mut() { - let decres = try_sapling_note_decryption::<_, OutputDescription<<::SaplingAuth as masp_primitives::transaction::components::sapling::Authorization>::Proof>>( - &NETWORK, - 1.into(), - &PreparedIncomingViewingKey::new(&vk.ivk()), - so, + let notes = self.pos_map.entry(*vk).or_default(); + let decres = try_sapling_note_decryption::<_, OutputDescription<<::SaplingAuth as masp_primitives::transaction::components::sapling::Authorization>::Proof>>( + &NETWORK, + 1.into(), + &PreparedIncomingViewingKey::new(&vk.ivk()), + so, + ); + // So this current viewing key does decrypt this current note... + if let Some((note, pa, memo)) = decres { + // Add this note to list of notes decrypted by this viewing + // key + notes.insert(note_pos); + // Compute the nullifier now to quickly recognize when spent + let nf = note.nf( + &vk.nk, + note_pos.try_into().map_err(|_| { + Error::Other("Can not get nullifier".to_string()) + })?, ); - // So this current viewing key does decrypt this current note... - if let Some((note, pa, memo)) = decres { - // Add this note to list of notes decrypted by this viewing - // key - notes.insert(note_pos); - // Compute the nullifier now to quickly recognize when spent - let nf = note.nf( - &vk.nk, - note_pos.try_into().map_err(|_| { - Error::Other("Can not get nullifier".to_string()) - })?, - ); - self.note_map.insert(note_pos, note); - self.memo_map.insert(note_pos, memo); - // The payment address' diversifier is required to spend - // note - self.div_map.insert(note_pos, *pa.diversifier()); - self.nf_map.insert(nf, note_pos); - // Note the account changes - let balance = transaction_delta - .entry(*vk) - .or_insert_with(I128Sum::zero); - *balance += I128Sum::from_nonnegative( - note.asset_type, - note.value as i128, + self.note_map.insert(note_pos, note); + self.memo_map.insert(note_pos, memo); + // The payment address' diversifier is required to spend + // note + self.div_map.insert(note_pos, *pa.diversifier()); + self.nf_map.insert(nf, note_pos); + // Note the account changes + let balance = + transaction_delta.entry(*vk).or_insert_with(I128Sum::zero); + *balance += I128Sum::from_nonnegative( + note.asset_type, + note.value as i128, + ) + .map_err(|()| { + Error::Other( + "found note with invalid value or asset type" + .to_string(), ) - .map_err(|()| { - Error::Other( - "found note with invalid value or asset type" - .to_string(), - ) - })?; - - self.vk_map.insert(note_pos, *vk); - break; - } + })?; + self.vk_map.insert(note_pos, *vk); } - std::mem::swap(&mut pos_map, &mut self.pos_map); + note_pos += 1; } + // Cancel out those of our notes that have been spent for ss in shielded .sapling_bundle() @@ -984,8 +1001,6 @@ impl ShieldedContext { change: -tx.amount.amount().change(), }, ); - self.last_indexed = Some(indexed_tx); - self.delta_map .insert(indexed_tx, (epoch, transfer_delta, transaction_delta)); Ok(()) @@ -1694,18 +1709,11 @@ impl ShieldedContext { } // We want to fund our transaction solely from supplied spending key let spending_key = spending_key.map(|x| x.into()); - let spending_keys: Vec<_> = spending_key.into_iter().collect(); { // Load the current shielded context given the spending key we // possess let mut shielded = context.shielded_mut().await; let _ = shielded.load().await; - shielded - .fetch(context.client(), &spending_keys, &[]) - .await?; - // Save the update state so that future fetches can be - // short-circuited - let _ = shielded.save().await; } // Determine epoch in which to submit potential shielded transaction let epoch = rpc::query_epoch(context.client()).await?; @@ -2140,21 +2148,12 @@ impl ShieldedContext { client: &C, query_owner: &Either>, query_token: &Option
, - viewing_keys: &HashMap, ) -> Result< BTreeMap, Error, > { const TXS_PER_PAGE: u8 = 100; let _ = self.load().await; - let vks = viewing_keys; - let fvks: Vec<_> = vks - .values() - .map(|fvk| ExtendedFullViewingKey::from(*fvk).fvk.vk) - .collect(); - self.fetch(client, &[], &fvks).await?; - // Save the update state so that future fetches can be short-circuited - let _ = self.save().await; // Required for filtering out rejected transactions from Tendermint // responses let block_results = rpc::query_results(client).await?; diff --git a/crates/tests/src/e2e/ibc_tests.rs b/crates/tests/src/e2e/ibc_tests.rs index 4cd825b8c8..4d70109b62 100644 --- a/crates/tests/src/e2e/ibc_tests.rs +++ b/crates/tests/src/e2e/ibc_tests.rs @@ -1297,6 +1297,16 @@ fn shielded_transfer( // Send a token to the shielded address on Chain A transfer_on_chain(test_a, ALBERT, AA_PAYMENT_ADDRESS, BTC, 10, ALBERT_KEY)?; + let rpc = get_actor_rpc(test_a, Who::Validator(0)); + let tx_args = vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + "--node", + &rpc, + ]; + let mut client = run!(test_a, Bin::Client, tx_args, Some(120))?; + client.assert_success(); // Send a token from SP(A) on Chain A to PA(B) on Chain B let amount = Amount::native_whole(10).to_string_native(); @@ -1899,6 +1909,15 @@ fn check_shielded_balances( let token_addr = find_address(test_a, BTC)?.to_string(); std::env::set_var(ENV_VAR_CHAIN_ID, test_b.net.chain_id.to_string()); let rpc_b = get_actor_rpc(test_b, Who::Validator(0)); + let tx_args = vec![ + "shielded-sync", + "--viewing-keys", + AB_VIEWING_KEY, + "--node", + &rpc_b, + ]; + let mut client = run!(test_b, Bin::Client, tx_args, Some(120))?; + client.assert_success(); let ibc_denom = format!("{dest_port_id}/{dest_channel_id}/btc"); let query_args = vec![ "balance", diff --git a/crates/tests/src/e2e/ledger_tests.rs b/crates/tests/src/e2e/ledger_tests.rs index 9c904e095c..48daa1bc71 100644 --- a/crates/tests/src/e2e/ledger_tests.rs +++ b/crates/tests/src/e2e/ledger_tests.rs @@ -739,6 +739,16 @@ fn wrapper_disposable_signer() -> Result<()> { client.exp_string(TX_APPLIED_SUCCESS)?; let _ep1 = epoch_sleep(&test, &validator_one_rpc, 720)?; + let tx_args = vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + "--node", + &validator_one_rpc, + ]; + let mut client = run!(test, Bin::Client, tx_args, Some(120))?; + client.assert_success(); + let tx_args = vec![ "transfer", "--source", @@ -760,6 +770,9 @@ fn wrapper_disposable_signer() -> Result<()> { client.exp_string(TX_ACCEPTED)?; client.exp_string(TX_APPLIED_SUCCESS)?; let _ep1 = epoch_sleep(&test, &validator_one_rpc, 720)?; + let tx_args = vec!["shielded-sync", "--node", &validator_one_rpc]; + let mut client = run!(test, Bin::Client, tx_args, Some(120))?; + client.assert_success(); let tx_args = vec![ "transfer", "--source", diff --git a/crates/tests/src/integration/masp.rs b/crates/tests/src/integration/masp.rs index 3142116a91..fc0a2574c5 100644 --- a/crates/tests/src/integration/masp.rs +++ b/crates/tests/src/integration/masp.rs @@ -54,6 +54,21 @@ fn masp_incentives() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is 1 let captured = CapturedOutput::of(|| { run( @@ -95,6 +110,14 @@ fn masp_incentives() -> Result<()> { // Wait till epoch boundary node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is still 1 let captured = CapturedOutput::of(|| { run( @@ -157,6 +180,14 @@ fn masp_incentives() -> Result<()> { // Wait till epoch boundary node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is still 1 let captured = CapturedOutput::of(|| { run( @@ -239,6 +270,14 @@ fn masp_incentives() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert ETH balance at VK(B) is 0.001 let captured = CapturedOutput::of(|| { run( @@ -280,6 +319,14 @@ fn masp_incentives() -> Result<()> { // Wait till epoch boundary node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert ETH balance at VK(B) is still 0.001 let captured = CapturedOutput::of(|| { run( @@ -364,6 +411,14 @@ fn masp_incentives() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert ETH balance at VK(B) is 0 let captured = CapturedOutput::of(|| { run( @@ -385,6 +440,14 @@ fn masp_incentives() -> Result<()> { node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert VK(B) retains the NAM rewards dispensed in the correct // amount. let captured = CapturedOutput::of(|| { @@ -407,6 +470,14 @@ fn masp_incentives() -> Result<()> { node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert NAM balance at MASP pool is // the accumulation of rewards from the shielded assets (BTC and ETH) let captured = CapturedOutput::of(|| { @@ -452,6 +523,14 @@ fn masp_incentives() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is 0 let captured = CapturedOutput::of(|| { run( @@ -513,6 +592,14 @@ fn masp_incentives() -> Result<()> { // Wait till epoch boundary node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert NAM balance at VK(A) is the rewards dispensed earlier // (since VK(A) has no shielded assets, no further rewards should // be dispensed to that account) @@ -579,6 +666,14 @@ fn masp_incentives() -> Result<()> { // construction node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Send all NAM rewards from SK(B) to Christel run( &node, @@ -604,6 +699,14 @@ fn masp_incentives() -> Result<()> { // Wait till epoch boundary node.next_epoch(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Send all NAM rewards from SK(A) to Bertha run( &node, @@ -626,6 +729,14 @@ fn masp_incentives() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert NAM balance at VK(A) is 0 let captured = CapturedOutput::of(|| { run( @@ -645,6 +756,14 @@ fn masp_incentives() -> Result<()> { assert!(captured.result.is_ok()); assert!(captured.contains("No shielded nam balance found")); + // sync the shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert NAM balance at VK(B) is 0 let captured = CapturedOutput::of(|| { run( @@ -725,6 +844,21 @@ fn spend_unconverted_asset_type() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // 2. Shield the minimum amount node.next_epoch(); run( @@ -746,6 +880,21 @@ fn spend_unconverted_asset_type() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // 3. Sleep for a few epochs for _ in 0..5 { node.next_epoch(); @@ -792,6 +941,21 @@ fn spend_unconverted_asset_type() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + Ok(()) } @@ -812,6 +976,20 @@ fn masp_pinned_txs() -> Result<()> { // Wait till epoch boundary let _ep0 = node.next_epoch(); + // sync shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AC_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // Assert PPA(C) cannot be recognized by incorrect viewing key let captured = CapturedOutput::with_input(AB_VIEWING_KEY.into()).run(|| { @@ -924,6 +1102,14 @@ fn masp_pinned_txs() -> Result<()> { // Wait till epoch boundary let _ep1 = node.next_epoch(); + // sync shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // Assert PPA(C) does not NAM pinned to it on epoch boundary let captured = CapturedOutput::with_input(AC_VIEWING_KEY.into()).run(|| { @@ -978,6 +1164,22 @@ fn masp_txs_and_queries() -> Result<()> { let (mut node, _services) = setup::setup()?; _ = node.next_epoch(); + + // add necessary viewing keys to shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + let txs_args = vec![ // 0. Attempt to spend 10 BTC at SK(A) to PA(B) ( @@ -1188,6 +1390,20 @@ fn masp_txs_and_queries() -> Result<()> { ]; for (tx_args, tx_result) in &txs_args { + // sync shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); // We ensure transfers don't cross epoch boundaries. if tx_args[0] == "transfer" { node.next_epoch(); @@ -1304,6 +1520,21 @@ fn wrapper_fee_unshielding() -> Result<()> { node.assert_success(); _ = node.next_epoch(); + // sync shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // 2. Valid unshielding run( &node, @@ -1328,6 +1559,14 @@ fn wrapper_fee_unshielding() -> Result<()> { )?; node.assert_success(); + // sync shielded context + run( + &node, + Bin::Client, + vec!["shielded-sync", "--node", validator_one_rpc], + )?; + node.assert_success(); + // 3. Invalid unshielding let tx_args = vec![ "transfer", @@ -1393,6 +1632,20 @@ fn cross_epoch_tx() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // 2. Generate the tx in the current epoch let tempdir = tempfile::tempdir().unwrap(); run( @@ -1493,6 +1746,21 @@ fn dynamic_assets() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is 1 let captured = CapturedOutput::of(|| { run( @@ -1603,6 +1871,21 @@ fn dynamic_assets() -> Result<()> { )?; node.assert_success(); + // sync the shielded context + run( + &node, + Bin::Client, + vec![ + "shielded-sync", + "--viewing-keys", + AA_VIEWING_KEY, + AB_VIEWING_KEY, + "--node", + validator_one_rpc, + ], + )?; + node.assert_success(); + // Assert BTC balance at VK(A) is now 2 let captured = CapturedOutput::of(|| { run( diff --git a/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin b/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin index 95f2016509..5fd246bed0 100644 Binary files a/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin and b/test_fixtures/masp_proofs/2AB777063F53A1E6F66DB635DD9C0FD9A4E019CE37AABDC5D0E4B738FE06034B.bin differ diff --git a/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin b/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin index 47fbaf511d..928780e081 100644 Binary files a/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin and b/test_fixtures/masp_proofs/3D341FB56C981978B133B97C78AD69BADBF03C1209B79D0B30310AAF54AE2E0F.bin differ diff --git a/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin b/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin index 08cf80e550..e755bb365e 100644 Binary files a/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin and b/test_fixtures/masp_proofs/5DE7FF931D7864F0C05FD54926AA6B8D85E10E17ED9D098B9C6B8C6795B1E0F3.bin differ diff --git a/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin b/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin index 6b8904c64f..e2b6c5b4ea 100644 Binary files a/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin and b/test_fixtures/masp_proofs/693468170864DF8C1A8C13FE2C2A3AC62CC602036F676E17820AD9CDD04DB3F5.bin differ diff --git a/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin b/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin index a7061642ee..2fa21a2cdc 100644 Binary files a/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin and b/test_fixtures/masp_proofs/7198F6516381EEB67048E3099D21C4A7EB97EAC95F77B0410D41305EEF3C766F.bin differ diff --git a/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin b/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin index e26ca530b8..03aa0159f2 100644 Binary files a/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin and b/test_fixtures/masp_proofs/7B6C8C638FEE08497ACAEB06BFDF787F70D27FE1DE4CEFD4756B6753AB603FCF.bin differ diff --git a/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin b/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin index cacde020e4..8cac916954 100644 Binary files a/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin and b/test_fixtures/masp_proofs/88A112BD9BC6B27E68B6E541AC031CFBE96239D20FAA4BF6B3B2E919051AB057.bin differ diff --git a/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin b/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin index 0082545ab0..0e72610016 100644 Binary files a/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin and b/test_fixtures/masp_proofs/8B94059FF27C60538BB03C2910486615DC41E596D8CB73623D07DC82D3FFF2EA.bin differ diff --git a/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin b/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin index 7f38d847de..988eb94e35 100644 Binary files a/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin and b/test_fixtures/masp_proofs/9EBED7C98F42F20A130BD5BDC663A28A2C6CC11819436D9E69C068BA72B243CD.bin differ diff --git a/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin b/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin index 9d77c2aedb..ab64d43233 100644 Binary files a/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin and b/test_fixtures/masp_proofs/B567888C3648734D5E9E7ACDFFBE93280B672D1D493E42B3C4DC93B6A7A37720.bin differ diff --git a/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin b/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin index 912f1a275d..30b622be46 100644 Binary files a/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin and b/test_fixtures/masp_proofs/B7C738AE39C44060FD6EA5D7C648447BC02F4A27D5ECAEE75DD468D66DE97346.bin differ diff --git a/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin b/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin index 7675d3a6a8..51f68528d4 100644 Binary files a/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin and b/test_fixtures/masp_proofs/B856DFD59A7800AD0CDB4FA1E3AFE8F8230DD7B77B9835B7067C6585B2134FDF.bin differ diff --git a/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin b/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin index 8573827147..155287509e 100644 Binary files a/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin and b/test_fixtures/masp_proofs/B88A2DB72E3A0A624B9076C5A707ECEFBCDCC2ABB01BC7956857DFF45C81123C.bin differ diff --git a/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin b/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin index 31a0377760..e572c3e4f0 100644 Binary files a/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin and b/test_fixtures/masp_proofs/BDC0D41E9A223E4A1F939974183E15E24E4F7D257607672C776B38403E74FFF1.bin differ diff --git a/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin b/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin index e50d2b0895..31a1bd0816 100644 Binary files a/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin and b/test_fixtures/masp_proofs/C83BAD95A33CB66390611EF8155852DCD946FCC03040DF7A58FDA0B6CC4919AA.bin differ diff --git a/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin b/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin index 93832d8f31..cedce218c3 100644 Binary files a/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin and b/test_fixtures/masp_proofs/C9D7CDFED7CB968E7743BE392EC387A0A9919A436A15C6DEC3834051B7CC7993.bin differ diff --git a/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin b/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin index cc07075be1..521d9a560e 100644 Binary files a/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin and b/test_fixtures/masp_proofs/CA9143A071C194759B72139C6B926C88FA3742B7F3A45DC0E1227236BC835003.bin differ diff --git a/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin b/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin index 6bcb3823be..1a4531f734 100644 Binary files a/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin and b/test_fixtures/masp_proofs/CC30B6AC45FBCDA88285D28AF71560B2C9D30A84AB6D74E5A27A267409A8F5EE.bin differ diff --git a/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin b/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin index 3ad1b783d7..9ba262b0f3 100644 Binary files a/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin and b/test_fixtures/masp_proofs/D5A372904527694939249FA0AAFBE1500FF70DC4F2365C83D9BB9015D3C28CE1.bin differ diff --git a/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin b/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin index aba2dfd24f..d39344547d 100644 Binary files a/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin and b/test_fixtures/masp_proofs/DBE07FDEDBF79BBC814D3EB70E5A0AD04432D0D4BB8B2488EA5E836837B00394.bin differ diff --git a/wasm/checksums.json b/wasm/checksums.json index 3ba0045fc2..3dc29fe06e 100644 --- a/wasm/checksums.json +++ b/wasm/checksums.json @@ -1,26 +1,26 @@ { - "tx_become_validator.wasm": "tx_become_validator.96206677d3f4981ea77e5890b3a31b3fb78571517045c8f8b521838f2a60f94d.wasm", - "tx_bond.wasm": "tx_bond.1b510c093b855ffc077dfb224f2fea73ce2ff782bac45516c8d08b3e34e2b816.wasm", - "tx_bridge_pool.wasm": "tx_bridge_pool.580edd0a68dd1a2d335240bca93ea0e16352301d25afd3645cd1eeff281e8627.wasm", - "tx_change_consensus_key.wasm": "tx_change_consensus_key.25a8ad63a2745c35484f7fbdef040115b221e2bc24af978ee825cf70872ba711.wasm", - "tx_change_validator_commission.wasm": "tx_change_validator_commission.69679496e6a8449c77541ff86ef148edb9b1d201133b36e4cb308baa92ad83df.wasm", - "tx_change_validator_metadata.wasm": "tx_change_validator_metadata.6c1b4bbe00221bc4e89a6e2aec6c208501f9f3f1cb01154c58cffe4ce4f376fa.wasm", - "tx_claim_rewards.wasm": "tx_claim_rewards.08b839f07a871863d192f0ee3ce7f15e44a557e140d5527dc08051e6aef9a5ec.wasm", - "tx_deactivate_validator.wasm": "tx_deactivate_validator.895e6fd89adbab6e73a809d55e296484c19edc04233f16a6635fd596bcac4762.wasm", - "tx_ibc.wasm": "tx_ibc.65e415ecfabf09da3afb50b92be9c839fcf2705cb2bd82e53df7eb41da5bc949.wasm", - "tx_init_account.wasm": "tx_init_account.17f890950782fde8ea3183cb3e39d1e426819e91d0f678b3af12948c9323fdc4.wasm", - "tx_init_proposal.wasm": "tx_init_proposal.e642d5525b492b6939c7714280775af91c45e2719821910ba5c5327fa8461024.wasm", - "tx_reactivate_validator.wasm": "tx_reactivate_validator.98604c5832b72e9370accb907fd36545f88ffc8e3fcaafd19de9d5bdd632dff5.wasm", - "tx_redelegate.wasm": "tx_redelegate.51ac42c2da56d841c466e832dfd707eb449d466082489b370555ec3fcf845fad.wasm", - "tx_resign_steward.wasm": "tx_resign_steward.dd3d8008b56790c2cec54d41da1d259f6673de08f17f19e5033beac1e9275b9a.wasm", - "tx_reveal_pk.wasm": "tx_reveal_pk.53e48fcfd713cbdc913103168f25626507d2193f0741761262998065f79b4c6b.wasm", - "tx_transfer.wasm": "tx_transfer.ae853b54c3fd47be75be26bb38a0f8e0ded30ffe75ef1f127635d3fb1f23144c.wasm", - "tx_unbond.wasm": "tx_unbond.fbce974b80c412b7cebed4072525c2a7f3392273c158e4d5bf6aa068a5f6a6f6.wasm", - "tx_unjail_validator.wasm": "tx_unjail_validator.926c40dffcf960ddbc43253a22b3495dddbdfe304d547abfa8958c5096814bc3.wasm", - "tx_update_account.wasm": "tx_update_account.0810a963405dacab4a31606c5605280b1e6ec0bcabb1cb93869fcf93b6d85a8e.wasm", - "tx_update_steward_commission.wasm": "tx_update_steward_commission.34750dbe0dfe126205d8d852682808684198aebcf754d24c124e8d600a94b43d.wasm", - "tx_vote_proposal.wasm": "tx_vote_proposal.85b27a7cd04890919303e10c023b0e42a1d3165fc6ef9df65885cc2e98396754.wasm", - "tx_withdraw.wasm": "tx_withdraw.02ed362835c0cd9e58b36ca8b40f3935fb92b0b81ff9cb329835743be079a04a.wasm", - "vp_implicit.wasm": "vp_implicit.6aa1b7996381475ea003b4d6c7303a6cb29444cf73fc0c396915de1688d911d2.wasm", - "vp_user.wasm": "vp_user.c6d32da09a50bd42e7e9094821478d0dc795cdccd6cdc18ce2ad4fe8d7bfde50.wasm" + "tx_become_validator.wasm": "tx_become_validator.c17ba493fd368a821c32bdd89b5d375cbe61d64421f6fc0b7bb6897bc3fed5a1.wasm", + "tx_bond.wasm": "tx_bond.67b39436be0fe15771fc2f068ebe07fde480b91d3b71988ba73e8b6f9f7a4dd9.wasm", + "tx_bridge_pool.wasm": "tx_bridge_pool.3d023a7c4d08482037e1cf45f7a5fc97b9fa95594763e5eb5f4bfeec1294ca83.wasm", + "tx_change_consensus_key.wasm": "tx_change_consensus_key.9b3e64413bd565bdba259d3df2b922e166e03aad3642ee850abe6a941b86ba2b.wasm", + "tx_change_validator_commission.wasm": "tx_change_validator_commission.fdb9ee284a3fbaa39cac6c92675c33c82ff4881157490bd28d3605c5eb1df03c.wasm", + "tx_change_validator_metadata.wasm": "tx_change_validator_metadata.1a859ae059006b3a293aa9b70fe246444654d992ceea31b82a1de1a2919db91f.wasm", + "tx_claim_rewards.wasm": "tx_claim_rewards.6832e595d34391e494b337a30045a6299a354fc2354ff74cd1c45ef5c128ecce.wasm", + "tx_deactivate_validator.wasm": "tx_deactivate_validator.cfc731653eff82a1ed3f860f3d708723ca7ff7123c0d0bde1e9132b2fa51cb2b.wasm", + "tx_ibc.wasm": "tx_ibc.33dfe6d9814542f86a9f521a3cfaba2a2e4455872bc13c23967da20ab7957134.wasm", + "tx_init_account.wasm": "tx_init_account.9ec3d1dbed214301fbedb726d31cebbfe2bb4a180fde59902b98495394d1d37d.wasm", + "tx_init_proposal.wasm": "tx_init_proposal.656a58500838a2d6b65ab5f8377b3039e9eadf997b291dac0eaf30e526059e72.wasm", + "tx_reactivate_validator.wasm": "tx_reactivate_validator.cbbee1559428964c1365b10c30291d34268c6c7c629c3c7a59e30e91916f2e8e.wasm", + "tx_redelegate.wasm": "tx_redelegate.fffd706d4aa808e9aafb38a62637441d785f4bfbfc8e349c60e55b1b40657119.wasm", + "tx_resign_steward.wasm": "tx_resign_steward.b5be6108e7efcf8b249f98d4fb12a73ad7b9decd8c0113ea7c7bad5dd45925a2.wasm", + "tx_reveal_pk.wasm": "tx_reveal_pk.eecd9cfc63e0fc69d2e63fb27552546b7aa707339ea57c0bf7ced78e23eb88fc.wasm", + "tx_transfer.wasm": "tx_transfer.20372d985f398f1e4fc40d9bce19cfeac8e7a6120e32eca73244807ff29402a0.wasm", + "tx_unbond.wasm": "tx_unbond.c58aac944a2801759834dafdb14a01ce0e009cff06c2fc0badb79751435c83ad.wasm", + "tx_unjail_validator.wasm": "tx_unjail_validator.f262d534599c5a55f9b2da9e073a1778525042a077104e5444634ad5a98d8ce6.wasm", + "tx_update_account.wasm": "tx_update_account.a26649945e1b4808f8fa4f9832440bd1846f9753b5f5b445871f4ae2e299da84.wasm", + "tx_update_steward_commission.wasm": "tx_update_steward_commission.d80bf614055e48297e56643359584ed44371a35e0d16a2a8fa8dc3b15d5b19ec.wasm", + "tx_vote_proposal.wasm": "tx_vote_proposal.39f0c35b24a1871bffaa2f138ec4cfe7d9e5f3f9272e54a69a1f24c8fe59caad.wasm", + "tx_withdraw.wasm": "tx_withdraw.af4abfe003657eca1f0954b5a9691e7785da06bf0605204be7a00acb51a43606.wasm", + "vp_implicit.wasm": "vp_implicit.65ce9664b0e8f168c445f70b7c2440276933a8aba9ef4584b59f8bcf44297944.wasm", + "vp_user.wasm": "vp_user.2480e57372b643eb1cd61ee16a653e11cd7072181d36517180e171bb50ce0e1c.wasm" } \ No newline at end of file diff --git a/wasm_for_tests/tx_fail.wasm b/wasm_for_tests/tx_fail.wasm index 40a75f22df..998bd2af89 100755 Binary files a/wasm_for_tests/tx_fail.wasm and b/wasm_for_tests/tx_fail.wasm differ diff --git a/wasm_for_tests/tx_memory_limit.wasm b/wasm_for_tests/tx_memory_limit.wasm index 6af76d004b..60e1b55bf6 100755 Binary files a/wasm_for_tests/tx_memory_limit.wasm and b/wasm_for_tests/tx_memory_limit.wasm differ diff --git a/wasm_for_tests/tx_mint_tokens.wasm b/wasm_for_tests/tx_mint_tokens.wasm index e79d206dfd..761e1a14e9 100755 Binary files a/wasm_for_tests/tx_mint_tokens.wasm and b/wasm_for_tests/tx_mint_tokens.wasm differ diff --git a/wasm_for_tests/tx_no_op.wasm b/wasm_for_tests/tx_no_op.wasm index 618519c129..1c96b4f643 100755 Binary files a/wasm_for_tests/tx_no_op.wasm and b/wasm_for_tests/tx_no_op.wasm differ diff --git a/wasm_for_tests/tx_proposal_code.wasm b/wasm_for_tests/tx_proposal_code.wasm index f7ff052eb9..3f32132601 100755 Binary files a/wasm_for_tests/tx_proposal_code.wasm and b/wasm_for_tests/tx_proposal_code.wasm differ diff --git a/wasm_for_tests/tx_proposal_masp_reward.wasm b/wasm_for_tests/tx_proposal_masp_reward.wasm index 36074e434d..0dfe6142f7 100755 Binary files a/wasm_for_tests/tx_proposal_masp_reward.wasm and b/wasm_for_tests/tx_proposal_masp_reward.wasm differ diff --git a/wasm_for_tests/tx_read_storage_key.wasm b/wasm_for_tests/tx_read_storage_key.wasm index 2833fe88ad..fc6c2e204a 100755 Binary files a/wasm_for_tests/tx_read_storage_key.wasm and b/wasm_for_tests/tx_read_storage_key.wasm differ diff --git a/wasm_for_tests/tx_write.wasm b/wasm_for_tests/tx_write.wasm index b766c92edb..bc9559cfe7 100755 Binary files a/wasm_for_tests/tx_write.wasm and b/wasm_for_tests/tx_write.wasm differ diff --git a/wasm_for_tests/tx_write_storage_key.wasm b/wasm_for_tests/tx_write_storage_key.wasm index 902d297af7..2f6e3946b4 100755 Binary files a/wasm_for_tests/tx_write_storage_key.wasm and b/wasm_for_tests/tx_write_storage_key.wasm differ diff --git a/wasm_for_tests/vp_always_false.wasm b/wasm_for_tests/vp_always_false.wasm index 2b93b7e279..edeafd44f3 100755 Binary files a/wasm_for_tests/vp_always_false.wasm and b/wasm_for_tests/vp_always_false.wasm differ diff --git a/wasm_for_tests/vp_always_true.wasm b/wasm_for_tests/vp_always_true.wasm index 42c8f10318..f1ca0db3da 100755 Binary files a/wasm_for_tests/vp_always_true.wasm and b/wasm_for_tests/vp_always_true.wasm differ diff --git a/wasm_for_tests/vp_eval.wasm b/wasm_for_tests/vp_eval.wasm index 06cf9fdf11..daf4a60192 100755 Binary files a/wasm_for_tests/vp_eval.wasm and b/wasm_for_tests/vp_eval.wasm differ diff --git a/wasm_for_tests/vp_memory_limit.wasm b/wasm_for_tests/vp_memory_limit.wasm index 11d4bda266..932de0e7a4 100755 Binary files a/wasm_for_tests/vp_memory_limit.wasm and b/wasm_for_tests/vp_memory_limit.wasm differ diff --git a/wasm_for_tests/vp_read_storage_key.wasm b/wasm_for_tests/vp_read_storage_key.wasm index 5fd3a9152b..eeaf33029e 100755 Binary files a/wasm_for_tests/vp_read_storage_key.wasm and b/wasm_for_tests/vp_read_storage_key.wasm differ