0xMiden / 0xMiden/protocol

Insert/Pop key to the `MAP_VALUE_STORAGE_SLOT`

未关闭
#2,212 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
132
派生
167
平均合并
1 天 23 小时
30 天内合并 PR
110

描述

### Feature description

Related to the issue comment that I have described here: https://github.com/OpenZeppelin/miden-confidential-contracts/discussions/37#discussioncomment-15341691

Is it possible to add a kernel level procedure which insert/pop a key-value pair to a `MAP_VALUE_STORAGE_SLOT`

### Why is this feature needed?

Assume that we have the following map value slots, which are using the same key values such as `faucet_id`

```
# map entries: [faucet_id, 0, 0] => [amount_0, amount_1, amount_2, 0]
const.PER_FAUCET_AMOUNT_LIMITS_MAP_SLOT = 0

# map entries: [faucet_id, 0, 0] => [amount_spent_in_epoch, epoch_last_spent, limit_block, running_sum]
const.PER_FAUCET_SPENDING_TRACKER_MAP_SLOT = 1
```

Updating this requires to call these two procedures together by getting the keys from the advice provider for both of them. It also makes the things more complicated for the propose/execute logic for timelocked accounts

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。