Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ codegen-units = 1
# lto = true
panic = "abort"

[profile.test]
# required to avoid a long running process of librustcash additional chain validation that is enabled with debug assertions
debug-assertions = false

[profile.dev]
opt-level = 0
debug = 1
Expand All @@ -74,4 +70,4 @@ incremental = true
codegen-units = 256

[profile.release.package.mocktopus]
opt-level = 1 # TODO: MIR fails on optimizing this dependency, remove that..
opt-level = 1 # TODO: MIR fails on optimizing this dependency, remove that..
23 changes: 2 additions & 21 deletions mm2src/coins/z_coin/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,27 +157,8 @@ pub async fn scan_cached_block(
)
};

// Enforce that all roots match. This is slow, so only include in debug builds.
#[cfg(debug_assertions)]
{
let cur_root = tree.root();
if witnesses.iter().any(|row| row.1.root() != cur_root) {
return Err(Error::InvalidWitnessAnchor(row.0, current_height).into());
}
for tx in &txs {
for output in tx.shielded_outputs.iter() {
if output.witness.root() != cur_root {
return Err(Error::InvalidNewWitnessAnchor(
output.index,
tx.txid,
current_height,
output.witness.root(),
)
.into());
}
}
}
}
// To enforce that all roots match,
// see -> https://github.com/KomodoPlatform/librustzcash/blob/e92443a7bbd1c5e92e00e6deb45b5a33af14cea4/zcash_client_backend/src/data_api/chain.rs#L304-L326

let new_witnesses = data_guard
.advance_by_block(
Expand Down