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

Assertion `(op.access_type == 0)' failed #1706

Closed
Tracked by #24
ax0 opened this issue Jun 15, 2023 · 1 comment · Fixed by #1751
Closed
Tracked by #24

Assertion `(op.access_type == 0)' failed #1706

ax0 opened this issue Jun 15, 2023 · 1 comment · Fixed by #1751
Assignees
Labels
bug Something isn't working

Comments

@ax0
Copy link
Contributor

ax0 commented Jun 15, 2023

Aim

Try to generate a proof for this code.

Expected Behavior

A proof should be generated.

Bug

We get the following error:

nargo: /build/cpp/src/barretenberg/dsl/acir_format/block_constraint.cpp:41: void acir_format::create_block_constraints(acir_format::Composer &, const acir_format::BlockConstraint, bool): Assertion `(op.access_type == 0)' failed.

To Reproduce

  1. Clone this repo.
  2. Navigate to tests/depth_8.
  3. Run nargo prove.

Installation Method

Compiled from source

Nargo Version

nargo 0.6.0 (git version hash: 242f07b, is dirty: false)

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@ax0 ax0 added the bug Something isn't working label Jun 15, 2023
@Savio-Sou
Copy link
Collaborator

Copying Ahmad's extra context here:

Here's a slightly simpler example (assuming you include my repo as a dependency):

use dep::trie;
use dep::trie::{get_fixed32, key_as_nibbles, KEY_LENGTH, NIBBLE_LENGTH, TrieProof32};

global N = 2;

fn main(root_hash: pub [u8; 32], trie_proof: trie::TrieProof32<100>) {
    let _r = root_hash;
    
    let key = trie_proof.key;
   
    let key_nibbles: [u4; NIBBLE_LENGTH] = key_as_nibbles(key);
    
    let mut key_offset = 0;

    let path = trie_proof.proof; // Proof path

    let depth = trie_proof.depth; // Depth of proof path

    for i in 0..N
    {
	    if (i as u8) < (depth as u8)
	    {
 	        let _lookup = get_fixed32(key_nibbles, key_offset, path); // Follow node
	    }
    }
}

The error goes away if N = 1. (get_fixed32 is called in one_level and the error does not occur there.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants