chore: migrate tutorials to protocol v0.15#204
Draft
Keinberger wants to merge 2 commits into
Draft
Conversation
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
This PR migrates all of the Miden tutorials (rust-client, web-client, and the miden-bank example) from protocol v0.14 to v0.15. The rust-client and web-client tutorials target the released v0.15 SDKs; the miden-bank example targets the v0.15 protocol plus the in-flight
nextcompiler (the sibling-call branch), so this is a draft until those land (see "Why this is a draft").Motivation
v0.15 changed a lot across the stack:
AccountStorageModefolded intoAccountType, theFungibleFaucetbuilder +TokenPolicyManager,Felt::newbecoming fallible, the fungible-asset vault-key layout,PartialNoteMetadata, the MAST wire format, and the cargo-miden#[component]/#[account]/#[note]/#[tx_script]redesign. Every tutorial needed source-verified updates, not just a version bump.Changes
rust-client
miden-client/ sqlite-store / protocol to 0.15; migrated all 11src/bin/*.rs(drop.storage_mode(),AccountType::Public,Felt::new_unchecked, theFungibleFaucet+TokenPolicyManagerfaucet, and so on).cargo buildis green.docs/src/rust-client/*.mdmigrated;cargo test --docpasses theno_runblocks.note::build_recipientbecomesnote::compute_and_store_recipient.web-client
@miden-sdk/*to 0.15.2; migratedlib/*+lib/react/*(faucettype: 0, fresh recipient accounts, thegetItem(...)StorageResult handling).miden-bank example
nextcompiler model (#[component_storage]+#[component]trait/impl,#[account]/#[note]/#[tx_script]); a newmiden-project.toml+.cargo/config.tomlper contract.get_balanceis renamed toget_depositor_balance(it collided with the built-inActiveAccount::get_balancethe account wrapper generates), and the v0.15 fungible-asset key layout (whereasset.key[2]now folds in a metadata byte) is handled through a sharedbalance_keyhelper.cargo_miden::runsignature, a.masppersist step (the FPI#[account]macro searchestarget/miden/<profile>while the compiler writestarget/midenc/miden/...), abuild_tx_script_from_packagehelper (tx-script packages areTransactionScript-kind, notExecutable), and the now-requiredInitStorageDataseeding of theinitializedslot. All MockChain tests pass (deposit x3, init, withdraw).docs/src/miden-bank/*migrated to match the code.shared docs
miden_node_setup.mdnode tagv0.14.6becomesv0.15.0.Why this is a draft
nextcompiler branch (i697-acc-sibling-call-part2), pinned by git in the contractCargo.tomls. This needs a tagged compiler release before merge, and it tracks the project-template migration in feat: migrate to next compiler SDK (protocol v0.15) project-template#51.initialize/depositbins compile but currently fail to deploy a fresh account on testnet under the part2 toolchain.submit_new_transactionaborts during local execution with an advice-map miss, because miden-client cannot supply a lazily-requested witness/foreign-account advice entry for a fresh, uncommitted account. The identical flow passes undermiden-testing's MockChain, so it is an upstream miden-client/part2 gap, not a tutorial bug. I filed it at Deploying a part2-compiled#[account]component fails at local execution: "value for key … not present in the advice map" (submit_new_transaction, new account) rust-sdk#2289, and the docs flag it as a known limitation with the MockChain tests as the verification path.Tests
cargo testis green on the part2 toolchain (deposit x3, init, withdraw via MockChain).cargo buildis green;cargo test --docpasses.Open Questions
Cargo.tomls pin thenextbranch by git. Once there is a tagged compiler release I will switch the pin. Happy to hold this PR behind feat: migrate to next compiler SDK (protocol v0.15) project-template#51 if you would rather align the template first.initialize/depositin the repo with the documented limitation + the upstream issue link, or gate them behind a notice until Deploying a part2-compiled#[account]component fails at local execution: "value for key … not present in the advice map" (submit_new_transaction, new account) rust-sdk#2289 is resolved?