0xPolygonZero / zk_evm

Apache License 2.0
74 stars 24 forks source link

Move circuit directory to common platform dependant directory #375

Open BGluth opened 3 weeks ago

BGluth commented 3 weeks ago

Based on the discussion here.

0xaatif commented 3 weeks ago

My opinion is https://github.com/0xPolygonZero/zk_evm/pull/310#issuecomment-2223950878

BGluth commented 3 weeks ago

Just continuing the conversation from #310.

@0xaatif from your proposal here, would the idea be that circuits are never serialized to disk without the user specifying this explicitly in the prog args? And I guess we would never attempt to look for serialized circuits if the user doesn't specify this in the args?

Also @Nashtare wdyt about either using the output of KERNEL.hash() in the circuit versioning string (either replacing or using along with semver)?

0xaatif commented 3 weeks ago

would the idea be that circuits are never serialized to disk without the user specifying this explicitly in the prog args?

Yes, we could keep things small and simple for now, like git's plumbing commands. We can do porcelain later.

$ zero-bin generate-circuit memory 0..16 > mem.circuit

$ zero-bin get witness http://127.0
0.1/ > witness.json

$ zero-bin prove --witness witness.json --memory mem.circuit
Nashtare commented 3 weeks ago

wdyt about either using the output of KERNEL.hash() in the circuit versioning string

Yes that'd be a useful safeguard against discrepancies (though I think the circuit consistency file we had got lost somewhere in the migration or the recent PRs).

BGluth commented 3 weeks ago

Hmm... I personally feel we should hide the internals from the user by default (I think that's what you're saying you want in the end as well). Like already at this point we're abstracting this away to some extent (we read/write to the circuits directory without the user intervening). I like your idea of using platform-dirs, and I think it actually might be easier to swap that out with what we're currently doing vs. writing to stdout.

0xaatif commented 3 weeks ago

I'm good with that approach :)