0xMiden / 0xMiden/tutorials

Issues with Rust tutorials

オープン 初心者向け
#191 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
18
フォーク
34
PR マージ指標
30日以内にマージされた PR はありません

説明

### Packages versions

0.14

### Bug description

# Not compiling due to not using @note_script
In tutorials 4 (iterative notes), 5 (hash preimage note), 11 (network accounts) compiling notes WILL panic because notes are not up to date with 0.14 version are are not using @note_script notation. The panic message does not convey that so users have no way of knowing that.

```asm
# Instead of

begin
# ...
end

# note script should use

@note_script
pub proc main
# ...
end
```

# Tutorial 1 - using create_library
`create_library` should not be used like that, it should use code builder from client or use a persisted source manager. Using it like this WILL lead to un-explainable and misformed errors down the line like from issue: https://github.com/0xMiden/miden-vm/issues/2778, also referenced here: https://github.com/0xMiden/tutorials/issues/188

# Tutorial 10 - pragma oracle
- does not compile, `StorageMapKey` referenced from `miden_client::rpc::domain::account` is a private struct. It should be referenced from `miden_client::account::StorageMapKey`
- When point 1 is fixed it still dies with: thread 'main' (44407) panicked at src/main.rs:156:10:
Usage: oracle_data_query , it would be better perhaps to just hardcode it into the code example or leave a comment at that line (156), we learn we need to pass it as an argument only at the end of the tutorial even though it asks us to run the code before that point
- It seems no pragma oracles are online on the current testnet, i couldnt find a live oracle address from their offish docs (which point to their github)

# Relative imports
Even though in tutorial we create the project, folders and files - masm imports in the code are relative to the directory one above root dir. Running the tutorial code will error out with: `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }. This might be confusing for some users. I would suggest creating separate crates for tutorial maybe and referencing `env!("CARGO_MANIFEST_DIR")` when loading paths, this way you can keep a monorepo of tutorials and it will still work with `--bin tutorial_name` if referenced in a workspace Cargo.toml as members.

# Nits / General

- `Cargo.toml` imports libs not needed in the tutorials: `serde`, `serde_json` and `rand_chacha`
- a lot of types are referenced in the long format like std::sync::Arc and std::Path even though they are imported in the header making code unnecessarily bloated
- imports could be compacted, they import from miden_client on multiple lines instead in one single import

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue lists specific compilation errors in tutorials 1, 4, 5, 10, and 11. Start by checking the referenced tutorial source files in the repository. For each error, locate the exact code snippet (e.g., note script syntax, create_library usage, StorageMapKey import, pragma oracle argument, relative import paths) and update it to match the 0.14 API. Verify fixes by ensuring the tutorial code compiles. Also clean up unnecessary Cargo.toml dependencies and consolidate imports as noted.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。