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

jsoo can't parse large data structures #738

Closed
Trivo25 opened this issue Feb 21, 2023 · 4 comments · Fixed by #1334
Closed

jsoo can't parse large data structures #738

Trivo25 opened this issue Feb 21, 2023 · 4 comments · Fixed by #1334
Assignees
Labels
bug Something isn't working product-eng For tracking our team's issues to-research v1 Prerequisite for o1js v1.0

Comments

@Trivo25
Copy link
Member

Trivo25 commented Feb 21, 2023

jsoo seems to have issues parsing large javascript data structures (arrays, objects) that exceed some limit.

class LargeStructure extends Struct({
	a: Field,
	b: Field,
	c: Field,
	d: Field,
	//...
}) {}

const Prover = Experimental.ZkProgram({
  publicInput: Field,

  methods: {
    baseCase: {
      privateInputs: [Circuit.array(LargeStructure, 4)],

      method(publicInput: Field, arr: LargeStructure[]) {
        publicInput.equals(1);
      },
    },
  },
});

while 4 elements in the array work, 8 won't. Easy workaround: Splitting up large structures into multiple smaller ones myFunc(a: SmallStruct, b: SmallStruct, c: SmallStruct)

@mitschabaude
Copy link
Member

is it a stack overflow error? would be nice to trace where it comes from, we might be able to refactor the OCaml code

@mitschabaude mitschabaude added the bug Something isn't working label Apr 3, 2023
@nicc
Copy link
Collaborator

nicc commented May 1, 2023

Check in before committing to fix if it's a lot of effort. We could provide a better error message instead

@nicc nicc added the product-eng For tracking our team's issues label May 5, 2023
@mitschabaude
Copy link
Member

other related issues:
#144
#147

@mitschabaude
Copy link
Member

To investigate as well: #1210

@mitschabaude mitschabaude self-assigned this Dec 18, 2023
@mitschabaude mitschabaude reopened this Dec 18, 2023
@garwalsh garwalsh added the v1 Prerequisite for o1js v1.0 label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product-eng For tracking our team's issues to-research v1 Prerequisite for o1js v1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants