zcash / halo2

The Halo2 zero-knowledge proving system
https://zcash.github.io/halo2/
Other
725 stars 494 forks source link

Allow or require columns to be named #681

Open daira opened 1 year ago

daira commented 1 year ago

This would already be useful for debugging, but it will become even more important when we support floor planners that can do horizontal optimizations (#195), because at that point it will be infeasibly difficult to keep track of column numbers manually.

It would be logical columns (as used in a particular gadget or region) that are named, rather than global columns.

daira commented 1 year ago

I think it would be sufficient for this issue to just pass a closure returning a column name to methods like ConstraintSystem::{advice,fixed}_column. At the moment, circuits tend to manually share columns between gadgets, but once #195 and associated optimizations are implemented, they will not need to do that and so the columns created by {advice,fixed}_column will be "logical columns".

If we also add namespacing to ConstraintSystem as suggested by @str4d in #195, then the column names would be scoped to a namespace. This would help to distinguish columns allocated by the same code in different contexts.

CPerezz commented 1 year ago

If we also add namespacing to ConstraintSystem as suggested by @str4d in https://github.com/zcash/halo2/issues/195, then the column names would be scoped to a namespace. This would help to distinguish columns allocated by the same code in different contexts.

In #705 they're scoped per Region. I think that PR could probably close this issue too. LMK if it doesen't since I could also implement the missing pieces too so that this issue get's also resolved!