Improve `AccountSmtForest`'s undo operation
- Lingua principale
- Rust
- Stelle
- 78
- Fork
- 129
- Merge medio
- 4g 14h
- PR unite (30g)
- 52
Descrizione
> 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esamina l'operazione di annullamento di AccountSmtForest, probabilmente in un file come account_smt_forest.rs. Il problema menziona l'uso di tabelle di cronologia asset/storage per costruire un batch forest prima di eliminare le righe, invece di ricostruire lo stato completo dell'account. Esamina la riconciliazione esistente e l'implementazione di pre_undo_map_slots per comprendere l'implementazione attuale. Controlla la PR #2333 collegata per il contesto del cambiamento suggerito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- backend, databases
- Tipo di issue
- Refactoring
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100