Skip to content

Commit

Permalink
core: Move bytecode verification to dusk-vm
Browse files Browse the repository at this point in the history
This removes the `blake3` dep to `dusk-vm` as well, minimizing our
contract sizes.
  • Loading branch information
moCello committed Dec 22, 2024
1 parent a7bea6d commit c38dcd5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rkyv = { workspace = true, features = ["size_32"] }
bytecheck = { workspace = true }
rand = { workspace = true }
ff = { workspace = true }
blake3 = { workspace = true }

# plonk dependencies
dusk-plonk = { workspace = true, features = ["rkyv-impl", "alloc"], optional = true }
Expand Down
8 changes: 0 additions & 8 deletions core/src/transfer/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ impl ContractBytecode {
self.hash.to_vec()
}

/// Verifies that the stored bytes-hash is correct.
#[must_use]
pub fn verify_hash(&self) -> bool {
let computed: [u8; 32] = blake3::hash(self.bytes.as_slice()).into();

self.hash == computed
}

/// Serializes this object into a variable length buffer
#[must_use]
pub fn to_var_bytes(&self) -> Vec<u8> {
Expand Down

0 comments on commit c38dcd5

Please sign in to comment.