-
Notifications
You must be signed in to change notification settings - Fork 57
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
Refactor apply_delta
for Storage Maps
#751
Comments
I am starting this issue today. I am not sure I understood 100% why this refactoring is needed. In my understanding, for every change in a This is what the MASM code in miden-base/miden-lib/asm/kernels/transaction/api.masm Lines 259 to 265 in 6184966
That means we have two updated entities, Currently, there is also a check that whenever there is a miden-base/objects/src/accounts/delta/storage.rs Lines 93 to 106 in 6184966
It could be implemented differently, without question, but I don't know what the reason behind it is. |
The main reasons is that having both storage map updates and storage slot updates (for slots which contain storage maps) is redundant. This means:
|
Closed by #758. |
As discussed in #737 (comment), we need a PR that fixes how account storage delta is put together and applied.
Specifically:
AccountStorageDelta.cleared_items
andAccountStorageDelta.updated_items
should contain updates only to value slots.AccountStorageDelta.updated_maps
should contain updates to storage maps.This should be sufficient to apply the delta because new roots of storage maps can be computed from the data in
updated_maps
and can then use these roots to update the corresponding storage slots.To make the above work, we may need to modify MASM - but there may also be a way around it. For example, if the a
set_item
event is fired on a map storage slot, transaction host can verify that it is correct, but then ignore it.Separately, we should also implement
AccountStorage::set_map_item()
andAccountStorage::get_map_item()
methods to mimic the ones in the transaction kernel.Originally posted by @bobbinth in #737 (review)
The text was updated successfully, but these errors were encountered: