#How zkApp state is requested during proof generation?

12 messages · Page 1 of 1 (latest)

hearty pecan
#

Is it cached before execution?

    @state(Field)hashCommitment = State<Field>();
    this.hashCommitment.get()
unreal flame
#

afaik it is, why do you ask? 🤔

#

there is a async .fetch() but i think the entire zkapp state is fetched as once as some getAccount() call behind the scenes, since each account has the same 8 fields available

hearty pecan
#

I have already read that async call is not allowed inside the @method. But if we can make request to the blockchain, why we cannot make request to the off-chain?

Per docs, the code written in smart contract is compiled to the form understandable to kimchi to create circuit. I was wondering if o1js is a wrapper why would allow to make network request in method?

unreal flame
#

no the request for the on chain state is made before method execution, thats why the state can be .get() synchronously within the method

hearty pecan
#

It is cached and then retrieved during execution? Can we make sync network call 😅 (not tested yet). Or, the execution is happened in the specific env without internet?

unreal flame
#

are you working with zkdb or are you building your own off chain storage library?

hearty pecan
#

zkdb

humble blade
hearty pecan
devout shore
#

It is cached and then retrieved during execution?
yes