Zokrates/ZoKrates

InvalidFEOpcode when running Hello ZoKrates

trojanMcAfee opened this issue · 0 comments

Description

When running the Hello ZoKrates! demo from the docs, the proof verification reverts with an InvalidFEOpcode error when calling the deployed verifier, which is given by the output of running zokrates export-verifier.

Environment

  • Compiler version: 0.8.25 (but tested also with 0.8.18)
  • Operating system: macOS Sonoma 14.5
  • ZoKrates version: 0.8.8

Steps to Reproduce

I'm using the code and commands from the Hello ZoKrates! tutorial from the docs. The only part that I coded myself was the decoding of the JSON data and the call to verifyTx():

struct RootStruct {
        string curve;
        bytes32[] inputs;
        Verifier.Proof proof;
        string scheme;
 }

RootStruct memory rootStruct = abi.decode(data, (RootStruct));
uint[1] memory input = [uint(rootStruct.inputs[0])];
 verifier.verifyTx(rootStruct.proof, input);

The revert happens in this assembly block of the call to the internal function pairing(), inside the verifier:

assembly {
       success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)
       switch success case 0 { invalid() }
}

When running it against an anvil node, it throws this warning before reverting:

EIP-3855 is not supported in one or more of the RPCs used.
Unsupported Chain IDs: 31337.
Contracts deployed with a Solidity version equal or higher than 0.8.20 might not work properly.
For more information, please see https://eips.ethereum.org/EIPS/eip-3855

But when I run it against a mainnet fork the same error gets thrown, just that without the warning (tried with 0.8.18 and same issue).