Skip to content

feat: lazy foreign account assets and storage map items#1888

Merged
PhilippGackstatter merged 14 commits intonextfrom
pgackst-lazy-foreign-asset-storage-loading
Sep 22, 2025
Merged

feat: lazy foreign account assets and storage map items#1888
PhilippGackstatter merged 14 commits intonextfrom
pgackst-lazy-foreign-asset-storage-loading

Conversation

@PhilippGackstatter
Copy link
Copy Markdown
Contributor

Enabled lazy loading of assets and storage map items for foreign accounts during transaction execution.

This also fixes lazy loading for assets for account_get_balance and account_has_non_fungible_asset, which was overlooked in #1848. To that end, procedures of those names are added in $kernel::account, to keep all account events in the account module.

This was tested manually by removing these lines and running the tests in test_fpi.rs:

https://github.com/0xMiden/miden-base/blob/fdf7c0e47191277a95f0ce29abb7b2d7f0a9d754/crates/miden-lib/src/transaction/inputs.rs#L263-L271

I also added a test for foreign accounts calling the above APIs.

However, this is not tested as part of CI currently, because enabling that isn't straightforward without adding enable_lazy_loading: bool flags to TransactionAdviceInputs or similar solutions. This doesn't seem worth adding, especially because lazy loading should become the default once #1872 and #1879 are done, and then lazy loading will be tested in every test accessing an asset or storage map item implicitly.

This should conclude the initial implementation of lazy loading, but let me know if you think there's more missing.

closes #401

Copy link
Copy Markdown
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Left just two small nits

@PhilippGackstatter PhilippGackstatter force-pushed the pgackst-partial-account-seed branch from 6cb75cf to 35993b3 Compare September 16, 2025 06:18
Base automatically changed from pgackst-partial-account-seed to next September 16, 2025 06:25
@PhilippGackstatter PhilippGackstatter force-pushed the pgackst-lazy-foreign-asset-storage-loading branch from 12b15b5 to 336d7f1 Compare September 16, 2025 06:28
@PhilippGackstatter
Copy link
Copy Markdown
Contributor Author

Had to force push after rebasing onto next after merging the parent PRs.

Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you! I left a couple of comments inline - all related to basically the same idea, though I'm not sure if that idea is a good one.

I do think that the host/executor code have gotten a bit too difficult to follow, but maybe that's something we can address more comprehensively as a part of #1709.

@PhilippGackstatter PhilippGackstatter merged commit c9b5bb6 into next Sep 22, 2025
18 checks passed
@PhilippGackstatter PhilippGackstatter deleted the pgackst-lazy-foreign-asset-storage-loading branch September 22, 2025 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lazy loading of account assets and storage

3 participants