Skip to content

Fold programs fail with Program must have one entry point #407

@x-senpai-x

Description

@x-senpai-x

Description

Provekit currently enforces that a program has exactly one ACIR function/circuit entry point:

Guard location: https://github.com/worldfnd/provekit/blob/main/provekit/r1cs-compiler/src/noir_proof_scheme.rs#L41

ensure!(program.bytecode.functions.len() == 1, "Program must have one entry point");

Problem

Noir programs that use #[fold] compile into multiple ACIR functions/circuits (one entry point + one or more folded subcircuits), so functions.len() > 1.

As a result, provekit unconditionally rejects fold programs before R1CS lowering or proving even begins — this is not a test script issue but a limitation in the compiler frontend.

Impact

  • Any Noir program using #[fold] attributes cannot be proved with provekit.
  • The error is misleading: the program is valid Noir but does not fit provekit's current single-function assumption.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions