Skip to content

feat(acir)!: Program and witness stack structure#5149

Merged
TomAFrench merged 160 commits intomasterfrom
mv/program-wit-stack
Mar 19, 2024
Merged

feat(acir)!: Program and witness stack structure#5149
TomAFrench merged 160 commits intomasterfrom
mv/program-wit-stack

Conversation

@vezenovm
Copy link
Copy Markdown
Contributor

@vezenovm vezenovm commented Mar 12, 2024

This PR does the breaking serialization outlined in this issue: noir-lang/noir#4428.

The line count is high, however, most of the changes in this PR are serialization changes due to our current structures of Circuit and WitnessMap now being contained within wrapper structures. Barretenberg now expects a Program and a WitnessStack.

/// A program represented by multiple ACIR circuits. The execution trace of these
/// circuits is dictated by construction of the [crate::native_types::WitnessStack].
pub struct Program {
    pub functions: Vec<Circuit>,
}
/// An ordered set of witness maps for separate circuits
pub struct WitnessStack {
    pub stack: Vec<StackItem>
}

pub struct StackItem {
    /// Index into a [crate::circuit::Program] function list for which we have an associated witness
    index: u32,
    /// A full witness for the respective constraint system specified by the index
    witness: WitnessMap,
}

For now Barretenberg expects that all functions are still inlined and we only work with a single circuit. This PR simply introduces the breaking serialization change for visibility and record keeping sake.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants