Closed dfstio closed 3 weeks ago
I solved it by creating a tiny ZkProgram that verifies the signature and by providing the proof instead of the signature as an argument to the SmartContract method.
that's a confusing error for sure
I can not even deploy contract anymore, could you please link the code @dfstio
I can not even deploy contract anymore, could you please link the code @dfstio
The code I'm referring to is at the signature-error branch. Unfortunately, I was not able to create a minimum reproducible example; all examples were working without this error; I've seen it only on a real big contract: https://github.com/dfstio/minanft-lib/blob/signature-error/src/contract/nft.ts#L142
If you're unable to deploy the contract, check first that you are using o1js 0.18.0 and deploying to devnet.
It is also reported in Discord: https://discord.com/channels/484437221055922177/1234393036264443967
The error looks vaguely reminiscent of https://github.com/o1-labs/o1js/pull/1335 but in fact the stack trace differs if you look closely
This error can be reproduced with this repo: https://github.com/dfstio/minanft-lib/tree/signature-error
The branch is signature-error, to reproduce the error you need to
Add env.json
{
"DEPLOYER": "",
"DEPLOYER_API": "",
"PINATA_JWT": "",
"DEPLOYERS": [],
"DEPLOYERS_API": []
}
Run yarn
to install dependencies
Run yarn test tests/transfer
, it will give the error Commit failed Error: Option.value_exn None
and call stack
The line that causes the error is https://github.com/dfstio/minanft-lib/blob/signature-error/src/contract/nft.ts#L142
I can not even deploy contract anymore, could you please link the code @dfstio
The code I'm referring to is at the signature-error branch. Unfortunately, I was not able to create a minimum reproducible example; all examples were working without this error; I've seen it only on a real big contract: https://github.com/dfstio/minanft-lib/blob/signature-error/src/contract/nft.ts#L142
If you're unable to deploy the contract, check first that you are using o1js 0.18.0 and deploying to devnet.
Absolutely, but does it work with localBlockchain?
It did not work for me even for localBlockchain, i am still on downgraded o1js, unfortunately
Absolutely, but does it work with localBlockchain?
It did not work for me even for localBlockchain, i am still on downgraded o1js, unfortunately
My code works now with local blockchain, lightnet and devnet. Berkeley testnet is not supported anymore by the last version of o1js. This specific example with a signature throws an error on the local blockchain.
Make sure you use await everywhere with the last o1js; the deployment can fail if you forget to do it in some line.
Proving the following code with o1js 0.18.0
throws the error while proving. This occurs only when there is another unused method in the SmartContract that also verifies the signature. If comment the line with the verification of the signature in the other method, the code works as expected. The code of the other method is
Unfortunately, I was unable to create a minimum reproducible example, so simply sharing the log