0xMiden / 0xMiden/protocol

Optimize `input_note::remove_asset` with non-determinism and `mem_stream`

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

描述

We could potentially improve this in the future using non-determinism. For example, we could get the asset pointer non-deterministically, and only do a linear scan if it comes back as 0 (i.e., the asset does not exist). This assumes that note assets don't contain duplicates (which I think we enforce).

_Originally posted by @bobbinth in https://github.com/0xMiden/protocol/pull/3272#discussion_r3562343026_

I think this loop could be made quite a bit more efficient if we use `mem_stream` instruction to read 2 words from memory and overwrite `RATE0` and `RATE1` at the same time.

_Originally posted by @bobbinth in https://github.com/0xMiden/protocol/pull/3272#discussion_r3562409217_

Should we also check that provided `ASSET_ID` is non-empty word somewhere?

_Originally posted by @bobbinth in https://github.com/0xMiden/protocol/pull/3272#discussion_r3562353683_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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