You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling this.experimental.authorize(accountUpdate) inside a smart contract method, a stack overflow error occurs. This happens because inside toAuxiliary, the function will call cloneCircuitValue on a.lazyAuthorization and recursively call cloneCircuitValue until it blows up the stack.
MartinMinkov
changed the title
StackOverflow error caused by cloning lazyAuthorization inside toAuxiliary
StackOverflow error caused by cloning lazyAuthorizationOct 13, 2022
I think the solution might just be to not clone the lazyAuthorization. I can't think of a reason we'd have to clone it.
I didn't investigate the error, but my guess would be that it's something like this: a lazy proof contains everything needed to recreate that proof, including the method arguments. these method arguments can now be account updates themselves. these account updates again contain lazy proofs and children, which both can contain further account updates. Maybe there's some infinite loop of references to account updates occurring there, at least it sounds possible
Description
When calling
this.experimental.authorize(accountUpdate)
inside a smart contract method, a stack overflow error occurs. This happens because insidetoAuxiliary
, the function will callcloneCircuitValue
ona.lazyAuthorization
and recursively callcloneCircuitValue
until it blows up the stack.See this line here: https://github.com/o1-labs/snarkyjs/blob/ecffd00ecb39f6aa24f2ead47e51eda570ab8071/src/lib/account_update.ts#L1095
This was confirmed by commenting out the
cloneCircuitValue
call and ensuring that no stack overflow error occurs.The text was updated successfully, but these errors were encountered: