Skip to content

Commit 9d89b50

Browse files
authored
Merge pull request #470 from QED-it/compatible_with_zsa_halo2
Update for compatibility with latest halo2 version (ZSA features)
2 parents fcb14de + 29fbe53 commit 9d89b50

File tree

5 files changed

+46
-18
lines changed

5 files changed

+46
-18
lines changed

Cargo.lock

Lines changed: 22 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ hex = { version = "0.4", default-features = false, features = ["alloc"] }
3333
lazy_static = "1"
3434
memuse = { version = "0.2.2", default-features = false }
3535
pasta_curves = "0.5"
36-
proptest = { version = "1.0.0", optional = true }
36+
proptest = { version = ">=1.0.0, <1.7.0", optional = true }
3737
rand = { version = "0.8", default-features = false }
38+
rand_core = { version = "0.6", default-features = false }
3839
reddsa = { version = "0.5", default-features = false }
3940
nonempty = { version = "0.11", default-features = false }
4041
poseidon = { package = "halo2_poseidon", version = "0.1" }
@@ -68,7 +69,7 @@ plotters = { version = "0.3.0", optional = true }
6869
criterion = "0.4" # 0.5 depends on clap 4 which has MSRV 1.70
6970
halo2_gadgets = { version = "0.3", features = ["test-dependencies"] }
7071
hex = "0.4"
71-
proptest = "1.0.0"
72+
proptest = ">=1.0.0, <1.7.0"
7273
zcash_note_encryption = { version = "0.4", features = ["pre-zip-212"] }
7374
incrementalmerkletree = { version = "0.8.1", features = ["test-dependencies"] }
7475
shardtree = "0.6"
@@ -106,3 +107,7 @@ debug = true
106107

107108
[profile.bench]
108109
debug = true
110+
111+
[patch.crates-io]
112+
halo2_gadgets = { git = "https://github.com/zcash/halo2", rev = "2308caf68c48c02468b66cfc452dad54e355e32f" }
113+
halo2_proofs = { git = "https://github.com/zcash/halo2", rev = "2308caf68c48c02468b66cfc452dad54e355e32f" }

src/circuit.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use halo2_gadgets::{
5555
MerklePath,
5656
},
5757
},
58-
utilities::lookup_range_check::LookupRangeCheckConfig,
58+
utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
5959
};
6060

6161
mod commit_ivk;
@@ -327,6 +327,7 @@ impl plonk::Circuit<pallas::Base> for Circuit {
327327
lagrange_coeffs[0],
328328
lookup,
329329
range_check,
330+
false,
330331
);
331332
let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
332333

@@ -345,6 +346,7 @@ impl plonk::Circuit<pallas::Base> for Circuit {
345346
lagrange_coeffs[1],
346347
lookup,
347348
range_check,
349+
false,
348350
);
349351
let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
350352

src/circuit/commit_ivk.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ impl CommitIvkChip {
228228
}
229229

230230
pub(in crate::circuit) mod gadgets {
231-
use halo2_gadgets::utilities::{lookup_range_check::LookupRangeCheckConfig, RangeConstrained};
231+
use halo2_gadgets::utilities::{
232+
lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
233+
RangeConstrained,
234+
};
232235
use halo2_proofs::circuit::Chip;
233236

234237
use super::*;
@@ -678,7 +681,10 @@ mod tests {
678681
chip::{SinsemillaChip, SinsemillaConfig},
679682
primitives::CommitDomain,
680683
},
681-
utilities::{lookup_range_check::LookupRangeCheckConfig, UtilitiesInstructions},
684+
utilities::{
685+
lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
686+
UtilitiesInstructions,
687+
},
682688
};
683689
use halo2_proofs::{
684690
circuit::{AssignedCell, Layouter, SimpleFloorPlanner, Value},
@@ -762,6 +768,7 @@ mod tests {
762768
lagrange_coeffs[0],
763769
lookup,
764770
range_check,
771+
false,
765772
);
766773

767774
let commit_ivk_config = CommitIvkChip::configure(meta, advices);

src/circuit/note_commit.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ use halo2_gadgets::{
2222
CommitDomain, Message, MessagePiece,
2323
},
2424
utilities::{
25-
bool_check, lookup_range_check::LookupRangeCheckConfig, FieldValue, RangeConstrained,
25+
bool_check,
26+
lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
27+
FieldValue, RangeConstrained,
2628
},
2729
};
2830

@@ -2034,7 +2036,7 @@ mod tests {
20342036
},
20352037
sinsemilla::chip::SinsemillaChip,
20362038
sinsemilla::primitives::CommitDomain,
2037-
utilities::lookup_range_check::LookupRangeCheckConfig,
2039+
utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig},
20382040
};
20392041

20402042
use ff::{Field, PrimeField, PrimeFieldBits};
@@ -2119,6 +2121,7 @@ mod tests {
21192121
lagrange_coeffs[0],
21202122
lookup,
21212123
range_check,
2124+
false,
21222125
);
21232126
let note_commit_config =
21242127
NoteCommitChip::configure(meta, advices, sinsemilla_config);

0 commit comments

Comments
 (0)