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

The application panicked (crashed), Message: no entry found for key #7084

Closed
Nithin-Varma opened this issue Jan 16, 2025 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@Nithin-Varma
Copy link

Aim

I am just trying to compile the private-counter example from the this documentation.

Expected Behavior

it should compile the code when i run aztec-nargo compile

Bug

The application panicked (crashed).
Message: no entry found for key
Location: compiler/noirc_frontend/src/node_interner.rs:1096

This is a bug. We may have already fixed this in newer versions of Nargo so try searching for similar issues at https://github.com/noir-lang/noir/issues/.
If there isn't an open issue for this bug, consider opening one at https://github.com/noir-lang/noir/issues/new?labels=bug&template=bug_report.yml
nithin@nithins-MacBook-Pro counter % aztec-nargo compile

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@Nithin-Varma Nithin-Varma added the bug Something isn't working label Jan 16, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 16, 2025
@TomAFrench
Copy link
Member

@noir-lang/developerrelations looks like Nithin is running into issues with aztec docs.

@Nithin-Varma Can you provide the code you're trying to compile and the version of nargo you're compiling with?

@Nithin-Varma
Copy link
Author

Nithin-Varma commented Jan 16, 2025

@TomAFrench

use aztec::macros::{functions::{initializer, private}, storage::storage};
use aztec::prelude::{AztecAddress, Map};
use easy_private_state::EasyPrivateUint;
use value_note::{balance_utils, value_note::ValueNote};

#[storage]
struct Storage {
counters: Map<AztecAddress, EasyPrivateUint, Context>,
}

#[initializer]
#[private]
fn initialize(headstart: u64, owner: AztecAddress) {
let counters = storage.counters;
counters.at(owner).add(headstart, owner, context.msg_sender());
}

#[private]
fn increment(owner: AztecAddress, sender: AztecAddress) {
unsafe {
dep::aztec::oracle::debug_log::debug_log_format(
"Incrementing counter for owner {0}",
[owner.to_field()],
);
}
let counters = storage.counters;
counters.at(owner).add(1, owner, sender);
}

unconstrained fn get_counter(owner: AztecAddress) -> pub Field {
let counters = storage.counters;
balance_utils::get_balance(counters.at(owner).set)
}

at this point i am just following docs to understand compiler and outputs better
nargo - 1.0.0
aztec - 0.67.0

i tried with 0.69.1 as well but seems like there are few issues with 0.69.1 while starting sandbox, so i downgraded to the 0.67.0

@critesjosh
Copy link
Contributor

The documentation is linked to a specific version, so if you are trying compile a contract from the current docs with an older version of aztec-nargo, it wont work, you need to use the corresponding version source code. You can find the counter contract source for version 0.67.0 here: https://github.com/AztecProtocol/aztec-packages/blob/barretenberg-v0.67.0/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr

You can find the code snippets for the corresponding sections wrapping in comments like // docs:start:storage_struct.

I just tried it with the counter contract source at version tag 0.67.0 and it compiles.

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jan 16, 2025
@Nithin-Varma
Copy link
Author

The documentation is linked to a specific version, so if you are trying compile a contract from the current docs with an older version of aztec-nargo, it wont work, you need to use the corresponding version source code. You can find the counter contract source for version 0.67.0 here: https://github.com/AztecProtocol/aztec-packages/blob/barretenberg-v0.67.0/noir-projects/noir-contracts/contracts/counter_contract/src/main.nr

You can find the code snippets for the corresponding sections wrapping in comments like // docs:start:storage_struct.

I just tried it with the counter contract source at version tag 0.67.0 and it compiles.

please mention this in the documentation, so that people who new to it wont get confused.
also, there is an error while running the sandbox with 0.69.1 version, to run sandbox i have downgraded to 0.67.0.
thank you for your response, will try with above code.

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

No branches or pull requests

3 participants