Skip to content

Commit

Permalink
Merge pull request #1439 from nuttycom/fix_shardtree_root_insertion
Browse files Browse the repository at this point in the history
zcash_client_backend: Fix panic related to insertion of frontiers below subtree roots.
  • Loading branch information
nuttycom authored Jun 30, 2024
2 parents 5bd911f + cd7ca2c commit 34cf6d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,5 @@ panic = 'abort'
codegen-units = 1

[patch.crates-io]
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "8b4b1315d64d171bcf701e5de59d0707dc029f9c" }
shardtree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "8b4b1315d64d171bcf701e5de59d0707dc029f9c" }
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "337f59179eda51261e9ddfc6b18e8fb84ea277c9" }
shardtree = { git = "https://github.com/zcash/incrementalmerkletree", rev = "337f59179eda51261e9ddfc6b18e8fb84ea277c9" }
6 changes: 0 additions & 6 deletions zcash_client_backend/src/serialization/shardtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const SER_V1: u8 = 1;
const NIL_TAG: u8 = 0;
const LEAF_TAG: u8 = 1;
const PARENT_TAG: u8 = 2;
const PRUNED_TAG: u8 = 3;

/// Writes a [`PrunableTree`] to the provided [`Write`] instance.
///
Expand Down Expand Up @@ -44,10 +43,6 @@ pub fn write_shard<H: HashSer, W: Write>(writer: &mut W, tree: &PrunableTree<H>)
writer.write_u8(NIL_TAG)?;
Ok(())
}
Node::Pruned => {
writer.write_u8(PRUNED_TAG)?;
Ok(())
}
}
}

Expand Down Expand Up @@ -79,7 +74,6 @@ fn read_shard_v1<H: HashSer, R: Read>(mut reader: &mut R) -> io::Result<Prunable
Ok(Tree::leaf((value, flags)))
}
NIL_TAG => Ok(Tree::empty()),
PRUNED_TAG => Ok(Tree::empty_pruned()),
other => Err(io::Error::new(
io::ErrorKind::InvalidData,
format!("Node tag not recognized: {}", other),
Expand Down

0 comments on commit 34cf6d2

Please sign in to comment.