Skip to content

fix(rpc): move submit proof checks off async runtime#2133

Open
Ollie202 wants to merge 1 commit into
0xMiden:nextfrom
Ollie202:fix/rpc-submit-blocking-work
Open

fix(rpc): move submit proof checks off async runtime#2133
Ollie202 wants to merge 1 commit into
0xMiden:nextfrom
Ollie202:fix/rpc-submit-blocking-work

Conversation

@Ollie202
Copy link
Copy Markdown
Contributor

@Ollie202 Ollie202 commented May 25, 2026

Partially addresses #1976.

Problem

The RPC transaction submission endpoints perform CPU-heavy proof work directly inside async request handlers:

  • SubmitProvenTx verifies the submitted transaction proof with TransactionVerifier::verify.
  • SubmitProvenTxBatch locally re-proves the proposed batch to compare it with the submitted batch proof.

Both operations can block Tokio worker threads while the RPC service is handling requests.

Changes

  • Move SubmitProvenTx transaction proof verification into spawn_blocking_in_current_span.
  • Move SubmitProvenTxBatch local batch proof comparison into spawn_blocking_in_current_span.
  • Preserve the existing invalid-argument errors for proof failures.
  • Return internal errors only if the blocking task itself fails to join.
  • Add a changelog entry for the follow-up Execution and signing is blocking in an async runtime #1976 fix.

Testing

  • cargo +nightly fmt --check --all
  • git diff --check

I also tried cargo check -p miden-node-rpc and cargo check --manifest-path crates/rpc/Cargo.toml, but both stop during dependency checkout on Windows because the current protocol dependency pulls an AggLayer submodule file with : in the filename:

tools/addRollupType/addRollupMainnet10/add_rollup_type_10_output-2025-03-11T15:54:21.263Z.json

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.

1 participant