Skip to content

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

Merged
kkovaacs merged 3 commits into
0xMiden:nextfrom
Ollie202:fix/rpc-submit-blocking-work
Jun 2, 2026
Merged

fix(rpc): move submit proof checks off async runtime#2133
kkovaacs merged 3 commits into
0xMiden:nextfrom
Ollie202:fix/rpc-submit-blocking-work

Conversation

@Ollie202

@Ollie202 Ollie202 commented May 25, 2026

Copy link
Copy Markdown
Contributor

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

@Ollie202

Ollie202 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping — all checks are green and this is a small, isolated change in the same family as #2136. Would appreciate a review whenever someone has a moment. cc @SantiagoPittella @Mirko-von-Leipzig

@Ollie202 Ollie202 force-pushed the fix/rpc-submit-blocking-work branch from e6631f2 to c6eeb0d Compare June 1, 2026 21:16
@Ollie202 Ollie202 force-pushed the fix/rpc-submit-blocking-work branch from c6eeb0d to 88f2840 Compare June 2, 2026 09:37

@kkovaacs kkovaacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@kkovaacs kkovaacs enabled auto-merge (squash) June 2, 2026 12:15
@kkovaacs kkovaacs merged commit f5c441a into 0xMiden:next Jun 2, 2026
17 checks passed
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