-
Notifications
You must be signed in to change notification settings - Fork 219
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
compiling plonk_vk.sol throws YulException: too deep in the stack & then fails to verify proof format #1140
Comments
I changed some compilation errors, and it eventually compiled in solidity. Now i am having am issue passing the proof string to the plonk_vk.sol verify function... I have tried both prepending the public inputs to the proof string, and passing just the proof string as well. Both fail. the weird thing is noir verifies the contract properly, and I am using the correct pub inputs, prepended to the proof string itself... strange. I even tried abi.encode for both pub fields, and the proof string.. I either get: or public inputs are greater than circuit modulus (IF I prepend with a "0x") |
Update: I've even tried complying with the following comment in the plonk_vk.sol file (above the verify function): /
Calldata formatting:
0x00 - 0x04 : function signature
0x04 - 0x24 : proof_data pointer (location in calldata that contains the proof_data array)
0x44 - 0x64 : length of proof_data array
0x64 - ???? : array containing our zk proof data
/ Still to no avail. I've tried several variations of this as well.... not sure what the issue is. I DID notice that within the verify function, this variable for uint256 num_public_inputs = vk.num_inputs; is wrong. My public input amount is 2, but when I log that variable in the contract it states the amount of public inputs is 3.... My TOTAL amount of inputs is 3... but public is only 2... So that makes me wonder if something is wrong with the generation process for the plonk_vk.sol process... |
Update: I still got the "proof failed" error. Here I am doing it again to show you the results. I am passing the following format:
DetailsFunction Signature
Proof Data Pointer
Length of proof data array
Public Input 1
Public Input 2
Proof Data Array
Doing this, I no longer get the If I don't prepend my proof data with the two public inputs, then I get the |
Here is the circuituse dep::std;
fn main(
// Private inputs
priv_key: Field,
// Public inputs
pubkey_x: pub Field,
pubkey_y: pub Field,
) -> pub Field {
let pubkey = std::scalar_mul::fixed_base(priv_key);
let computed_pubkey_x = pubkey[0];
let computed_pubkey_y = pubkey[1];
let x_match = if computed_pubkey_x == pubkey_x { 1 } else { 0 };
let y_match = if computed_pubkey_y == pubkey_y { 1 } else { 0 };
let success = x_match * y_match;
constrain x_match == 1;
constrain y_match == 1;
success
} Prover.toml (dummy values)pubkey_x = "0x0bff8247aa94b08d1c680d7a3e10831bd8c8cf2ea2c756b0d1d89acdcad877ad" Proof
Data passed to the plonk_vk.sol
|
Closing as proof format issue has been resolved and stack issue is being tracked in #2509 |
Aim
I run the following commands successfully:
The noir program is:
The smart contract generated is:
Expected behavior
I expect the plonk_vk.sol contract that is generated by nargo to compile.
Bug
When I simply import the plonk_vk.sol:
contract into an existing contract, I see the following error:
I am confused why I would get this from a contract noir created if the nargo compilation process succeeded. Thoughts?
To reproduce
See the above. I am compiling the plonk_vk.sol contract via forge:
using
--via-ir
is typically how you resolve this issue without refactoring. I hope i don't have to refactor the generated plonk_vk.sol contract.version
Installation method
None
Nargo version
nargo 0.3.2 (git version hash: 29b1f7d, is dirty: false)
@noir-lang/noir_wasm version
no
@noir-lang/barretenberg version
no
@noir-lang/aztec_backend version
no
Additional context
See above
Submission Checklist
The text was updated successfully, but these errors were encountered: