-
Notifications
You must be signed in to change notification settings - Fork 843
Conversation
As decided on #634 we're going to use the bit-approach merged there. And so, most of the circuits here are no longer required/ will be added back when needed.
The first attempt to update the `prover` crate was to basically use full generics everywhere. The issue is that we ended up hitting trait safety and the complexity started to increase significantly. Hence, since we are always using the same commitment scheme and curve, it's easier to switch to concrete types.
7d101a7
to
eef1d1f
Compare
d2ed5bb should fix the issue of I was under the impression that the load of the RangeChip tables was the issue inside of the |
Fixed in 7d753bb. |
Co-authored-by: Han <tinghan0110@gmail.com>
I highly appreciate all the details you found @han0110 . I copy pasted the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some nitpicks. Great PR, this can unblock many other prs
@@ -8,7 +8,8 @@ license = "MIT OR Apache-2.0" | |||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | |||
|
|||
[dependencies] | |||
halo2_proofs = { version = "0.1.0-beta.1" } | |||
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2022_08_19" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to change here if we already patched halo2_proofs in the [patch.crates-io]
section of root Cargo.toml? I remember that's how we did in #555 right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tied here and Cargo
is not able to resolve it..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't so important but I got it to resolve correctly by also updating the version from "0.1.0-beta.1"
to "0.2.0"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow Thanks! I've never seen this behaviour in Cargo. It should also work with 0.1.0-beta no?? LOL
Thanks anyway @pinkiebell . Filled #729 with it!
@@ -2,10 +2,8 @@ | |||
// just used in tests | |||
|
|||
pub mod arith_helpers; | |||
pub mod circuit; | |||
pub mod common; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come we still keep some parts of the keccak crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need them to perform the hashes outside of the circuit and compute witnesses in the CircuitInputBuilder still :)
for (index, cell) in self.target_pairs.iter().enumerate() { | ||
cell.assign( | ||
region, | ||
offset, | ||
Some(if index == pair_index { | ||
Value::known(if index == pair_index { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we now have an expressive way to turn bool to F?
Value::known(if index == pair_index { | |
Value::known(F::from(index == pair_index)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No that I know.. THe only is F::from(bool as u64)
self.target_odd.assign( | ||
region, | ||
offset, | ||
Value::known(if odd { F::one() } else { F::zero() }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Value::known(if odd { F::one() } else { F::zero() }), | |
Value::known(F::from(odd)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
217398b
to
543fa54
Compare
f46d44f
to
e4a724d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for this great work!
In #724 the patch wasn't working with `0.1.0-beta` so it was left as TODO. But thanks to @pinkiebell who pointed out that it was required to bump the base dep in the multiple Cargo.tomls this was solved.
* change: Update halo2 tag version in all Cargo.toml * change: Use `Value` instead of `AssignedCell`. * remove: Strip keccak circuits from the repo As decided on privacy-scaling-explorations#634 we're going to use the bit-approach merged there. And so, most of the circuits here are no longer required/ will be added back when needed. * tmp * fix: RegionCtx new API adoption without &mut holding * change: Use KZG, SHPLONK and Bn256 instead of generics The first attempt to update the `prover` crate was to basically use full generics everywhere. The issue is that we ended up hitting trait safety and the complexity started to increase significantly. Hence, since we are always using the same commitment scheme and curve, it's easier to switch to concrete types. * remove: Delete prover crate as was migrated to zkevm-chain * remove: Remove legacy keccak bench file * remove: Remove `group` dep from all crates Cargo.toml * update: Port circuit-benchmarks to latest halo2 version * update: Port integration-tests to newest halo2 release * Fix errors in zkevm-circuits tests * fix: Errors introduced in `main` branch merge * fix: Load range_chip tables in SignVerigy and Tx Configs * Fix Synthesis and lookup table errors * fix: Apply suggestions from @han0110 review Co-authored-by: Han <tinghan0110@gmail.com> * Fix Signature errors introduced on Compressed treatment * fix: Fix tests and address review comments Co-authored-by: Han <tinghan0110@gmail.com>
This PR does several things although all follow the same rationale.
ff
,group
,pairing
and other deps to use thehalo2curves
re-exported ones.keccak
crate and port them to https://github.com/privacy-scaling-explorations/keccak_circuit in favour of the implementations added by Brecht on [keccak] Alternative implementations #634cargo-udeps
.halo2_proofs::circuit::Value
everywhere instead of|| Option<F>
.EDIT:
Tried to follow the same approach as in cargo: patch halo2_proofs on crates.io #555 with the patch but Cargo is unable to resolve the dependency correctly.
So even was pointed out by @ChihChengLiang [WIP] Halo2 24-08-2022 tag update #724 there's nothing we can do unless we explore resolver 2 and other similar stuff which might be the cause of this.
Resolves: #702