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

Nargo info fails on some contracts #2256

Closed
sirasistant opened this issue Aug 10, 2023 · 2 comments · Fixed by #2259
Closed

Nargo info fails on some contracts #2256

sirasistant opened this issue Aug 10, 2023 · 2 comments · Fixed by #2259
Assignees
Labels
bug Something isn't working

Comments

@sirasistant
Copy link
Contributor

Aim

Running nargo info on https://github.com/AztecProtocol/aztec-packages/tree/master/yarn-project/noir-contracts/src/contracts/easy_private_token_contract

Expected Behavior

It should print the info about the contract:

[EasyPrivateToken](mint) Total ACIR opcodes generated: 163
[EasyPrivateToken](mint) Backend circuit size: 11055
[EasyPrivateToken](transfer) Total ACIR opcodes generated: 489
[EasyPrivateToken](transfer) Backend circuit size: 21591
[EasyPrivateToken](getBalance) Total ACIR opcodes generated: 1
[EasyPrivateToken](getBalance) Backend circuit size: 1
[EasyPrivateToken](constructor) Total ACIR opcodes generated: 163
[EasyPrivateToken](constructor) Backend circuit size: 11055
[EasyPrivateToken](compute_note_hash_and_nullifier) Total ACIR opcodes generated: 1
[EasyPrivateToken](compute_note_hash_and_nullifier) Backend circuit size: 1

Bug

Instead I'm getting this error:

The application panicked (crashed).
Message:  internal error: entered unreachable code: Cannot assign linear term to a constrain of width 3
Location: /mnt/user-data/alvaro/.cargo/registry/src/github.com-1ecc6299db9ec823/acvm-backend-barretenberg-0.10.0/src/barretenberg_structures.rs:114

I think the cause is that the nargo info on contracts is trying to run get_exact_circuit_size on unoptimized bytecode, since adding optimize_circuit(backend, function.bytecode) avoided the panic.

To Reproduce

Installation Method

Compiled from source

Nargo Version

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@sirasistant sirasistant added the bug Something isn't working label Aug 10, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Aug 10, 2023
@sirasistant
Copy link
Contributor Author

Tagging @TomAFrench @Ethan-000

@TomAFrench TomAFrench self-assigned this Aug 10, 2023
@Ethan-000
Copy link
Contributor

Ethan-000 commented Aug 10, 2023

I think the cause is that the nargo info on contracts is trying to run get_exact_circuit_size on unoptimized bytecode, since adding optimize_circuit(backend, function.bytecode) avoided the panic.

can confirm this

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Aug 10, 2023
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