Add methods for ABI encoding/decoding circuit inputs#546
Merged
kevaundray merged 16 commits intonoir-lang:masterfrom Dec 8, 2022
Merged
Add methods for ABI encoding/decoding circuit inputs#546kevaundray merged 16 commits intonoir-lang:masterfrom
kevaundray merged 16 commits intonoir-lang:masterfrom
Conversation
5 tasks
TomAFrench
commented
Dec 3, 2022
jfecher
previously approved these changes
Dec 8, 2022
* master: Update workflow to run on 20.04 to fix CI (noir-lang#565) Split `util` module from noirc_frontend into new crate (noir-lang#560) update backend ref (noir-lang#561) Tell `clap` to use help text when no subcommand (noir-lang#559) moving noirup and build files out to separate repositories (noir-lang#557) Make `noirup` pull latest nightly build by default (noir-lang#470) Handle predicate operator during inlining (noir-lang#544) Add gitattributes (noir-lang#541)
jfecher
approved these changes
Dec 8, 2022
kevaundray
reviewed
Dec 8, 2022
TomAFrench
added a commit
to TomAFrench/noir
that referenced
this pull request
Dec 8, 2022
* master: Add methods for ABI encoding/decoding circuit inputs (noir-lang#546)
TomAFrench
added a commit
to TomAFrench/noir
that referenced
this pull request
Dec 8, 2022
* master: Add methods for ABI encoding/decoding circuit inputs (noir-lang#546) Update workflow to run on 20.04 to fix CI (noir-lang#565)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue(s)
closes #545
closes #453
Description
Summary of changes
This PR defines
abi.encodeandabi.decodemethods which convert betweenBTreeMap<String, InputValue>andVec<FieldElement>abi.encodeallows us to replaceprocess_abi_with_inputandprocess_abi_with_verifier_inputwith a shared implementation. This makes it easier to support new types in future and allows for better testing.abi.decodeallows us to simplify the code for exporting public inputs toVerifier.toml. Instead of having to pass around the witness index which corresponds to the return value and pull it out of the witness map then merge with the rest of the inputs, we can in a single step decode the entirety of the circuits inputs from the witness map.Dependency additions / changes
(If applicable.)
Test additions / changes
(If applicable.)
Checklist
cargo fmtwith default settings.Additional context
Moving the handling of inputs to the
noirc_abicrate also makes it easier to reuse this implementation through wasm in future.