-
Notifications
You must be signed in to change notification settings - Fork 118
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
Support runtime tables #1859
Comments
KimchiConfigurationThe constraint system pub struct RuntimeTableCfg<F> {
pub id: i32,
pub first_column: Vec<F>,
} In order to set runtime tables one needs to create the constraint system like so: let cs = ConstraintSystem::<G::ScalarField>::create(gates)
.lookup(lookup_tables)
.runtime(runtime_table_cfgs)
.public(public)
.prev_challenges(prev_challenges)
.disable_gates_checks(disable_gates_checks)
.max_poly_size(override_srs_size)
.build()
.unwrap(); Inside In order to determine the shape of the circuits, some pub struct LookupFeatures {
pub patterns: LookupPatterns,
pub joint_lookup_used: bool,
pub uses_runtime_tables: bool,
} InstantiationAssigning actual data to each of the entries of the placeholder in the newly configured runtime table is done by creating a pub struct RuntimeTable<F> {
pub id: i32,
pub data: Vec<F>,
} Once the table is instantiated, the prover needs to load it. This is done by passing them as an input of the pub fn create<
EFqSponge: Clone + FqSponge<G::BaseField, G, G::ScalarField>,
EFrSponge: FrSponge<G::ScalarField>,
>(
groupmap: &G::Map,
witness: [Vec<G::ScalarField>; COLUMNS],
runtime_tables: &[RuntimeTable<G::ScalarField>],
index: &ProverIndex<G, OpeningProof>,
) -> Result<Self> Then, inside QueryingThe circuit provides the ability to prove that a certain variable belongs in the table. That is performed using the
because the lookup gate only uses the first 7 permutable columns.
|
Note that there are bindings for adding a runtime table config, see Snarky.gates |
@mitschabaude Indeed! I was digging into the actual runtime table and how to pass it to pickles though, since the config is not enough for it to work... |
This is a feature that enables the user to define tables of data at runtime. In order for them to work, the desired tables must be configured at constraint system creation phase. Then, they are populated with values. And finally, the prover can make assertions using data from the table using lookup rows.
This feature has been enabled in Kimchi and Pickles. Some parts are missing still in order to be able to port them into o1js. This issue will illustrate the relevant functions, types, and bindings involved in all the 3 repos.
The text was updated successfully, but these errors were encountered: