0xMiden / 0xMiden/protocol

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

Offen
#3,282 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
kernels
Vorherrschende Sprache
Rust
Sterne
132
Forks
167
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
110

Beschreibung

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_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.