Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate procedures from miden-lib #1002

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -19,6 +19,7 @@
- [BREAKING] Refactor error messages in `miden-lib` and `miden-tx` and use `thiserror` 2.0 (#1005).
- [BREAKING] Extend `AccountId` to two `Felt`s and require block hash in derivation (#982).
- Removed workers list from the proxy configuration file (#1018).
- [BREAKING] Moved the duplicate `masm` procedures to the `utils` module (#1002).
- Added tracing to the `miden-tx-prover` CLI (#1014).
- Added metrics to the `miden-tx-prover` proxy (#1017).
- Implemented `to_hex` for `AccountIdPrefix` and `epoch_block_num` for `BlockHeader` (#1039).
Expand Down
15 changes: 8 additions & 7 deletions miden-lib/asm/kernels/transaction/api.masm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use.std::collections::smt
use.std::sys

use.kernel::util::account_id
use.kernel::account
use.kernel::asset_vault
use.kernel::constants
Expand Down Expand Up @@ -193,7 +194,7 @@ export.get_account_item
# => [storage_offset, storage_size, index, pad(15)]

# apply offset to storage slot index
exec.account::apply_storage_offset
exec.account_id::apply_storage_offset
# => [index_with_offset, pad(15)]

# fetch the account storage item
Expand Down Expand Up @@ -228,8 +229,8 @@ export.set_account_item

# if the transaction is being executed against a faucet account then assert
# index != FAUCET_STORAGE_DATA_SLOT (reserved slot)
dup exec.account::get_faucet_storage_data_slot eq
exec.account::get_id swap drop exec.account::is_faucet
dup exec.account_id::get_faucet_storage_data_slot eq
exec.account::get_id swap drop exec.account_id::is_faucet
and assertz.err=ERR_FAUCET_STORAGE_DATA_SLOT_IS_RESERVED
# => [index, V', pad(11)]

Expand All @@ -238,7 +239,7 @@ export.set_account_item
# => [storage_offset, storage_size, index, V', pad(11)]

# apply offset to storage slot index
exec.account::apply_storage_offset
exec.account_id::apply_storage_offset
# => [index_with_offset, V', pad(11)]

# set the account storage item
Expand Down Expand Up @@ -279,7 +280,7 @@ export.get_account_map_item
# => [storage_offset, storage_size, index, KEY, pad(11)]

# apply offset to storage slot index
exec.account::apply_storage_offset
exec.account_id::apply_storage_offset
# => [index_with_offset, KEY, pad(11)]

# fetch the account storage item, which is ROOT of the map
Expand Down Expand Up @@ -325,7 +326,7 @@ export.set_account_map_item.1
# => [storage_offset, storage_size, index, KEY, NEW_VALUE, pad(7)]

# apply offset to storage slot index
exec.account::apply_storage_offset
exec.account_id::apply_storage_offset
# => [index_with_offset, KEY, NEW_VALUE, pad(7)]

# store index for later
Expand Down Expand Up @@ -820,7 +821,7 @@ end
#! Invocation: dynexec
export.get_fungible_faucet_total_issuance
# assert that we are executing a transaction against a fungible faucet (access checks)
exec.account::get_id swap drop exec.account::is_fungible_faucet
exec.account::get_id swap drop exec.account_id::is_fungible_faucet
assert.err=ERR_ACCOUNT_TOTAL_ISSUANCE_PROC_CAN_ONLY_BE_CALLED_ON_FUNGIBLE_FAUCET
# => [pad(16)]

Expand Down
Loading
Loading