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

Add comment about what's supposed to be not serialised #485

Open
matthiasgoergens opened this issue Oct 28, 2024 · 0 comments
Open

Add comment about what's supposed to be not serialised #485

matthiasgoergens opened this issue Oct 28, 2024 · 0 comments
Assignees

Comments

@matthiasgoergens
Copy link
Collaborator

matthiasgoergens commented Oct 28, 2024

In almost all the case, unifying source of truth and less error prune make much sense!
But in this case I will say not.

We expect ConstraintSystem

pub struct ConstraintSystem<E: ExtensionField> {

to be serialized into proving/verifying key. So, we expect some fields scope should be move to cfg[test] or just under some feature flag toggle on
All the "xxxxx_map" fields is one of the example. Those debug info are

  1. from prover perspective, only push those name strings in non-release build. Those variable debug name shouldn't be in release build nor in binary.
  2. from verifier perspective, neither debug nor release need this information, so they should have them "serde skip".

With above 2 points, I will say this PR change is unnessesary, because source of truth shouldn't reverse release info to depends on debug info

@hero78119 Could you please add that reasoning as a comment in the code? And perhaps make it so that witin_namespace_map actually only show up in debug mode? (Or otherwise leave a TODO-comment to that effect?)

Btw, I don't think we should spend effort removing variable names from a release build. It's better to leave them around for debugging, because things can go wrong with the release build, too.

(That's all assuming that constructing the circuit is far from the most expensive thing we are doing. I expect (recursive) proving to take the majority of the runtime.)

Originally posted by @matthiasgoergens in #465 (comment)

@matthiasgoergens matthiasgoergens changed the title Describe what's supposed to be not serialised Add comment about what's supposed to be not serialised Oct 28, 2024
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

No branches or pull requests

2 participants