Documentation Issue / Namespace Collision
While building the official Miden Bank tutorial using the latest mainnet toolchain (v0.15.3 and miden-base v0.13.1), I encountered a namespace collision and linker errors when compiling the deposit-note (or other cross-component FPI notes).
The original tutorial uses:
deposit method on the Bank account.
get_balance method on the Bank account.
The Conflict
On v0.15.3, the #[account(bank_account::BankAccount)] macro expands into FPI bindings. However:
- The
deposit function name collides with the built-in standard library's BasicWallet deposit method.
- The
get_balance function name collides with the built-in ActiveAccount's get_balance method, throwing the following error during wasm-component-ld linking:
error: dependency function get-balance collides with the built-in ActiveAccount method get_balance; the generated wrapper method would shadow it. Rename the dependency function
The Solution
To successfully compile the Miden Bank tutorial on the new mainnet toolchain:
- Rename the
deposit method to bank_deposit (or another unique name) in both the contract and the notes.
- Rename the
get_balance method to check_balance in both the contract and the notes.
I suggest updating the official tutorial repository and documentation to reflect these v0.15.3 namespace rules.
Reproduction Repo
I have compiled, tested, and resolved this in my local workspace here:
🔗 https://github.com/anaraydinli55/miden-testnet-project
Documentation Issue / Namespace Collision
While building the official Miden Bank tutorial using the latest
mainnettoolchain (v0.15.3andmiden-base v0.13.1), I encountered a namespace collision and linker errors when compiling thedeposit-note(or other cross-component FPI notes).The original tutorial uses:
depositmethod on the Bank account.get_balancemethod on the Bank account.The Conflict
On v0.15.3, the
#[account(bank_account::BankAccount)]macro expands into FPI bindings. However:depositfunction name collides with the built-in standard library'sBasicWalletdepositmethod.get_balancefunction name collides with the built-inActiveAccount'sget_balancemethod, throwing the following error duringwasm-component-ldlinking:error: dependency function get-balance collides with the built-in ActiveAccount method get_balance; the generated wrapper method would shadow it. Rename the dependency functionThe Solution
To successfully compile the Miden Bank tutorial on the new mainnet toolchain:
depositmethod tobank_deposit(or another unique name) in both the contract and the notes.get_balancemethod tocheck_balancein both the contract and the notes.I suggest updating the official tutorial repository and documentation to reflect these v0.15.3 namespace rules.
Reproduction Repo
I have compiled, tested, and resolved this in my local workspace here:
🔗 https://github.com/anaraydinli55/miden-testnet-project