-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Circuit dynamic configure #2
Conversation
@@ -470,14 +470,34 @@ pub trait Circuit<F: Field> { | |||
/// `Circuit` trait because its behaviour is circuit-critical. | |||
type FloorPlanner: FloorPlanner; | |||
|
|||
/// Runtime parameters to configure the circuit. | |||
#[cfg(feature = "circuit-params")] | |||
type Params: Default = (); |
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.
Associated type default: rust-lang/rust#29661
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.
@parazyd Would turning on this unstable feature - associated type default - be a good idea?
I think tradeoff is:
the pro:
- won't break any circuits implementing the Circuit trait from zcash/halo2, which seems nice, one can use zcash/halo2
Circuit
implementing circuits with this fork directly
the cons:
- potential corner cases (though the usage is simple here)
- need to migrate if and when Rust team introduces a breaking change (but the alternative is breaking the circuits now)
other misc points:
- Using an unstable feature requires depending on
nightly
which we already do in CI, so I think it isn't an issue.
|
||
impl<F: Field> Circuit<F> for MyCircuit { | ||
type Config = (); | ||
impl Circuit<pallas::Base> for MyCircuit { |
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.
Test case that should be helpful to see the flow.
d402d6b
to
478ff44
Compare
@@ -54,7 +54,7 @@ blake2b_simd = "1" | |||
maybe-rayon = {version = "0.1.0", default-features = false} | |||
|
|||
# Developer tooling dependencies | |||
plotters = { version = "0.3.0", default-features = false, optional = true } | |||
plotters = { version = "0.3.0", optional = true } |
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.
I turned on the default features to generate a test circuit layout, the PSE fork has the defaults on too.
Thanks a lot. I'll merge this manually and add a few tweaks. |
Credit: privacy-scaling-explorations#168