From 4c6198c955814d42fec3d9ce043dbaaa85298952 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Fri, 17 May 2024 10:01:14 +0200 Subject: [PATCH 1/4] Bring PallasLookup trait into scope to support updated halo2 crate This change updates the orchard crate to bring the PallasLookup trait into scope, ensuring compatibility with the recent changes in the halo2 crate. By importing the PallasLookup trait, we maintain backward compatibility and allow existing code to function without modification. --- Cargo.lock | 6 ++---- Cargo.toml | 6 +++--- src/circuit.rs | 2 +- src/circuit/commit_ivk.rs | 10 ++++++++-- src/circuit/note_commit.rs | 6 ++++-- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b525d0ada..4c7265443 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,8 +964,7 @@ dependencies = [ [[package]] name = "halo2_gadgets" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126a150072b0c38c7b573fe3eaf0af944a7fed09e154071bf2436d3f016f7230" +source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa-default-generic-arg#5414d9526c0e774b0d0597b3fcfea06b656f4ab3" dependencies = [ "arrayvec", "bitvec", @@ -989,8 +988,7 @@ checksum = "47716fe1ae67969c5e0b2ef826f32db8c3be72be325e1aa3c1951d06b5575ec5" [[package]] name = "halo2_proofs" version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b867a8d9bbb85fca76fff60652b5cd19b853a1c4d0665cb89bee68b18d2caf0" +source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa-default-generic-arg#5414d9526c0e774b0d0597b3fcfea06b656f4ab3" dependencies = [ "blake2b_simd", "ff", diff --git a/Cargo.toml b/Cargo.toml index 0ea1d289d..277acbdb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,8 +29,8 @@ blake2b_simd = "1" ff = "0.13" fpe = "0.6" group = { version = "0.13", features = ["wnaf-memuse"] } -halo2_gadgets = "0.3" -halo2_proofs = { version = "0.3", default-features = false, features = ["batch", "floor-planner-v1-legacy-pdqsort"] } +halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg" } +halo2_proofs = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg", default-features = false, features = ["batch", "floor-planner-v1-legacy-pdqsort"] } hex = "0.4" lazy_static = "1" memuse = { version = "0.2.1", features = ["nonempty"] } @@ -56,7 +56,7 @@ plotters = { version = "0.3.0", optional = true } [dev-dependencies] bridgetree = "0.4" criterion = "0.4" # 0.5 depends on clap 4 which has MSRV 1.70 -halo2_gadgets = { version = "0.3", features = ["test-dependencies"] } +halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg", features = ["test-dependencies"] } hex = "0.4" proptest = "1.0.0" zcash_note_encryption = { version = "0.4", features = ["pre-zip-212"] } diff --git a/src/circuit.rs b/src/circuit.rs index 567b60658..91fdf40f4 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -56,7 +56,7 @@ use halo2_gadgets::{ MerklePath, }, }, - utilities::lookup_range_check::LookupRangeCheckConfig, + utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig}, }; mod commit_ivk; diff --git a/src/circuit/commit_ivk.rs b/src/circuit/commit_ivk.rs index 33692a4a8..2a3621962 100644 --- a/src/circuit/commit_ivk.rs +++ b/src/circuit/commit_ivk.rs @@ -228,7 +228,10 @@ impl CommitIvkChip { } pub(in crate::circuit) mod gadgets { - use halo2_gadgets::utilities::{lookup_range_check::LookupRangeCheckConfig, RangeConstrained}; + use halo2_gadgets::utilities::{ + lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig}, + RangeConstrained, + }; use halo2_proofs::circuit::Chip; use super::*; @@ -678,7 +681,10 @@ mod tests { chip::{SinsemillaChip, SinsemillaConfig}, primitives::CommitDomain, }, - utilities::{lookup_range_check::LookupRangeCheckConfig, UtilitiesInstructions}, + utilities::{ + lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig}, + UtilitiesInstructions, + }, }; use halo2_proofs::{ circuit::{AssignedCell, Layouter, SimpleFloorPlanner, Value}, diff --git a/src/circuit/note_commit.rs b/src/circuit/note_commit.rs index 9daa685f2..e33cc857c 100644 --- a/src/circuit/note_commit.rs +++ b/src/circuit/note_commit.rs @@ -22,7 +22,9 @@ use halo2_gadgets::{ CommitDomain, Message, MessagePiece, }, utilities::{ - bool_check, lookup_range_check::LookupRangeCheckConfig, FieldValue, RangeConstrained, + bool_check, + lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig}, + FieldValue, RangeConstrained, }, }; @@ -2034,7 +2036,7 @@ mod tests { }, sinsemilla::chip::SinsemillaChip, sinsemilla::primitives::CommitDomain, - utilities::lookup_range_check::LookupRangeCheckConfig, + utilities::lookup_range_check::{LookupRangeCheck, LookupRangeCheckConfig}, }; use ff::{Field, PrimeField, PrimeFieldBits}; From c6096d062bf442ed706431adc5373ce378303fc5 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Thu, 30 May 2024 12:47:43 +0200 Subject: [PATCH 2/4] Fix branch name for halo2 repository in Cargo.toml --- Cargo.lock | 4 ++-- Cargo.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c7265443..07728874e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,7 +964,7 @@ dependencies = [ [[package]] name = "halo2_gadgets" version = "0.3.0" -source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa-default-generic-arg#5414d9526c0e774b0d0597b3fcfea06b656f4ab3" +source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa#9ecbd6513163175efb4b699f9e80e0a14e70c1e6" dependencies = [ "arrayvec", "bitvec", @@ -988,7 +988,7 @@ checksum = "47716fe1ae67969c5e0b2ef826f32db8c3be72be325e1aa3c1951d06b5575ec5" [[package]] name = "halo2_proofs" version = "0.3.0" -source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa-default-generic-arg#5414d9526c0e774b0d0597b3fcfea06b656f4ab3" +source = "git+https://github.com/QED-it/halo2?branch=improve-backward-compatability-without-zsa#9ecbd6513163175efb4b699f9e80e0a14e70c1e6" dependencies = [ "blake2b_simd", "ff", diff --git a/Cargo.toml b/Cargo.toml index 277acbdb0..115d3232b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,8 +29,8 @@ blake2b_simd = "1" ff = "0.13" fpe = "0.6" group = { version = "0.13", features = ["wnaf-memuse"] } -halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg" } -halo2_proofs = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg", default-features = false, features = ["batch", "floor-planner-v1-legacy-pdqsort"] } +halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa" } +halo2_proofs = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa", default-features = false, features = ["batch", "floor-planner-v1-legacy-pdqsort"] } hex = "0.4" lazy_static = "1" memuse = { version = "0.2.1", features = ["nonempty"] } @@ -56,7 +56,7 @@ plotters = { version = "0.3.0", optional = true } [dev-dependencies] bridgetree = "0.4" criterion = "0.4" # 0.5 depends on clap 4 which has MSRV 1.70 -halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa-default-generic-arg", features = ["test-dependencies"] } +halo2_gadgets = { git = "https://github.com/QED-it/halo2", branch = "improve-backward-compatability-without-zsa", features = ["test-dependencies"] } hex = "0.4" proptest = "1.0.0" zcash_note_encryption = { version = "0.4", features = ["pre-zip-212"] } From e5f87564fb732c3495202b31c752638db0216f09 Mon Sep 17 00:00:00 2001 From: Dmitry Demin Date: Thu, 30 May 2024 13:15:41 +0200 Subject: [PATCH 3/4] Add .circleci/config.yml to avoid CI check error --- .circleci/config.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..d95cffad9 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,40 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/2.0/configuration-reference +version: 2.1 + +orbs: + slack: circleci/slack@4.1 + +# Define a job to be invoked later in a workflow. +# See: https://circleci.com/docs/2.0/configuration-reference/#jobs +jobs: + cargo-test: + # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. + # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor + docker: + - image: cimg/rust:1.65.0 + # Add steps to the job + # See: https://circleci.com/docs/2.0/configuration-reference/#steps + steps: + - checkout + - run: + name: "cargo test" + command: | + sudo apt update && sudo apt-get install libfontconfig libfontconfig1-dev libfreetype6-dev; + cargo version; + cargo test --all --all-features; + - slack/notify: + event: fail + template: basic_fail_1 + - slack/notify: + event: pass + template: basic_success_1 + + +# Invoke jobs via workflows +# See: https://circleci.com/docs/2.0/configuration-reference/#workflows +workflows: + build-and-test: + jobs: + - cargo-test: + context: CI-Orchard-slack From d8babc63ce4b519c6a102370d7e62f352339d83d Mon Sep 17 00:00:00 2001 From: Constance Beguier Date: Tue, 9 Jul 2024 14:23:25 +0200 Subject: [PATCH 4/4] Revert "Add .circleci/config.yml to avoid CI check error" This reverts commit e5f87564fb732c3495202b31c752638db0216f09. --- .circleci/config.yml | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index d95cffad9..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,40 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 - -orbs: - slack: circleci/slack@4.1 - -# Define a job to be invoked later in a workflow. -# See: https://circleci.com/docs/2.0/configuration-reference/#jobs -jobs: - cargo-test: - # Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. - # See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor - docker: - - image: cimg/rust:1.65.0 - # Add steps to the job - # See: https://circleci.com/docs/2.0/configuration-reference/#steps - steps: - - checkout - - run: - name: "cargo test" - command: | - sudo apt update && sudo apt-get install libfontconfig libfontconfig1-dev libfreetype6-dev; - cargo version; - cargo test --all --all-features; - - slack/notify: - event: fail - template: basic_fail_1 - - slack/notify: - event: pass - template: basic_success_1 - - -# Invoke jobs via workflows -# See: https://circleci.com/docs/2.0/configuration-reference/#workflows -workflows: - build-and-test: - jobs: - - cargo-test: - context: CI-Orchard-slack