worldfnd / worldfnd/provekit

Databus programs panic with `MemoryInit block type must be Memory` in Noir→R1CS compilation

Open
#408 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Noir
Stars
138
Forks
47
Avg merge
1d 34m
Merged PRs (30d)
6

Description

Description

Databus-style programs trigger a panic during Noir-to-R1CS compilation when they use calldata or returndata block types in memory initialization. Only Memory block type is accepted, which is more restrictive than ACIR's spec.

Details
Impact

Databus-oriented circuits (using calldata/returndata memory semantics) panic during the prepare step in r1cs-compiler.

Error: MemoryInit block type must be Memory

This prevents compiling and proving valid programs leveraging the expanded ACIR memory semantics.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at r1cs-compiler/src/noir_to_r1cs.rs around line 469 and trace handling for Opcode::MemoryInit during the prepare step. Compare the accepted BlockType behavior with ACIR's Memory, CallData(u32), and ReturnData definitions. Done means valid databus-style programs using calldata or returndata compile without the reported panic.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, cryptography
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.