Conversation
fa007b1 to
3dd7af6
Compare
bad73e1 to
1637e75
Compare
|
Force pushed after rebasing on zsa1 branch |
PaulLaux
left a comment
There was a problem hiding this comment.
I think Vanilla users should not have an extra "zsa" step. Mentioned some alternatives to the suggested approach.
src/circuit.rs
Outdated
|
|
||
| // The fields inside `zsa_witnesses` are only populated for OrchardZSA circuits. | ||
| // They are `Unknown` in OrchardVanilla circuits. | ||
| pub(crate) zsa_witnesses: ZsaWitnesses, |
There was a problem hiding this comment.
Don’t you prefer to make it Option<> instead of assigning unknown on vanilla bundle?
There was a problem hiding this comment.
I prefer to have only Value (and no Option) in the circuit part.
I replaced ZsaWitnesses struct with ((psi_nf, asset), split_flag) in order to be able to use the unzip function on Value.
src/circuit/circuit_vanilla.rs
Outdated
| /// | ||
| /// # Panics | ||
| /// Panics if the asset is not a native asset or if `split_flag` is true. | ||
| fn build_zsa_witnesses(_: pallas::Base, asset: AssetBase, split_flag: bool) -> ZsaWitnesses { |
There was a problem hiding this comment.
build_zsa_witnesses( for Vanilla does not make alot of sence. Vanilla users should not remember calling this meaningless function.
Alternativly, we get
psi_nf: Value::unknown(),
asset: Value::unknown(),
split_flag: Value::unknown(),on init and call nothing for vanilla.
Or we have a build_withness( that is mandatory for both Vanilla and ZSA to handle all withnesses.
There was a problem hiding this comment.
we can move some of this logic to the ZsaWitnesses { constructor that is used only by ZSA users.
There was a problem hiding this comment.
The function build_witness already exists. It is called from_action_context_unchecked. Inside this function we call build_zsa_witnesses.
522bc37 to
6aabe66
Compare
|
Force pushed after rebasing on zsa1 branch |
Remove circuit_flavor field from Unproven struct Remove const FLAVOR from OrchardFlavor trait Create ZsaWitnesses struct. For OrchardVanilla circuits, all fields in ZsaWitnesses are Unknown. When creating witnesses from OrchardVanilla circuits, panic if the asset is not the native asset or if split_flag is not false.
In this PR, we reduce diff with upstream and we remove some types to improve readability.
ac9e527 to
ef7cca0
Compare
|
Force pushed after rebasing on zsa1 branch |
PaulLaux
left a comment
There was a problem hiding this comment.
very nice, added some more improvments
OrchardFlavor modifications:
OrchardCircuit modifications:
Other modifications: