From 5c60cd98f08fa04bac89f17084263b7d60276a6b Mon Sep 17 00:00:00 2001 From: Daniel Cogan Date: Tue, 13 Feb 2024 15:21:36 -0800 Subject: [PATCH] Upgrade fish hash to include audit changes (#4722) --- Cargo.lock | 4 ++-- ironfish-rust-nodejs/Cargo.toml | 2 +- ironfish-rust-nodejs/src/fish_hash.rs | 2 +- ironfish-rust/Cargo.toml | 2 +- ironfish-rust/src/mining/mine.rs | 2 +- ironfish-rust/src/mining/thread.rs | 5 ++++- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74d31bed91..50bf065cea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1029,9 +1029,9 @@ checksum = "93ace6ec7cc19c8ed33a32eaa9ea692d7faea05006b5356b9e2b668ec4bc3955" [[package]] name = "fish_hash" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9577244a17c8bd562cbfd4b86dead29d8b3f6cb779d1f7be4bc8a2c9b62028dc" +checksum = "6cea268879491ea825e57d07604f4080d26acfee3c603077ea3ac1e5ea034313" dependencies = [ "blake3", "tiny-keccak", diff --git a/ironfish-rust-nodejs/Cargo.toml b/ironfish-rust-nodejs/Cargo.toml index 11417cbcb9..ceb9799207 100644 --- a/ironfish-rust-nodejs/Cargo.toml +++ b/ironfish-rust-nodejs/Cargo.toml @@ -27,7 +27,7 @@ crate-type = ["cdylib"] [dependencies] base64 = "0.13.0" -fish_hash = "0.1.0" +fish_hash = "0.3.0" ironfish = { path = "../ironfish-rust" } ironfish_mpc = { path = "../ironfish-mpc" } napi = { version = "2.13.2", features = ["napi6"] } diff --git a/ironfish-rust-nodejs/src/fish_hash.rs b/ironfish-rust-nodejs/src/fish_hash.rs index bf6c882a6b..9dfca8544d 100644 --- a/ironfish-rust-nodejs/src/fish_hash.rs +++ b/ironfish-rust-nodejs/src/fish_hash.rs @@ -16,7 +16,7 @@ impl FishHashContext { #[napi(constructor)] pub fn new(full: bool) -> Self { Self { - inner: Context::new(full), + inner: Context::new(full, None), } } diff --git a/ironfish-rust/Cargo.toml b/ironfish-rust/Cargo.toml index c57aea243e..5795c19f2d 100644 --- a/ironfish-rust/Cargo.toml +++ b/ironfish-rust/Cargo.toml @@ -43,7 +43,7 @@ crypto_box = { version = "0.8", features = ["std"] } ff = "0.12.0" group = "0.12.0" ironfish-frost = { git = "https://github.com/iron-fish/ironfish-frost.git", branch = "main" } -fish_hash = "0.1.0" +fish_hash = "0.3.0" ironfish_zkp = { version = "0.2.0", path = "../ironfish-zkp" } jubjub = { git = "https://github.com/iron-fish/jubjub.git", branch = "blstrs" } lazy_static = "1.4.0" diff --git a/ironfish-rust/src/mining/mine.rs b/ironfish-rust/src/mining/mine.rs index 4b7a308ecf..5ac9dc371f 100644 --- a/ironfish-rust/src/mining/mine.rs +++ b/ironfish-rust/src/mining/mine.rs @@ -116,7 +116,7 @@ mod test { let start = 43; let step_size = 1; - let context = &mut fish_hash::Context::new(false); + let context = &mut fish_hash::Context::new(false, None); // Hardcoded target value derived from a randomness of 45, which is lower than 42 // This allows us to test the looping and target comparison a little better diff --git a/ironfish-rust/src/mining/thread.rs b/ironfish-rust/src/mining/thread.rs index 3dd6913823..5c7ee2f5ab 100644 --- a/ironfish-rust/src/mining/thread.rs +++ b/ironfish-rust/src/mining/thread.rs @@ -47,7 +47,10 @@ impl Thread { .name(id.to_string()) .spawn(move || { let mut fish_hash_context = if fish_hash_options.enabled { - Some(fish_hash::Context::new(fish_hash_options.full_context)) + Some(fish_hash::Context::new( + fish_hash_options.full_context, + None, + )) } else { None };