Skip to content

Load account and input note MastForest::advice_map before execution #1452

@greenhat

Description

@greenhat

Packages versions

miden-base: 0.9.0

Bug description

When entrypoint for the note script compiled from Rust is called, it loads data segments from the advice provider into the memory.
See counter_note entrypoint - https://github.com/0xMiden/compiler/blob/d0032e7fa22fbad1ff704fc8f9c2367067164129/tests/integration/expected/examples/counter_note.masm?plain=1#L11-L33
But when it is executed as an input note, the AdviceMapKeyNotFound is thrown:

TransactionExecutorError(TransactionProgramExecutionFailed(AdviceMapKeyNotFound { label: SourceSpan { source_id: SourceId(4294967295), start: ByteIndex(0), end: ByteIndex(0) }, source_file: None, key: [10393006917776393985, 11082306316302361448,
      8154980225314320902, 11512975618068632545] }))

I intend to make a PR with a fix - load the note's MastForest::advice_map into the advice provider somewhere in https://github.com/0xPolygonMiden/miden-base/blob/e6fa50d819d68571d49055db479301546de08a8f/crates/miden-lib/src/transaction/inputs.rs?plain=1#L287-L354

Please stop me if I'm on the wrong track.

How can this be reproduced?

Run the cargo make test test_counter_contract_testnet in 0xMiden/compiler#555

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions