This repository was archived by the owner on Oct 31, 2023. It is now read-only.
chore: Enforce proper conversion of memory into fixed length array#163
Merged
chore: Enforce proper conversion of memory into fixed length array#163
Conversation
phated
approved these changes
May 8, 2023
TomAFrench
added a commit
that referenced
this pull request
May 12, 2023
* acvm-0.12.0: fix bad rebase chore: Release 0.1.2 (#183) fix: Remove star dependencies to allow publishing (#182) chore: Release 0.1.1 (#181) fix: Add description so crate can be published (#180) chore: update readme to new name and add contract note (#177) feat!: update to acvm with non-homogeneous bb calls (#169) update to latest changes chore: Release 0.1.0 (#173) use patch syntax chore: update to use new black box solver interface feat!: update to target acvm-84b5d18d chore(ci): Update tokens (#174) chore: Add release-please and publish workflows to project (#172) feat!: Update to ACVM v0.11.0 (#151) chore: remove usage of `std::mem::forget` (#164) chore: Enforce proper conversion of memory into fixed length array (#163) chore: Add test for Keccak256 constraint (#158) chore: use `WASMValue` for wasm arguments as well as return values (#157) feat!: Add Keccak constraints (#150)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Addresses review comment #151 (comment).
A lot of our type issues were due to
slice_memoryreturning a&[u8]whereas we want a fixed length array. This leads to us having more information than the compiler and so need totry_into().unwrap()in a lot of places.I've fixed this by giving the compiler more hints about what we want returned from
slice_memory, it's now generic with a const parameterSIZEand will return a[u8; SIZE]array. We no longer pass a length argument but will often have to provide a type hint when calling the function.This isn't always usable for all situations where we need to read from memory (as we don't always know the length of the array at compile time. I've then added
read_memory_variable_length()which has the current behaviour ofslice_memory