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

AssignmentMissing when using a private PathVar witness #46

Open
rozbb opened this issue May 7, 2021 · 2 comments
Open

AssignmentMissing when using a private PathVar witness #46

rozbb opened this issue May 7, 2021 · 2 comments
Labels
D-medium Difficulty: medium P-medium Priority: medium T-bug Type: bug T-refactor Type: cleanup/refactor

Comments

@rozbb
Copy link
Contributor

rozbb commented May 7, 2021

Currently, it's not possible to use PathVar::new_witness for a placeholder PathVar in the merkle module. The reason why is that it takes in a Result<Vec<T>, SynthesisError> instead of something more like Vec<Option<T>>, which is used in other sequence-like variables. The reason the latter is necessary is because the allocator needs to know how many variables to create.

This is an issue and not a PR because I don't have any good ways off the top of my head to fix this. The workaround is pretty easy (just make an arbitrary Path of the appropriate length), but that doesn't fit with how the rest of the library works.

@rozbb
Copy link
Contributor Author

rozbb commented May 7, 2021

Note that the more immediate reason for this error is simply that PathVar::new_variable calls and_then() on its argument, regardless of the value of mode. But the bug remains even after fixing that behavior.

@Pratyush
Copy link
Member

This is related to arkworks-rs/r1cs-std#17. In the meanwhile, I would recommend allocating a "dummy" path of the appropriate (worst-case) length.

@Pratyush Pratyush added D-medium Difficulty: medium P-medium Priority: medium T-bug Type: bug T-refactor Type: cleanup/refactor labels Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-medium Difficulty: medium P-medium Priority: medium T-bug Type: bug T-refactor Type: cleanup/refactor
Projects
None yet
Development

No branches or pull requests

2 participants