Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates all tutorial dependencies to 0.11.x versions, bringing the Miden Rust client examples in line with the latest API changes and best practices.
- Updated package versions across all tutorials from
0.10.xto0.11.x - Replaced deprecated API patterns with new equivalents (e.g.,
filesystem_keystore→authenticator) - Fixed authentication component imports and usage throughout examples
Reviewed Changes
Copilot reviewed 15 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust-client/Cargo.toml | Updated all miden dependencies to 0.11.x versions and tokio to 1.46 |
| masm/accounts/count_reader.masm | Added debug.stack call and fixed exec.account::set_item usage |
| docs/src/rust-client/unauthenticated_note_how_to.md | Updated dependencies, imports, and API usage patterns |
| docs/src/rust-client/public_account_interaction_tutorial.md | Updated dependencies and modernized client initialization |
| docs/src/rust-client/oracle_tutorial.md | Updated dependencies and replaced deprecated API patterns |
| docs/src/rust-client/network_transactions_tutorial.md | Updated dependencies and modernized authentication handling |
| docs/src/rust-client/mint_consume_create_tutorial.md | Updated dependencies and replaced helper functions with direct API usage |
| docs/src/rust-client/mappings_in_masm_how_to.md | Updated dependencies and modernized script compilation |
| docs/src/rust-client/foreign_procedure_invocation_tutorial.md | Updated dependencies and API usage patterns |
| docs/src/rust-client/delegated_proving_tutorial.md | Updated dependencies and simplified client initialization |
| docs/src/rust-client/custom_note_how_to.md | Updated dependencies and modernized note handling |
| docs/src/rust-client/creating_notes_in_masm_tutorial.md | Updated dependencies and note script compilation |
| docs/src/rust-client/create_deploy_tutorial.md | Updated dependencies and account creation patterns |
| docs/src/rust-client/counter_contract_tutorial.md | Updated dependencies and script compilation |
| docs/Cargo.toml | Updated all miden dependencies to 0.11.x versions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| .filesystem_keystore("./keystore") | ||
| .in_debug_mode(true) | ||
| .authenticator(keystore) | ||
| .in_debug_mode(true.into()) |
There was a problem hiding this comment.
Why do we have to put a true into something here?
There was a problem hiding this comment.
Yes, its very verbose. This is just how this method works now on the ClientBuilder. Would be great if we could simplify this back to how it used to be. Default would be no debug mode, .in_debug_mode() would be for debug mode. https://github.com/0xMiden/miden-client/blob/165355be151af8862c918945c1601d83005d93e2/crates/rust-client/src/builder.rs#L99
cc @mmagician
| .unwrap(); | ||
|
|
||
| println!("Alice's account ID: {:?}", alice_account.id().to_bech32(NetworkId::Testnet)); | ||
| println!( |
There was a problem hiding this comment.
Is this the correct usage now? Or would here the interface be Alice's basic wallet?
| let secret = [Felt::new(1), Felt::new(2), Felt::new(3), Felt::new(4)]; | ||
| let consume_custom_request = TransactionRequestBuilder::new() | ||
| .unauthenticated_input_notes([(custom_note, Some(secret))]) | ||
| .unauthenticated_input_notes([(custom_note, Some(secret.into()))]) |
There was a problem hiding this comment.
Why is this inputed as unauthenticated input note? Isn't the note authenticated on the testnet already at this point?
There was a problem hiding this comment.
I try to avoid as much as possible to use Sleep(Duration::from_secs(x) in the example code; using .unauthenticated_input_notes means we don't have to wait for the note to be committed in the block, we can already go ahead and submit the subsequent tx.
Sort of related: Would be very useful to have a method on the client that would wait for a tx to be committed.
cc @mmagician
There was a problem hiding this comment.
To be addressed with 0xMiden/miden-client#467, but it's a larger piece of work
docs/Cargo.toml
Outdated
| miden-client = { version = "0.11.2", features = ["testing", "tonic", "sqlite"] } | ||
| miden-lib = { version = "0.11.1", default-features = false } | ||
| miden-objects = { version = "0.11.1", default-features = false, features = ["testing"] } |
There was a problem hiding this comment.
We can stick to minor versions here and remove the patch version
There was a problem hiding this comment.
@partylikeits1983 since I just saw this: chore: bump versions and update to testnet
if we remove patch versions (i.e. keep { version = "0.11", ... }, then the latest version will be fetched for new users (and if you already have a local Cargo.lock, running cargo update will bring you up to the latest patch)
| The final `src/main.rs` file should look like this: | ||
|
|
||
| ```rust | ||
| ```rust,no_run |
There was a problem hiding this comment.
@partylikeits1983 why did this change to no_run? It sort of defeats the purpose of #89
There was a problem hiding this comment.
Maybe because FPI is not working with the current client release
There was a problem hiding this comment.
but many of the tests that are now no_run are not using FPI
This PR updates the tutorials to
0.11.x