bug: prove --proof writes the outputs file where verify will not look for it
- 主要言語
- Rust
- スター
- 772
- フォーク
- 352
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 93
説明
miden-vm 0.31.0 on `next`, the code is in `miden-vm/src/cli/prove.rs`.
`prove` writes two files: the proof itself, and an outputs file that only exists so `verify` can read it back. If you pass `--proof`, those two end up in different places. The proof goes where you asked, but the outputs file still gets written next to the program (`prove.rs:192`). `verify` works out where the outputs are by taking the proof path and swapping the extension (`verify.rs:109-116`), so it looks in a directory the file was never written to.
Proving to a path of your choosing and then verifying that proof doesn't work, and the error points at a file you never made:
```
$ miden-vm prove prog.masm --proof out/custom.proof
Program proved in 1298 ms
$ miden-vm verify -p out/custom.proof -x 8992a530f0d7...
Error: x Failed to open input file out/custom.inputs
```
You can see this yourself by proving any program with `--proof out/custom.proof` and then listing the files. The proof is in `out/`, the outputs are sitting next to the program. If you point verify at them by hand with `-o prog.outputs` it verifies at 96 bits, so there's nothing wrong with the proof, just where the file was put. Without `--proof` both paths come out the same and you never notice.
The inputs file is a different case, since you write that one yourself rather than the CLI generating it, so having to pass `-i` to verify seems reasonable and I haven't touched it.
I'd open a PR that takes the default outputs path from the proof path rather than the program path, with tests, if someone assigns this to me. Without `--proof` the proof path already falls back to the program path, so nothing changes for anyone not using the flag.
コントリビューションガイド
評価
この issue はまだ評価されていません。