Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.2.0"
version = "0.3.0"
authors = ["Daniel Dominguez (Veridise) <daniel@veridise.com>"]
edition = "2024"
rust-version = "1.85"
Expand Down
13 changes: 11 additions & 2 deletions core/src/synthesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ff::Field;
use crate::{
info_traits::{GroupInfo, SelectorInfo},
query::{Advice, Fixed},
table::{Any, Column},
table::{Any, Column, RegionIndex, RegionStart},
};

/// Unique identifier for a group.
Expand All @@ -17,8 +17,17 @@ pub type GroupKey = u64;
pub trait SynthesizerLike<F: Field> {
/// Enters a new region of the circuit.
///
/// If the region index and starting row is known at this point is better to give
/// this information now since it avoids having to infer the information from context clues
/// later.
///
/// Panics if the synthesizer entered a region already and didn't exit.
fn enter_region(&mut self, region_name: String);
fn enter_region(
&mut self,
region_name: String,
region_index: Option<RegionIndex>,
region_start: Option<RegionStart>,
);

/// Exits the current region of the circuit.
///
Expand Down
18 changes: 18 additions & 0 deletions core/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,24 @@ impl From<usize> for RegionIndex {
}
}

/// Replacement for Halo2's `RegionStart` type.
#[derive(Eq, Hash, PartialEq, Debug, Copy, Clone)]
pub struct RegionStart(usize);

impl Deref for RegionStart {
type Target = usize;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl From<usize> for RegionStart {
fn from(value: usize) -> Self {
Self(value)
}
}

/// Errors related to the PLONK table.
#[derive(Error, Copy, Clone, Debug)]
pub enum TableError {
Expand Down