-
Notifications
You must be signed in to change notification settings - Fork 214
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
Please implement deflating heap arrays from foregin calls #4561
Comments
Also - the type in export type ForeignCallOutput = string | string[] For context: I'm trying to prove ethereum receipt inclusion. Receipts include arrays of logs. And each data is an array by itself, so would be really nice to have nested structures support in oracles |
@LogvinovLeon Would you add reproduction? |
Here is the repro: https://github.com/vlayer-xyz/noir-oracles-2d-arrays-repro |
Use cases for it:
|
Thanks @LogvinovLeon. Updated the Issue body with what I believe are the steps for reproduction, let us know if any of them is in conflict with your intention / experience 🙌 |
# Description ## Problem\* Resolves #4561 ## Summary\* Generates brillig arrays of arrays during brillig-gen for types having nested arrays. Populate these nested brillig arrays in the brillig VM when data returned from oracles does not match the size of the outer array ## Additional Context For this to work, it is required that the oracle returns flatten values, although its Noir signature is a nested type. It's certainly possible to deserialise nested json arrays but I could not get it done easily so it'll be better handled in a separate PR. ## Documentation\* Check one: - [ ] No documentation needed. - [X] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Álvaro Rodríguez <[email protected]> Co-authored-by: TomAFrench <[email protected]>
Aim
I want to receive a two dimensional array from an oracle.
Expected Behavior
It works
Bug
To Reproduce
git clone https://github.com/vlayer-xyz/noir-oracles-2d-arrays-repro.git
cd noir-oracles-2d-arrays-repro
rm -r target
yarn install
yarn start
nargo prove --oracle-resolver http://localhost:5555
Gets error:
Project Impact
Nice-to-have
Impact Context
Without this - I need to linearise arrays and have serde logic in Noir
Workaround
Yes
Workaround Description
custom serde
Additional Context
No response
Installation Method
Binary (
noirup
default)Nargo Version
nargo version = 0.26.0
noirc version = 0.26.0+c46b164ce56e6a8f81255fb17eb6539bd040f336
(git version hash: c46b164, is dirty: false)
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: