0xMiden / 0xMiden/protocol

Add support for storage array

Đang mở
#383 14 bình luận 0 reaction 0 người được giao Xem trên GitHub
kernels
Ngôn ngữ chính
Rust
Star
132
Fork
167
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
110

Mô tả

In #307 and #310 we implemented basic new account storage structure described in https://github.com/0xPolygonMiden/miden-base/issues/239#issuecomment-1791479475. Specifically, we have support for value types but not for maps or arrays.

We need to add support for arrays as well. This would make storage more efficient and flexible for use cases where a small-sh number of items needs to be index-accessible.

To support this on the kernel side, we need to add two procedures to the kernel API:
```
#! Inputs: [slot, index, ...]
#! Outputs: [VALUE, ...]
#!
#! Fails if the slot contains a simple value or a storage map.
export.get_array_item

#! Inputs: [slot, index, VALUE, ...]
#! Outputs: [OLD_VALUE, ...]
#!
#! Fails if the slot contains a simple value or a storage map.
export.set_array_item
```

We also need to add support for maps to `AccountStorage` as well as `DataStore` trait in `miden-tx`. The backing data structure for this is probably going to be Simple SMT.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.