Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add noir-execute binary #7384

Merged
merged 30 commits into from
Feb 19, 2025
Merged

feat(cli): add noir-execute binary #7384

merged 30 commits into from
Feb 19, 2025

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Feb 14, 2025

Description

Problem*

Resolves #7383

Summary*

Created a new tooling/artifact_cli crate which is both a library and a binary:

Left for follow-up PRs:

Additional Context

Testing

$ cd test_programs/execution_success/workspace
$ cargo run -q -p nargo_cli -- compile --package a
$ ls target
a.json
$ cargo run -q -p noir_artifact_cli -- --artifact-path ./target/a.json --prover-file ./crates/a/Prover.toml --output-dir ./out
[a] Circuit witness successfully solved
[a] Witness saved to /Users/aakoshh/Work/aztec/noir/test_programs/execution_success/workspace/out/a.gz

Options

cargo run -q -p noir_artifact_cli -- --help
Commands working on noir build artifacts

Usage: noir-execute [OPTIONS] --artifact-path <ARTIFACT_PATH> --prover-file <PROVER_FILE>

Options:
  -a, --artifact-path <ARTIFACT_PATH>
          Path to the JSON build artifact (either a program or a contract)

  -p, --prover-file <PROVER_FILE>
          Path to the Prover.toml file which contains the inputs and the optional return value in ABI format

  -o, --output-dir <OUTPUT_DIR>
          Path to the directory where the output witness should be saved. If empty then the results are discarded

  -w, --witness-name <WITNESS_NAME>
          Write the execution witness to named file
          
          Defaults to the name of the circuit being executed.

      --contract-fn <CONTRACT_FN>
          Name of the function to execute, if the artifact is a contract

      --oracle-resolver <ORACLE_RESOLVER>
          JSON RPC url to solve oracle calls

      --pedantic-solving
          Use pedantic ACVM solving, i.e. double-check some black-box function assumptions when solving

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@aakoshh aakoshh marked this pull request as ready for review February 14, 2025 14:24
@aakoshh aakoshh requested a review from a team February 14, 2025 14:24
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 2672478 Previous: d0d04e8 Ratio
AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_blob 66 s 51 s 1.29

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial thoughts

@TomAFrench
Copy link
Member

Can you also add some tests for this showing the usage of the CLI?

@aakoshh
Copy link
Contributor Author

aakoshh commented Feb 17, 2025

Can you also add some tests for this showing the usage of the CLI?

I created a separate story for that: #7382

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 2672478 Previous: d0d04e8 Ratio
regression_4709 0.889 s 0.725 s 1.23

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@aakoshh aakoshh requested a review from TomAFrench February 17, 2025 20:59
@aakoshh
Copy link
Contributor Author

aakoshh commented Feb 18, 2025

Added a test showing the usage of the transcript in #7417

@aakoshh aakoshh requested a review from TomAFrench February 19, 2025 15:15
@TomAFrench TomAFrench changed the title feat(cli): Artifact CLI feat(cli): add noir-execute binary Feb 19, 2025
@TomAFrench TomAFrench enabled auto-merge February 19, 2025 18:06
@TomAFrench TomAFrench added this pull request to the merge queue Feb 19, 2025
Merged via the queue into master with commit fdfe2bf Feb 19, 2025
102 of 103 checks passed
@TomAFrench TomAFrench deleted the 7132-artifact-cli branch February 19, 2025 18:21
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 19, 2025
chore!: make `ResolverError::OracleMarkedAsConstrained` into a full error (noir-lang/noir#7426)
chore: simplify reports (noir-lang/noir#7421)
fix: do not discard negative sign from field literals in comptime interpreter (noir-lang/noir#7439)
chore: bump aztec-packages commit (noir-lang/noir#7441)
fix: require loop/for/while body to be unit (noir-lang/noir#7437)
feat: simplify assertions that squared values are equal to zero (noir-lang/noir#7432)
chore(benchmark): Improve noir msm benchmark (noir-lang/noir#7390)
chore: Add SSA security checks description (noir-lang/noir#7366)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 19, 2025
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
feat(cli): add noir-execute binary
(noir-lang/noir#7384)
chore!: make `ResolverError::OracleMarkedAsConstrained` into a full
error (noir-lang/noir#7426)
chore: simplify reports (noir-lang/noir#7421)
fix: do not discard negative sign from field literals in comptime
interpreter (noir-lang/noir#7439)
chore: bump aztec-packages commit
(noir-lang/noir#7441)
fix: require loop/for/while body to be unit
(noir-lang/noir#7437)
feat: simplify assertions that squared values are equal to zero
(noir-lang/noir#7432)
chore(benchmark): Improve noir msm benchmark
(noir-lang/noir#7390)
chore: Add SSA security checks description
(noir-lang/noir#7366)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <[email protected]>
TomAFrench added a commit that referenced this pull request Feb 20, 2025
* master: (89 commits)
  chore: bump external pinned commits (#7472)
  chore: remove `disable_macros` compile option (#7468)
  chore(ci): add workflow to automate bumping aztec-packages commit (#7465)
  chore: Release Noir(1.0.0-beta.3) (#7346)
  chore(ci): Missing dash in profiler command argument (#7467)
  feat(experimental): show macro errors where they happen (#7333)
  feat: optimize FieldElement::num_bits (#7147)
  chore(profiler): Docs on profiler command and more complete error reporting (#7436)
  feat(ci): Release noir-inspector in binaries (#7464)
  chore(docs): Noir Profiler external documentation (#7457)
  feat(ci): Publish binaries for noir-profiler (#7443)
  chore: Copy #7387 docs into v1.0.0-beta.2 versioned_docs (#7458)
  fix: prevent incorrect ACIRgen caused by noop truncations (#7456)
  feat: add native `u128` type (#7301)
  chore: standardize that doc comments on top of statements and expression are allowed but warn (#7450)
  fix: don't let nargo fmt produce multiple trailing newlines (#7444)
  feat(cli): add noir-execute binary (#7384)
  chore!: make `ResolverError::OracleMarkedAsConstrained` into a full error (#7426)
  chore: simplify reports (#7421)
  fix: do not discard negative sign from field literals in comptime interpreter (#7439)
  ...
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.

Create a CLI tool to execute build artefacts
2 participants