Skip to content

fix(network-monitor): move local proving off async runtime#2136

Open
Ollie202 wants to merge 5 commits into
0xMiden:nextfrom
Ollie202:fix/network-monitor-blocking-work
Open

fix(network-monitor): move local proving off async runtime#2136
Ollie202 wants to merge 5 commits into
0xMiden:nextfrom
Ollie202:fix/network-monitor-blocking-work

Conversation

@Ollie202

@Ollie202 Ollie202 commented May 26, 2026

Copy link
Copy Markdown
Contributor

Partially addresses #1976.

Summary

The network monitor performed local transaction execution and proof generation directly from async code in two places: counter account deployment and periodic counter increment submission. Both paths can run CPU-heavy VM/prover work without yielding and starve Tokio worker threads.

This PR moves both execution/proving paths into spawn_blocking_in_current_span. For increments, the blocking closure now constructs its own MonitorDataStore from the current block header, wallet account, and counter account. This avoids cloning or maintaining duplicate datastore state in TxBuilder.

Testing

  • cargo +nightly fmt --all --check -- --config-path .config/rustfmt.toml
  • cargo xtask fmt-comments --check --rustfmt-config .config/rustfmt.toml
  • git diff --check upstream/next...HEAD
  • GitHub CI: build, tests, lints, docs, stress test, WASM targets, and all Docker builds

A local cargo check -p miden-network-monitor --locked is blocked on Windows by the repository's proto build include-path handling; the Linux CI build and test jobs pass.

Changelog

changelog = "none"
reason    = "Internal async-runtime refactor only; no public interface or released behavior changes."

Comment thread bin/network-monitor/src/deploy/mod.rs Outdated
Comment thread CHANGELOG.md Outdated
@Ollie202 Ollie202 force-pushed the fix/network-monitor-blocking-work branch from 53b4ea4 to ce36808 Compare May 28, 2026 14:04
@Ollie202 Ollie202 requested a review from SantiagoPittella May 28, 2026 14:26
@Ollie202

Ollie202 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

@SantiagoPittella following up on your two review comments — both have been addressed in the latest push (the deploy path no longer uses spawn_blocking and the changelog entry has been dropped). The changelog check is now red because the diff no longer touches CHANGELOG.md. Per your review, this PR doesn't need an entry — could you apply the no changelog label so the check turns green? Then this should be ready for another look. Thanks!

@Ollie202 Ollie202 force-pushed the fix/network-monitor-blocking-work branch from fc75b51 to 0efd5d4 Compare June 2, 2026 09:34
Comment thread bin/network-monitor/src/deploy/mod.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants