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

InvalidFEOpcode when running Hello ZoKrates #1371

Open
trojanMcAfee opened this issue Jun 4, 2024 · 0 comments
Open

InvalidFEOpcode when running Hello ZoKrates #1371

trojanMcAfee opened this issue Jun 4, 2024 · 0 comments

Comments

@trojanMcAfee
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant