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(nargo): Remove usage of CompiledProgram in CLI code and use separate ABI/bytecode #1269

Merged
merged 3 commits into from
May 2, 2023

Conversation

TomAFrench
Copy link
Member

Related issue(s)

Resolves #

Description

Summary of changes

This PR removes the usage of CompiledProgram from the interface of the interface of the internal CLI functions, instead we pass ABI and bytecode separately.

Using CompiledProgram doesn't really make sense anymore as now we have PreprocessedProgram so we need to explicitly create a CompiledProgram from the ABI and bytecode to pass it into a function where they'll be split again.

As part of this I've removed verify_cmd::verify_proof as it didn't really do much other than

  1. Abi encode public inputs
  2. Call nargo::ops::verify_proof
  3. Throw an error if the proof is invalid

Steps 1 and 3 can instead be delegated to the caller, at which point they can just call nargo::ops::verify_proof themselves.

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.

Documentation needs

  • This PR requires documentation updates when merged.

Additional context

This would also be required if we were to support performing actions against contract functions in nargo (as these are not represented as CompiledPrograms

@kevaundray kevaundray enabled auto-merge May 2, 2023 12:44
Copy link
Contributor

@kevaundray kevaundray left a comment

Choose a reason for hiding this comment

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

Looks good overall, one comment about Result<bool, Error>

* master:
  chore(noir): constrain expr; -> assert(expr); (#1276)
  chore: fix clippy warning (#1270)
@kevaundray kevaundray added this pull request to the merge queue May 2, 2023
Merged via the queue into master with commit f144391 May 2, 2023
@kevaundray kevaundray deleted the cli-refactor branch May 2, 2023 17:11
TomAFrench added a commit that referenced this pull request May 2, 2023
* master: (63 commits)
  feat(nargo): Remove usage of `CompiledProgram` in CLI code and use separate ABI/bytecode (#1269)
  feat: add integration tests for bitshift operators (#1272)
  chore: Replace explicit if-elses with `FieldElement::from<bool>()` for boolean fields (#1266)
  chore(noir): constrain expr; -> assert(expr); (#1276)
  chore: fix clippy warning (#1270)
  chore(ssa refactor): Add all remaining doc comments to ssa generation pass (#1256)
  chore(noir): Release 0.5.1 (#1264)
  fix: Add Poseidon examples into integration tests (#1257)
  chore(nargo): replace `aztec_backend` with `acvm-backend-barretenberg` (#1226)
  chore(noir): Release 0.5.0 (#1202)
  chore(ci): Utilize new workflow to build binaries (#1250)
  chore(ssa refactor): Fix loading from mutable parameters (#1248)
  fix(wasm): add std after dependencies (#1245)
  chore(ssa refactor): Fix no returns & duplicate main (#1243)
  chore(ssa refactor): Implement intrinsics (#1241)
  chore(ssa refactor): Implement first-class functions (#1238)
  chore: address clippy warnings (#1239)
  chore(ssa refactor): Implement function calls (#1235)
  chore(ssa refactor): Implement mutable and immutable variables (#1234)
  chore(ssa refactor): Fix recursive printing of blocks (#1230)
  ...
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.

2 participants