0xMiden / 0xMiden/protocol

Clean up note script minify and compact APIs

Aperta
#3,196 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
132
Fork
167
Merge medio
1g 23h
PR unite (30g)
110

Descrizione

#3146 moved debug info out of `MastForest`. That changed what note script compaction means.

Motivating PR comments:

- https://github.com/0xMiden/protocol/pull/3146#discussion_r3515743236
- https://github.com/0xMiden/protocol/pull/3146#discussion_r3516237946

The old names now confuse two things:

- compacting the MAST forest.
- dropping package debug info.

The main paths are:

- [`crates/miden-protocol/src/note/script.rs`](https://github.com/0xMiden/protocol/blob/2432a082e53c7e16b2885c8ee42e05489480358c/crates/miden-protocol/src/note/script.rs#L238-L266) has `compact()` and the deprecated `clear_debug_info()` wrapper. The compact API changed in #3146, so this permalink points at the PR head.
- [`crates/miden-protocol/src/note/recipient.rs`](https://github.com/0xMiden/protocol/blob/2432a082e53c7e16b2885c8ee42e05489480358c/crates/miden-protocol/src/note/recipient.rs#L67-L70), [`crates/miden-protocol/src/note/details.rs`](https://github.com/0xMiden/protocol/blob/2432a082e53c7e16b2885c8ee42e05489480358c/crates/miden-protocol/src/note/details.rs#L70-L73), and [`crates/miden-protocol/src/note/mod.rs`](https://github.com/0xMiden/protocol/blob/2432a082e53c7e16b2885c8ee42e05489480358c/crates/miden-protocol/src/note/mod.rs#L197-L200) forward `minify_script()`.
- [`crates/miden-protocol/src/transaction/outputs/notes.rs`](https://github.com/0xMiden/protocol/blob/2432a082e53c7e16b2885c8ee42e05489480358c/crates/miden-protocol/src/transaction/outputs/notes.rs#L497-L501) calls `minify_script()` before checking the note size.

Please remove or rename the old `minify_script` and `clear_debug_info` surface.

Keep one clear API for compacting a note script MAST forest. Make any debug info drop explicit.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.