feat(network-monitor): compile counter program and note script at build time#2066
Open
Ollie202 wants to merge 3 commits into0xMiden:nextfrom
Open
feat(network-monitor): compile counter program and note script at build time#2066Ollie202 wants to merge 3 commits into0xMiden:nextfrom
Ollie202 wants to merge 3 commits into0xMiden:nextfrom
Conversation
…ld time Replaces runtime MASM compilation (CodeBuilder + include_str!) with build-time compilation via build.rs. The counter program is compiled to a .masl library and the increment note script to a serialized NoteScript binary, both embedded via include_bytes!. This catches protocol breakage at cargo build time rather than silently at startup. Closes 0xMiden#1831.
387ba09 to
9c17311
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1831.
Replaces runtime MASM compilation (
CodeBuilder+include_str!) with build-time compilation viabuild.rs, following the same pattern used by production components inmiden-standards.build.rscompilescounter_program.masmto a.masllibrary andincrement_counter.masmto a serializedNoteScriptbinaryinclude_bytes!and loaded once viaLazyLockdeploy/counter.rsnow exposes aCounterComponentRust struct withFrom<CounterComponent> for AccountComponent, mirroring howAuthSingleSig,BasicWallet, etc. are structured inmiden-standardscounter.rsloads the pre-compiled note script fromOUT_DIRinstead of compiling at startupcargo buildfailure, caught by CI rather than silently at runtimeTest plan
cargo build -p miden-network-monitorcompiles without errors (verifies build-time MASM compilation succeeds)cargo +nightly fmt --all --checkpassescargo clippy -p miden-network-monitorpasses