Don't export internal procedures in the compiled package
- Dominant language
- Rust
- Stars
- 115
- Forks
- 84
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 15
Description
Discovered in #1192
The package exports and the MAST exports contain internal procedures:
```
[tests/integration/src/end_to_end/examples/counter_note.rs:35:5] package_exports = [
"\"miden:counter-contract\"::\"miden-counter-contract@0.1.0\"::\"get-count\" -> 0x42e6ad875cc27716b62c2653a94a84c86b42ebfaef9b1ceae58769fd8db54a35",
"\"miden:counter-contract\"::\"miden-counter-contract@0.1.0\"::\"increment-count\" -> 0x028811d3f83f498dc3aebd90f388c11654d80a764f901428a64c986edb7d30d4",
"::\"miden:counter-contract/miden-counter-contract@0.1.0\"::\"get-count\" -> 0xfbf5d9582443e18037624698c8a930eb0f71b211caa60a49ba3de0031acdd9aa",
"::\"miden:counter-contract/miden-counter-contract@0.1.0\"::\"increment-count\" -> 0x3fb4f19a6dec50b8f0eb80e05b3218c0a8210c878047403f4584d72512720c0e",
"::\"miden:counter-contract/miden-counter-contract@0.1.0\"::counter_contract::cabi_realloc -> 0xb66c0ef9551334e8922c0dcc297ea411e569a9c75f4e4509d005c55912a49fa1",
"::\"miden:counter-contract/miden-counter-contract@0.1.0\"::init -> 0x5ed60c1dcdccfe9a25e144b12a93f6f6803746bd3dabf4707bac4a024b253911",
]
```
Contributor guide
Research direction
The issue shows internal procedures like 'cabi_realloc' and 'init' being exported in the package and MAST exports. Look at the compiler's export generation logic, likely in codegen or linking modules. Start by examining the test file mentioned: tests/integration/src/end_to_end/examples/counter_note.rs. Understand how exports are collected and filtered. The goal is to modify the export logic to exclude internal procedures, ensuring only public contract functions like 'get-count' and 'increment-count' are exported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100