Skip to content

Update Tutorials to 0.11.0#110

Merged
partylikeits1983 merged 16 commits intomainfrom
0.11.0
Sep 10, 2025
Merged

Update Tutorials to 0.11.0#110
partylikeits1983 merged 16 commits intomainfrom
0.11.0

Conversation

@partylikeits1983
Copy link
Collaborator

This PR updates the tutorials to 0.11.x

@partylikeits1983 partylikeits1983 marked this pull request as ready for review September 3, 2025 18:01
@mmagician mmagician requested a review from Copilot September 4, 2025 07:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.x to 0.11.x
  • Replaced deprecated API patterns with new equivalents (e.g., filesystem_keystoreauthenticator)
  • 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.

Copy link
Collaborator

@Dominik1999 Dominik1999 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I left some comments, but only minor things. I didn't try to run it though.

.filesystem_keystore("./keystore")
.in_debug_mode(true)
.authenticator(keystore)
.in_debug_mode(true.into())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we have to put a true into something here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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!(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the correct usage now? Or would here the interface be Alice's basic wallet?

@bobbinth

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()))])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this inputed as unauthenticated input note? Isn't the note authenticated on the testnet already at this point?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

To be addressed with 0xMiden/miden-client#467, but it's a larger piece of work

docs/Cargo.toml Outdated
Comment on lines +7 to +9
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"] }
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can stick to minor versions here and remove the patch version

Copy link
Collaborator

Choose a reason for hiding this comment

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

@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)

@partylikeits1983 partylikeits1983 merged commit 889b3c9 into main Sep 10, 2025
5 checks passed
The final `src/main.rs` file should look like this:

```rust
```rust,no_run
Copy link
Collaborator

Choose a reason for hiding this comment

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

@partylikeits1983 why did this change to no_run? It sort of defeats the purpose of #89

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe because FPI is not working with the current client release

Copy link
Collaborator

Choose a reason for hiding this comment

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

but many of the tests that are now no_run are not using FPI

Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

4 participants