Comments (3)
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 StorageMap
there is always a change, i.e. the root of the map in a StorageSlot
.
This is what the MASM code in api.masm
does.
miden-base/miden-lib/asm/kernels/transaction/api.masm
Lines 259 to 265 in 6184966
That means we have two updated entities, AccountStorageDelta.updated_items
and AccountStorageDelta.updated_maps
, because updated_items
tracks changes in StorageSlots
, and updated_maps
tracks changes in StorageMaps
.
Currently, there is also a check that whenever there is a updated_map
, there must be a corresponding change in updated_items
to ensure consistency.
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.
from miden-base.
The main reasons is that having both storage map updates and storage slot updates (for slots which contain storage maps) is redundant. This means:
- The deltas are slightly bigger (this is very minor).
- It is possible to encode data in the delta inconsistently (e.g., storage slot updates would indicate one root for a storage map, while corresponding storage map updates would result in a different root). It is possible to deal with this, but that means extra code in various places (e.g., during application of the delta, during deserialization of the delta etc.).
from miden-base.
Closed by #758.
from miden-base.
Related Issues (20)
- Challenges surrounding sub-second order-book performance on Miden
- Miden Assembly Linter? HOT 3
- Allow user to set the aux field when creating a note HOT 1
- Using hmerge to hash 9 or more stack elements HOT 12
- Add CI job for `doc` + make sure that Miden base passes `make doc` HOT 1
- winter_rand_utils Compiled Under Testing Feature Breaks for WASM Builds HOT 1
- Allow increasing an account's nonce without changing its state HOT 1
- Add `create_wallet_with_custom_code` wallet helper function in miden-lib HOT 5
- Refactor transaction kernel events and errors
- Make memory setters consistent HOT 1
- Checking that a transaction does not consume two identical notes
- Update names used for input/output notes HOT 4
- Refactor batch/block note tree structure
- Refactor `NoteOrigin` / `NoteInclusionProof` structs
- Fix the stack management for account procedures HOT 7
- Allow setting block timestamp and block number when using TransactionContextBuilder HOT 3
- Refactor delta's vault and storage to use maps HOT 1
- feat: add a procedure for basic wallets that creates notes with 0 or more assets
- Refactor account storage to use sequential hash rather than a Merkle tree
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miden-base.