Skip to content

Harden gen_inputs.sh: validate inputs and fail on malformed witness data #163

Description

@Psalmuel01

Summary

circuits/scripts/gen_inputs.sh builds Prover.toml inputs but does minimal validation. Malformed values produce cryptic nargo/bb failures downstream. Add input validation and clear errors.

What to build

  • Validate each expected field is present and well-formed (numeric where numeric, 0x-hex where field, correct byte lengths for keys/sigs)
  • Fail fast with a message naming the offending field
  • set -euo pipefail and quoting audit

Acceptance criteria

  • Missing/malformed inputs produce a clear, field-named error before nargo runs
  • Script is shellcheck-clean
  • Existing build flow (build.sh) still works end-to-end---

✅ Merge requirements (read before starting)

Before this PR can be merged, all of the following must hold:

  • All CI checks pass (contracts, frontend, circuits as applicable)
  • Every Greptile review comment is addressed — no unresolved review threads
  • Greptile confidence score is 4/5 or higher

Greptile performs the detailed code review on each PR. Please resolve its feedback fully before requesting a human merge — PRs below 4/5 or with open Greptile threads will not be merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programcircuitsNoir ZK circuit workeasyGood for newcomers, low complexityenhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions