gnark
gnark copied to clipboard
Multidimensional arrays support problem
Are multidimensional arrays not supported? I remember it was supported in older versions.
come up with this error for Merkle Proofs:
when parsing variable MerkleProofsAccountBefore_0_0: can't set fr.Element from type []frontend.Variable
MerkleProofsAccountBefore is this:
MerkleProofsAccountBefore [NbAccountsPerTx][AccountMerkleLevels]Variable
@gbotrel
Hi -- which version are you using ? Can you describe the issue with a reproductible code snippet?
On v0.6.0 seems to work fine, on develop too. Some commits in between may not be stable on that front.
@SherLzp can I close this issue ?
Hi, I find the problem but I'm not sure if it is a problem.
The problem comes from here:
type Proof struct {
....
MerkleProofs [FixedCount][FixedCount]Variable
}
// when we have a function to get something like []Variable
func ConstructFixedProof() [FixedCount]Variable {.....}
// then if we set it into the merkle proofs, for example
Proof.MerkleProofs[index] = ConstructFixedProof()
// then it will occur errors we mentioned
@gbotrel
@SherLzp when do this happens:
// then if we set it into the merkle proofs, for example
Proof.MerkleProofs[index] = ConstructFixedProof()
Inside the Define() ? Witness creation? Please submit enough code to reproduce the issue 👍
What gnark version do you use?
@gbotrel gnark version is 0.6.0
The function ConstructFixedProof()
is out of Define(), just used for set witness.