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

Fix binary protocol serialisation examples to align with reality #46

Merged
merged 1 commit into from
May 16, 2024

Conversation

wraitii
Copy link
Contributor

@wraitii wraitii commented May 15, 2024

The witness is prepended with more information than currently stated / it's unclear.

NB: I am not certain if this is a documentation mistake and working as intended or if it's actually not working as intended.
As far as I can tell from the code, the docs are wrong and the "full nb of element" is only serialised by happenstance because Golang does it by default for vectors.

The witness is prepended wit more information than currently stated / it's unclear.
Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
doc-gnark ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 15, 2024 4:39pm

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines +78 to 86
// Full witness -> [uint32(nbPublicElements) | uint32(nbPrivateElements) | uint32(nbElements) | publicVariables | secretVariables]
// Public witness -> [uint32(nbElements) | publicVariables ]
```

Where:

- `nbPublicElements == len(publicVariables)`.
- `nbPrivateElements == len(secretVariables)`.
- `nbElements == len(publicVariables) + len(secretVariables)`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably just use len(...) directly above TBH

@gbotrel
Copy link
Contributor

gbotrel commented May 16, 2024

Nice catch, thanks for the contribution.

@gbotrel gbotrel merged commit 9b4a753 into Consensys:main May 16, 2024
7 of 8 checks passed
@wraitii wraitii deleted the patch-1 branch May 17, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants