Commit Graph

27 Commits

Author SHA1 Message Date
therealyingtong 61c431edc7 Update examples to use AssignedCell. 2021-11-27 10:08:01 -05:00
Jack Grigg 7da5605f51 Remove redundant Error suffix from Error cases 2021-11-10 16:19:36 +00:00
Jack Grigg c9d890377c book: Render example for `CircuitLayout` 2021-10-01 13:39:04 +01:00
Jack Grigg 7463a6e931 examples: Reorganise circuit-layout example to use in book 2021-10-01 13:39:04 +01:00
str4d 27c4187673
Merge pull request #354 from daira/table-refactoring
Add a `Layouter::assign_table` API
2021-07-27 20:52:36 +01:00
Jack Grigg 49a763cd61 Rename `Table::assign_fixed` to `Table::assign_cell` 2021-07-27 17:48:13 +01:00
Jack Grigg e855ac6adb Add `halo2::plonk::circuit::TableColumn` struct
This type is required by the `ConstraintSystem::lookup` API, and cannot
be converted into a `Column<Fixed>` via the public API, forcing chip
developers to use `Layouter::assign_table` API to load tables. This is
a safety feature, as lookup table rows need to be default-value-filled
by the layouter (or else the table would have an implicit default value
of all-zeroes which could introduce soundness bugs into circuits).
2021-07-27 15:52:42 +01:00
Jack Grigg eb2b020d8c Migrate benches and examples to `impl Neg for Expression` 2021-07-26 01:59:06 +01:00
Sean Bowe e02fc06f52
cargo fmt 2021-07-24 15:42:30 -06:00
ebfull 754dd62c92
Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-07-24 10:27:50 -06:00
Sean Bowe e23d148b72
minor clippy fixes 2021-07-22 12:07:17 -06:00
Sean Bowe e3c6542e83
Fix circuit-layout example. 2021-07-22 12:04:41 -06:00
Sean Bowe 26982a6050
Update circuit graph tooling to account for selector optimization. 2021-07-22 10:06:48 -06:00
Sean Bowe fe215d153d
Update tests with API changes for public inputs and permutation argument. 2021-07-08 15:32:51 -06:00
Jack Grigg e262941b70 clippy: Fix capitalized acronyms in tests and examples 2021-06-23 13:33:04 +01:00
Jack Grigg 6d0017f47c Introduce a FloorPlanner trait and integrate it into the Circuit trait
This is the beginning of the process to enable full floor planning
capabilities in `halo2`. For now, all that a floor planner can do is
synthesize a circuit, which makes it no more powerful than a layouter,
but easier to use (as moving to a multi-pass layouter no longer requires
changes to `Circuit::synthesize`).
2021-06-22 23:47:17 +01:00
Jack Grigg 1b04877b3d Migrate PLONK-gate-using circuits to use SingleChipLayouter
These were all early examples that used the Circuit trait without any
layouter, which is incompatible with upcoming changes.

The minimal change to the PinnedVerificationKey is because the lookup
table is being allocated at the top of its columns instead of in-place.
2021-06-22 00:22:12 +01:00
Jack Grigg 3e82c7b232 dev: Move halo2::dev::circuit_layout to halo2::dev::CircuitLayout::render
This makes it easier to add configuration to the renderer.
2021-06-08 12:13:18 +01:00
Jack Grigg 0f0dd8a26c Allow multiple polynomial constraints per gate
This enables a gate such as ECC complete addition to define its
constraints in terms of a common set of queried columns.
2021-05-27 15:01:46 +01:00
Jack Grigg 353a07cef1 `ConstraintSystem::lookup`: Move lookup queries into a closure
This matches `ConstraintSystem::create_gate`.

At the same time, we bind the input and table expressions together as a
"table map" by requiring the closure to return a vector of tuples. This
ensures they are always the same length.
2021-05-27 00:53:31 +01:00
therealyingtong 4ae21a905d Update tests 2021-02-24 00:21:12 +08:00
therealyingtong d8534e1c50
Pass Expressions to meta.lookup() 2021-02-18 15:41:35 -07:00
therealyingtong a19dc68dee Use Column<Any> in Permutation::Argument 2021-02-17 21:32:17 +08:00
Daira Hopwood 760d69bd2c Rename "auxiliary column" to "instance column" in the book and in code. fixes #181
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-14 21:09:49 +00:00
Jack Grigg 5905230174 Fix stable clippy lints 2021-02-05 16:48:41 +00:00
Jack Grigg 0a378c3d0f Require Circuit::Config implement Clone instead of Copy 2021-02-01 19:05:19 +00:00
Jack Grigg 3c1132ec59 Add halo2::dev::circuit_layout behind dev-graph feature flag
This method renders circuits as tables, showing how the various regions
within them have been layed out.
2021-02-01 18:38:20 +00:00