0xMiden / 0xMiden/protocol

`ProvenBatch::new` should validate invariants

オープン
#1,691 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
132
フォーク
167
平均マージ
1日 23時間
マージ済み PR(30日)
110

説明

### Feature description

Batch invariants are currently checked by `ProposedBatch::new` and _not_ by `ProvenBatch::new`. This means its possible to construct invalid `ProvenBatch`s.

We should improve this by checking these invariant's whenever a `ProvenBatch` can be constructed from unsafe data/types.

We _should_ probably also create an escape hatch `new_unchecked` (or some similar mechanism) that can be used when we _know_ the invariants have already been checked. For example, when transforming a `ProposedBatch` into a `ProvenBatch`. An alternative is to add `ProposedBatch::prove` which would allow this transformation implicitly.

### Why is this feature needed?

`ProvenBatch` will be deserialized from user input meaning it should not be implicitly trusted. This feature _should_ afford deserialized batches the same invariant protection as those created from `ProposedBatch`.

https://github.com/0xMiden/miden-node/pull/1130#discussion_r2253675275

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

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

評価

この issue はまだ評価されていません。

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

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