0xMiden / 0xMiden/rust-sdk

docs: MASP inspector proc hash requires per-chunk byte-reversal before use in call.0xHEX

オープン 初心者向け
#2,463 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
78
フォーク
129
平均マージ
4日 14時間
マージ済み PR(30日)
52

説明

### Packages versions

miden-assembly-syntax 0.22.1
miden-client 0.15.x

### Bug description

The MASP inspector reports procedure hashes in big-endian per 8-byte chunk order, but `call.0xHEX` in Miden assembly parses each chunk as little-endian (per `u64::from_le_bytes` in `miden-assembly/src/parser/lexer.rs`). There is no documentation warning developers about this format mismatch.

Using the raw MASP inspector hash in `call.0xHEX` silently invokes a different or non-existent procedure, producing a wrong-proc error or silent failure with no helpful diagnostic message.

### How can this be reproduced?

1. Deploy any Miden contract with exported procedures.
2. Open the MASP inspector and copy the procedure hash for any exported procedure.
3. Use the copied hash directly in a transaction script: `call.0x`
4. The transaction silently fails or invokes a wrong/non-existent procedure.

Correct usage requires per-chunk byte-reversal before use:

```python
masp = "1f92867d5acabdfdece9a4eb6d0c2ae19359c1a7ae1fa54e1fc16cc6ab2d94c0"
chunks = [masp[i:i+16] for i in range(0, 64, 16)]
call_hex = "".join(bytes.fromhex(c)[::-1].hex() for c in chunks)
# Result: fdbdca5a7d86921fe12a0c6deba4e9ec4ea51faea7c15993c0942dabc66cc11f
# Use: call.0xfdbdca5a7d86921fe12a0c6deba4e9ec4ea51faea7c15993c0942dabc66cc11f
```

### Relevant log output

```shell
WalletTransactionError: procedure with root digest 0x1f92867d5acabdfdece9a4eb6d0c2ae19359c1a7ae1fa54e1fc16cc6ab2d94c0 could not be found
```

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

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

調査の方向性

The issue is about documenting a mismatch between the MASP inspector's hash format and the `call.0xHEX` parser. Look at the MASP inspector's output format and the parser in `miden-assembly/src/parser/lexer.rs` at `u64::from_le_bytes`. The fix is to add a note in the documentation, likely near where procedure hashes are explained or in the `call.0xHEX` instruction documentation. Check existing docs for similar warnings and see where the conversion example should be placed.

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

評価

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

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

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