0xMiden / 0xMiden/rust-sdk

Improve `AccountSmtForest`'s undo operation

Offen
#2,402 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Rust
Sterne
78
Forks
129
Ø Merge
4 T. 14 Std.
Gemergte PRs (30 T.)
52

Beschreibung

> The undo ops currently rebuilds the full account state. The asset/storage history tables already contain the reverse delta, so use them to build a forest batch before deleting those rows. This removes the full reconciliation and `pre_undo_map_slots` plumbing.

_Originally posted by @igamigo in https://github.com/0xMiden/rust-sdk/pull/2333#pullrequestreview-4920095184_

The undo path - which occurs when rolling back states into a previous state the client knows - still rebuilds the full map where it can just undo the patch (and this data is handily available at that point).
This is quite low-priority as this path only executes on rollbacks, and for average accounts this will be very fast anyway - the original PR measured 0.37 seconds for 50k-entry maps and 7.5 seconds for 1 million-entry maps.
One thing we can explore for this approach is letting the

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Look at the AccountSmtForest's undo operation, likely in a file like account_smt_forest.rs. The issue mentions using asset/storage history tables to build a forest batch before deleting rows, instead of rebuilding the full account state. Examine the existing reconciliation and pre_undo_map_slots plumbing to understand the current implementation. Check the linked PR #2333 for context on the suggested change.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
backend, databases
Issue-Typ
Refactoring
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

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