ProvableHQ / leo

🦁 The Leo Programming Language. A Programming Language for Formally Verified, Zero-Knowledge Applications
https://leo-lang.org/
GNU General Public License v3.0
4.78k stars 661 forks source link

[Bug] Execution `leo run ~` command fails with InvalidCharacter error in SnarkVM #27625

Closed woon999 closed 10 months ago

woon999 commented 10 months ago

🐛 Bug Report

When attempting to execute a Leo program using leo run main '{e0:0u32, e1:0u32}' or leo run main, the process fails after compiling, indicating an error within the Aleo instructions generation phase.The error reported is InvalidCharacter { character: 'l', index: 1 }, suggesting an issue with parsing or handling specific characters in the input or the compiled Aleo instructions.

This bug prevents the execution of Leo programs, impacting the ability to test or run any Leo-based applications. It's a significant issue for developers working with Leo to develop zero-knowledge applications.

Steps to Reproduce

Code snippet to reproduce

  1. git clone this repo(https://github.com/HangryDev/Collegium_Aleo_ZKML_Tutorial/tree/main/DecisionTree/classify_bigtide)
  2. make the .env file
    NETWORK=testnet3
    PRIVATE_KEY={your_priv_key}
  3. (skip) you can skip this. cause already generated
    • py dt.py
    • py generate_dt_leo.py
  4. leo run main '{e0:0u32, e1:0u32}' <- this is the issue part

Stack trace & error message

> leo run main '{e0:0u32, e1:0u32}'
Leo ✅ Compiled 'main.leo' into Aleo instructions

Error [ECLI0377018]: Failed to execute the `execute` command.
SnarkVM Error: InvalidCharacter { character: 'l', index: 1 }

Expected Behavior

The expected behavior was for the Leo program to execute successfully, performing the operations defined in main.leo without encountering parsing or execution errors.

Your Environment

woon999 commented 10 months ago

When running the aleo program, I got an error while reading the '.env' file.

I think I got a parsing error because I mistakenly entered pubkey for PrivateKey (probably there is an exception for matching the "APrivateKey" prefix).

It would be nice to show the error more explicitly. like PrivateKey parsing error something.

anyway it works now, so I'll close it.

스크린샷 2024-02-07 오후 9 30 01