fix(rust-client): use delegated (remote) proving in the delegated-proving tutorial#207
Merged
Merged
Conversation
Collaborator
Author
|
@brianseong could you give this one a review when you get a chance? 🙏 |
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.
Overview
The "Delegated Proving" tutorial (
delegated_prover.rs+delegated_proving_tutorial.md) is supposed to teach delegated proving, but it actually proved locally: it built aLocalTransactionProver, and the doc even admitted "to keep this tutorial runnable without external services, the code below uses a local prover." Miden runs a public testnet delegated prover, so the tutorial can just do the real thing.This PR points the tutorial at the hosted testnet delegated prover so it performs actual delegated (remote) proving.
Key Changes
rust-client/src/bin/delegated_prover.rs: buildRemoteTransactionProver::new("https://tx-prover.testnet.miden.io")instead ofLocalTransactionProver, and drop it into the existingprove_transaction_with(...)call. Both implementTransactionProver, so the execute, prove, submit, apply flow is unchanged. Updated the "local prover" comment/print strings to say delegated.docs/src/rust-client/delegated_proving_tutorial.md: the same change inside therust no_runblock, corrected the prose that said the tutorial uses a local prover, and replaced the expected-output transcript, which was wrong (it showed account-balance lines this binary never prints) with the real nonce output.Rationale
No new dependency:
RemoteTransactionProveralready ships with themiden-clientthe tutorial depends on (it is the same typeClientBuilder::for_testnet()uses). I used the URL as a string literal rather than theTESTNET_PROVER_ENDPOINTconstant so a reader can see the endpoint and knows they can point it at their own prover. The privacy caveat (delegated proving reveals the transaction inputs, so it is not appropriate for the hash-preimage note tutorial) stays.Tests
Ran
delegated_proveragainst testnet: the remote prover generated the proof and Alice's nonce went 0 to 1 (exit 0).cargo test --doc(17 passed, 0 failed) andprettier --checkare green.