feat(network-monitor): inline .masm scripts as Rust string constants#2059
feat(network-monitor): inline .masm scripts as Rust string constants#2059Ollie202 wants to merge 2 commits into0xMiden:mainfrom
Conversation
Replace the counter_program.masm and increment_counter.masm asset files with inline Rust string constants. Introduce CounterComponent following the IncrNonceAuthComponent pattern from miden-standards, backed by a LazyLock-compiled Library with a From impl. The note script is similarly inlined as INCREMENT_NOTE_SCRIPT in counter.rs. Closes 0xMiden#1831
Mirko-von-Leipzig
left a comment
There was a problem hiding this comment.
This just inlines the masm as a string.
The intent of the issue is to write the accounts in rust and then use the Miden rust compiler to compile this to masm.
|
Closing — misunderstood the intent. Will reimplement using the Miden Rust compiler to compile Rust account code to MASM rather than just inlining the existing MASM as strings. |
|
Thanks for the clarification. I dug into the The issue I ran into is that So I wanted to check before going further:
Happy to go whichever route makes sense. |
Summary
Closes #1831
counter_program.masmasCOUNTER_PROGRAM_CODE: &strconstant indeploy/counter.rsCounterComponentstruct following theIncrNonceAuthComponentpattern frommiden-standards, with aLazyLock-compiledLibraryand aFromimplincrement_counter.masmasINCREMENT_NOTE_SCRIPT: &strconstant incounter.rs.masmasset filesThe MASM logic is unchanged — only the delivery mechanism changes from external files to Rust constants, improving maintainability and reducing the risk of protocol changes slipping through unnoticed.
Test plan