Skip to content

Commit 671a9dc

Browse files
committed
fix: adapt metadata MASM to little-endian word ordering after upstream migration
The upstream LE migration (PR #2512) changed get_item to return [word[0], ..., word[3]] (word[0] on top) instead of [word[3], ..., word[0]]. This commit: - Reverses element extraction logic in all getters (get_token_metadata, get_max_supply, get_decimals, get_token_symbol, get_token_supply, mutability checks) - Fixes mutability flag extraction in all optional setters - Fixes max_supply replacement logic in optional_set_max_supply - Changes loc_storew_be/loc_loadw_be to loc_storew_le/loc_loadw_le to preserve natural word element ordering in memory for hash computations - Updates test hasher from Rpo256 to Poseidon2 to match MASM poseidon2 module - Fixes get_owner stack depth (get_item returns +2 net elements with 2-felt slot IDs) - Updates all inline MASM test assertions to match LE stack ordering
1 parent 13878ca commit 671a9dc

3 files changed

Lines changed: 127 additions & 122 deletions

File tree

crates/miden-standards/asm/standards/access/ownable.masm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ end
8989
#! Invocation: call
9090
pub proc get_owner
9191
exec.owner
92+
# => [owner_suffix, owner_prefix, pad(16)] depth=18
93+
# get_item returns 4 elements from 2 inputs (net +2); owner drops 2, leaving +2 excess.
94+
# Remove 2 excess pad elements to restore call-convention depth of 16.
95+
movup.2 drop movup.2 drop
9296
# => [owner_suffix, owner_prefix, pad(14)]
9397
end
9498

0 commit comments

Comments
 (0)