0xMiden / 0xMiden/protocol

Clean up note script minify and compact APIs

Open
#3,196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
132
Forks
167
Avg merge
1d 23h
Merged PRs (30d)
110

Description

#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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.