Skip to content

Commit

Permalink
chore(deps)!: Upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Jan 13, 2025
1 parent a4a5617 commit f63295c
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion tasm-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
strum = { version = "0.26", features = ["derive"] }
tasm-object-derive.workspace = true
triton-vm = { version = "0.44.1", default-features = false }
triton-vm = { version = "0.45.0", default-features = false }

[dev-dependencies.cargo-husky]
version = "1"
Expand Down
3 changes: 1 addition & 2 deletions tasm-lib/src/hashing/merkle_root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ impl BasicSnippet for MerkleRoot {
#[cfg(test)]
mod tests {
use num_traits::Zero;
use twenty_first::util_types::merkle_tree::CpuParallel;
use twenty_first::util_types::merkle_tree::MerkleTree;

use super::*;
Expand Down Expand Up @@ -213,7 +212,7 @@ mod tests {
) {
let leafs_pointer = stack.pop().unwrap();
let leafs = *Vec::<Digest>::decode_from_memory(memory, leafs_pointer).unwrap();
let mt = MerkleTree::new::<CpuParallel>(&leafs).unwrap();
let mt = MerkleTree::par_new(&leafs).unwrap();

// Write entire Merkle tree to memory, because that's what the VM does
let pointer = dynamic_allocator(memory);
Expand Down
11 changes: 2 additions & 9 deletions tasm-lib/src/hashing/merkle_root_from_xfes_generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ impl BasicSnippet for MerkleRootFromXfesGeneric {
#[cfg(test)]
mod tests {
use num::One;
use twenty_first::prelude::MerkleTreeMaker;
use twenty_first::util_types::merkle_tree::CpuParallel;
use twenty_first::util_types::merkle_tree::MerkleTree;

use super::*;
Expand All @@ -201,8 +199,7 @@ mod tests {
);
let leafs: Vec<Digest> = leafs.into_iter().map(|x| x.into()).collect();

let mt: MerkleTree = CpuParallel::from_digests(&leafs).unwrap();
let root = mt.root();
let mt = MerkleTree::par_new(&leafs).unwrap();

// Write entire Merkle tree to memory, because that's what the VM does
let digests_in_layer_one = dynamic_allocator(memory);
Expand All @@ -228,11 +225,7 @@ mod tests {
}
}

stack.push(root.0[4]);
stack.push(root.0[3]);
stack.push(root.0[2]);
stack.push(root.0[1]);
stack.push(root.0[0]);
stack.extend(mt.root().reversed().values());
}

fn pseudorandom_initial_state(
Expand Down
2 changes: 1 addition & 1 deletion tasm-lib/src/hashing/merkle_root_from_xfes_static_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ mod tests {
let xfes_pointer = stack.pop().unwrap();
let xfes = array_from_memory::<XFieldElement>(xfes_pointer, self.num_leaves(), memory);
let as_digests: Vec<Digest> = xfes.into_iter().map(|x| x.into()).collect_vec();
let mt = MerkleTree::new::<CpuParallel>(&as_digests).unwrap();
let mt = MerkleTree::par_new(&as_digests).unwrap();

let num_not_leaf_nodes = self.num_leaves() as u32;

Expand Down
2 changes: 1 addition & 1 deletion tasm-lib/src/hashing/merkle_root_from_xfes_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ mod tests {
"This algorithm currently can currently only handle lengths of 256, 512, and 1024."
);
let as_digests: Vec<Digest> = xfes.into_iter().map(|x| x.into()).collect_vec();
let mt = MerkleTree::new::<CpuParallel>(&as_digests).unwrap();
let mt = MerkleTree::par_new(&as_digests).unwrap();
let num_not_leaf_nodes = xfes_len as u32;

// Modify statically allocated memory as the above snippet does.
Expand Down
2 changes: 1 addition & 1 deletion tasm-lib/src/hashing/merkle_root_static_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ mod tests {
let leafs_pointer =
self.nodes_pointer + bfe!(self.num_leaves() as u32) * bfe!(Digest::LEN as u32);
let leafs = array_from_memory::<Digest>(leafs_pointer, self.num_leaves(), memory);
let mt = MerkleTree::new::<CpuParallel>(&leafs).unwrap();
let mt = MerkleTree::par_new(&leafs).unwrap();

let num_not_leaf_nodes = self.num_leaves() as u32;

Expand Down
4 changes: 1 addition & 3 deletions tasm-lib/src/verifier/fri/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ use twenty_first::math::polynomial::barycentric_evaluate;
use twenty_first::math::polynomial::Polynomial;
use twenty_first::math::traits::ModPowU32;
use twenty_first::math::x_field_element::EXTENSION_DEGREE;
use twenty_first::prelude::MerkleTreeMaker;
use twenty_first::util_types::merkle_tree::CpuParallel;
use twenty_first::util_types::merkle_tree::MerkleTree;
use twenty_first::util_types::merkle_tree::MerkleTreeInclusionProof;

Expand Down Expand Up @@ -954,7 +952,7 @@ impl FriVerify {

// Check if last codeword matches the given root
let codeword_digests = Self::map_convert_xfe_to_digest(&last_codeword);
let mt: MerkleTree = CpuParallel::from_digests(&codeword_digests).unwrap();
let mt: MerkleTree = MerkleTree::par_new(&codeword_digests).unwrap();
let last_codeword_merkle_root = mt.root();

let last_root = roots.last().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mod tests {
.collect_vec();
let leafs_as_digest: Vec<Digest> =
xfe_leafs.iter().map(|&xfe| xfe.into()).collect_vec();
let tree = MerkleTree::new::<CpuParallel>(&leafs_as_digest).unwrap();
let tree = MerkleTree::par_new(&leafs_as_digest).unwrap();
let root = tree.root();

let a_indices = (0..num_indices)
Expand Down
2 changes: 1 addition & 1 deletion tasm-lib/src/verifier/master_table/verify_table_rows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ mod tests {
leafs[*leaf_index] = Tip5::hash_varlen(leaf_preimage);
}

let merkle_tree: MerkleTree = CpuParallel::from_digests(&leafs).unwrap();
let merkle_tree = MerkleTree::par_new(&leafs).unwrap();
let merkle_root = merkle_tree.root();
let merkle_root_pointer: BFieldElement = rng.gen();
encode_to_memory(&mut memory, merkle_root_pointer, &merkle_root);
Expand Down

0 comments on commit f63295c

Please sign in to comment.