0xMiden / 0xMiden/protocol

Limit number of storage maps per account to 64

未關閉
#2,996 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
kernels rust
主要語言
Rust
星號
132
分支
167
平均合併
1 天 23 小時
30 天內合併 PR
110

描述

As motivated in https://github.com/0xMiden/node/issues/2121#issuecomment-4527244793, we should limit the number of storage maps per account to 64.

For now, storage can only be set at account creation time, so we only need to assert this then. We can compute the number of storage maps in `$kernel::account::insert_new_storage` and assert it is <= 64.

On the Rust side, we should also validate this in `AccountStorage`. We can add a constant:

```rust
impl AccountStorage {
pub const MAX_NUM_STORAGE_MAPS: usize = 64;
}
```

And then add validation in `AccountStorage::new`.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。