Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
787e3e8
refactor: rust code updated
Fumuran Dec 10, 2025
d4db19d
refactor: building state
Fumuran Dec 10, 2025
81a9040
refactor: updating tests part 1
Fumuran Dec 10, 2025
191adeb
refactor: updating tests -- event error WiP
Fumuran Dec 10, 2025
a4f98a7
refactor: update component procs usage, update proc imports
Fumuran Dec 11, 2025
bd5f15b
Merge branch 'next' into andrew-migrate-to-v20-vm
Fumuran Dec 11, 2025
96d1c37
refactor: update imports in nullifier_tree, update formatting
Fumuran Dec 11, 2025
facd51f
chore: update changelog
Fumuran Dec 11, 2025
b6e5295
docs: fix docs
Fumuran Dec 11, 2025
3feb14a
chore: use 0.20.1 version of the VM
Fumuran Dec 15, 2025
a1cdf82
Merge branch 'next' into andrew-migrate-to-v20-vm
Fumuran Dec 15, 2025
a0f5f08
docs: remove LibraryPath mention from docs
Fumuran Dec 15, 2025
de4774a
refactor: rename stdlib to core lib
Fumuran Dec 15, 2025
69f392c
refactor: remove in_debug_mode
Fumuran Dec 15, 2025
ce37ad5
Merge branch 'next' into andrew-migrate-to-v20-vm
bobbinth Dec 16, 2025
bff89f9
chore: Pull well-known dependencies out of account (component) interface
PhilippGackstatter Dec 16, 2025
7a17e6f
chore: Move `ERR_AUTH_...` to the epilogue category
PhilippGackstatter Dec 16, 2025
aeaa25c
chore: refactor error constant extraction for better modularity
PhilippGackstatter Dec 16, 2025
9128ed2
chore: add changelog
PhilippGackstatter Dec 16, 2025
c538b88
refactor: update changelog, clean code, rename get_procedure_root_by_…
Fumuran Dec 16, 2025
24d6195
Merge branch 'andrew-migrate-to-v20-vm' of https://github.com/0xMiden…
Fumuran Dec 16, 2025
b7c165d
Merge remote-tracking branch 'origin/next' into andrew-migrate-to-v20-vm
PhilippGackstatter Dec 17, 2025
cf010a8
Merge branch 'andrew-migrate-to-v20-vm' into pgackst-protocol-and-sta…
PhilippGackstatter Dec 17, 2025
5506d90
chore: move `add_assets_to_account` to basic wallet
PhilippGackstatter Dec 17, 2025
172e0e4
fix: remove wallet import in `miden::active_note`
PhilippGackstatter Dec 17, 2025
6fa7c96
chore: Move `AccountInterface::get_procedure_digests` to interface ext
PhilippGackstatter Dec 17, 2025
79a30ab
chore: explain tx kernel, protocol and standards errors
PhilippGackstatter Dec 17, 2025
ecaccf8
chore: use `protocol.rs` for error file name
PhilippGackstatter Dec 17, 2025
2ba3136
fix: protocol error import
PhilippGackstatter Dec 17, 2025
ee817bf
chore: adjust deny.toml to allow duplicate syn version
huitseeker Dec 19, 2025
442b87c
Merge branch 'next' into andrew-migrate-to-v20-vm
Fumuran Dec 19, 2025
f746d23
refactor: fix merge errors
Fumuran Dec 19, 2025
4046db9
Merge branch 'andrew-migrate-to-v20-vm' into pgackst-protocol-and-sta…
bobbinth Dec 20, 2025
9876cd4
Merge branch 'next' into pgackst-protocol-and-standards
bobbinth Dec 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [BREAKING] Renamed `AccountProcedureInfo` into `AccountProcedureRoot` and remove storage offset and size ([#2162](https://github.com/0xMiden/miden-base/pull/2162)).
- [BREAKING] Made `AccountProcedureIndexMap` construction infallible ([#2163](https://github.com/0xMiden/miden-base/pull/2163)).
- [BREAKING] Renamed `tracked_procedure_roots_slot` to `trigger_procedure_roots_slot` in ACL auth components for naming consistency ([#2166](https://github.com/0xMiden/miden-base/pull/2166)).
- [BREAKING] Refactor `miden-objects` and `miden-lib` into `miden-protocol` and `miden-standards` ([#2184](https://github.com/0xMiden/miden-base/pull/2184)).
- [BREAKING] Migrated to `miden-vm` v0.20 and `miden-crypto` v0.19 ([#2158](https://github.com/0xMiden/miden-base/pull/2158)).
- [BREAKING] Refactored `AccountStorageDelta` to use a new `StorageSlotDelta` type ([#2182](https://github.com/0xMiden/miden-base/pull/2182)).
- [BREAKING] Refactored account component templates into `AccountStorageSchema` ([#2193](https://github.com/0xMiden/miden-base/pull/2193)).
Expand Down
4 changes: 2 additions & 2 deletions crates/miden-lib/asm/kernels/transaction/lib/epilogue.masm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ERR_EPILOGUE_TOTAL_NUMBER_OF_ASSETS_MUST_STAY_THE_SAME="total number of as

const ERR_EPILOGUE_EXECUTED_TRANSACTION_IS_EMPTY="executed transaction neither changed the account state, nor consumed any notes"

const ERR_AUTH_PROCEDURE_CALLED_FROM_WRONG_CONTEXT="auth procedure had been called from outside the epilogue"
const ERR_EPILOGUE_AUTH_PROCEDURE_CALLED_FROM_WRONG_CONTEXT="auth procedure has been called from outside the epilogue"

const ERR_EPILOGUE_NONCE_CANNOT_BE_0="nonce cannot be 0 after an account-creating transaction"

Expand Down Expand Up @@ -220,7 +220,7 @@ proc execute_auth_procedure

# if auth procedure was called already, it must have been called by a user, which is disallowed
exec.account::was_procedure_called
assertz.err=ERR_AUTH_PROCEDURE_CALLED_FROM_WRONG_CONTEXT
assertz.err=ERR_EPILOGUE_AUTH_PROCEDURE_CALLED_FROM_WRONG_CONTEXT
# => [auth_procedure_ptr, AUTH_ARGS, pad(12)]

# execute the auth procedure
Expand Down
59 changes: 0 additions & 59 deletions crates/miden-lib/asm/miden/active_note.masm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use miden::core::mem

use miden::kernel_proc_offsets
use miden::note
use miden::contracts::wallets::basic->wallet

# ERRORS
# =================================================================================================
Expand Down Expand Up @@ -260,64 +259,6 @@ pub proc get_script_root
# => [SCRIPT_ROOT]
end

#! Adds all assets from the active note to the native account's vault.
#!
#! Inputs: []
#! Outputs: []
@locals(1024)
pub proc add_assets_to_account
# write assets to local memory starting at offset 0
# we have allocated 4 * MAX_ASSETS_PER_NOTE number of locals so all assets should fit
# since the asset memory will be overwritten, we don't have to initialize the locals to zero
locaddr.0 exec.get_assets
# => [num_of_assets, ptr = 0]

# compute the pointer at which we should stop iterating
mul.4 dup.1 add
# => [end_ptr, ptr]

# pad the stack and move the pointer to the top
padw movup.5
# => [ptr, EMPTY_WORD, end_ptr]

# loop if the amount of assets is non-zero
dup dup.6 neq
# => [should_loop, ptr, EMPTY_WORD, end_ptr]

while.true
# => [ptr, EMPTY_WORD, end_ptr]

# save the pointer so that we can use it later
dup movdn.5
# => [ptr, EMPTY_WORD, ptr, end_ptr]

# load the asset
mem_loadw_be
# => [ASSET, ptr, end_ptr]

# pad the stack before call
padw swapw padw padw swapdw
# => [ASSET, pad(12), ptr, end_ptr]

# add asset to the account
call.wallet::receive_asset
# => [pad(16), ptr, end_ptr]

# clean the stack after call
dropw dropw dropw
# => [EMPTY_WORD, ptr, end_ptr]

# increment the pointer and continue looping if ptr != end_ptr
movup.4 add.4 dup dup.6 neq
# => [should_loop, ptr+4, EMPTY_WORD, end_ptr]
end
# => [ptr', EMPTY_WORD, end_ptr]

# clear the stack
drop dropw drop
# => []
end

# HELPER PROCEDURES
# =================================================================================================

Expand Down
59 changes: 59 additions & 0 deletions crates/miden-lib/asm/miden/contracts/wallets/basic.masm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use miden::native_account
use miden::output_note
use miden::active_note

# CONSTANTS
# =================================================================================================
Expand Down Expand Up @@ -59,3 +60,61 @@ pub proc move_asset_to_note
exec.output_note::add_asset
# => [ASSET, note_idx, pad(11)]
end

#! Adds all assets from the active note to the native account's vault.
#!
#! Inputs: []
#! Outputs: []
@locals(1024)
pub proc add_assets_to_account
# write assets to local memory starting at offset 0
# we have allocated 4 * MAX_ASSETS_PER_NOTE number of locals so all assets should fit
# since the asset memory will be overwritten, we don't have to initialize the locals to zero
locaddr.0 exec.active_note::get_assets
# => [num_of_assets, ptr = 0]

# compute the pointer at which we should stop iterating
mul.4 dup.1 add
# => [end_ptr, ptr]

# pad the stack and move the pointer to the top
padw movup.5
# => [ptr, EMPTY_WORD, end_ptr]

# loop if the amount of assets is non-zero
dup dup.6 neq
# => [should_loop, ptr, EMPTY_WORD, end_ptr]

while.true
# => [ptr, EMPTY_WORD, end_ptr]

# save the pointer so that we can use it later
dup movdn.5
# => [ptr, EMPTY_WORD, ptr, end_ptr]

# load the asset
mem_loadw_be
# => [ASSET, ptr, end_ptr]

# pad the stack before call
padw swapw padw padw swapdw
# => [ASSET, pad(12), ptr, end_ptr]

# add asset to the account
call.receive_asset
# => [pad(16), ptr, end_ptr]

# clean the stack after call
dropw dropw dropw
# => [EMPTY_WORD, ptr, end_ptr]

# increment the pointer and continue looping if ptr != end_ptr
movup.4 add.4 dup dup.6 neq
# => [should_loop, ptr+4, EMPTY_WORD, end_ptr]
end
# => [ptr', EMPTY_WORD, end_ptr]

# clear the stack
drop dropw drop
# => []
end
3 changes: 2 additions & 1 deletion crates/miden-lib/asm/note_scripts/P2ID.masm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use miden::active_account
use miden::account_id
use miden::active_note
use miden::contracts::wallets::basic->basic_wallet

# ERRORS
# =================================================================================================
Expand Down Expand Up @@ -47,6 +48,6 @@ begin
exec.account_id::is_equal assert.err=ERR_P2ID_TARGET_ACCT_MISMATCH
# => []

exec.active_note::add_assets_to_account
exec.basic_wallet::add_assets_to_account
# => []
end
5 changes: 3 additions & 2 deletions crates/miden-lib/asm/note_scripts/P2IDE.masm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use miden::active_account
use miden::account_id
use miden::active_note
use miden::tx
use miden::contracts::wallets::basic->basic_wallet

# ERRORS
# =================================================================================================
Expand Down Expand Up @@ -64,7 +65,7 @@ proc reclaim_note
# => []

# add note assets to account
exec.active_note::add_assets_to_account
exec.basic_wallet::add_assets_to_account
# => []
end

Expand Down Expand Up @@ -130,7 +131,7 @@ begin

if.true
# we can safely consume the note since the active account is the target of the note
dropw exec.active_note::add_assets_to_account
dropw exec.basic_wallet::add_assets_to_account
# => []

else
Expand Down
Loading