feat(acir): Add length to BlackBoxFuncCall serialization#285
feat(acir): Add length to BlackBoxFuncCall serialization#285
Conversation
|
Check out this PR https://github.com/noir-lang/acvm/pull/281/files |
Oh I missed this in that PR. I will check it out further. I am not sure how I feel about serializing each BB call independently when we still could just call
Either way the variable one will still need to know the size of the inputs when being read back. We would have to change the writes to also use custom method like you did for read in #281. I guess at that point I would just have a custom write/read method for |
|
One more relevant comment in the PR review for #281 : #281 (comment) |
This should be clear from the function signature in the |
|
Closed as this issue is resolved by #286 |
Related issue(s)
Works towards resolving #234.
Description
After #269 we moved
BlackBoxFuncCallto struct variants with explicit function signatures. The inputs are now separated which is a welcome change. However, the way BlackBoxFuncCalls are currently being written still follows the old method when everything was handled in a flattened inputs vector. Now that we are splitting up the inputs into separate input fields this requires us to have hardcoded function signatures when serializing our function inputs. This is fine for our existing blackbox funcs as any current functions that have variable inputs have only one and it can be serialized as the last input of the function signature.For recursion we can have multiple function inputs that all vary in size.
VerifyProofwill require akey,proof,public_inputs,key_hash, andinput_aggregation_object. The key hash is a single element that can be computed by the respective backend. Every other function input can vary depending on the proving system. Thus the way we currently read in a flattened vector is not sufficient.Summary of changes
I added a new struct
FunctionInputIOthat stores the length of a given function input. Singular function inputsare not affected as the function signature determines whether we should fetch the first element of a vector when reading in the function inputs or return a vector with a single element.
Dependency additions / changes
(If applicable.)
Test additions / changes
I included one more black box func that has multiple vector based function inputs in the serialization_roundtrip test.
Checklist
cargo fmtwith default settings.Additional context
(If applicable.)