paritytech / paritytech/try-runtime-cli

Disk-backed externalities

Aperta
#15 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Rust
Stelle
25
Fork
29
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Original issue https://github.com/paritytech/substrate/issues/14076


Prelude

Discussion in https://github.com/paritytech/substrate/issues/13562 expanded to include various topics other than lazy-download, including improving general performance and using a disk-backed database.

I am creating this issue to separate the discussion and progress around allowing the try-runtime-cli to accept a DB path for reading state, rather than loading all state into memory.

Motivation

Creating snapshots and loading state into memory is not a significant issue for chains like Polkadot and Kusama, but it can be for heavier-weight chains like Moonbeam with extensive state.

On these heavy chains:

  1. It takes a long time to create a snapshot, and the snapshot size is considerable.
  2. The state might not fit into memory, depending on the chain and machine specifications.
  3. It would provide a much better developer experience for using try-runtime-cli with these chains if developers could skip worrying about that and just specify the path to their existing database instead.

Implementation ideas

  • TestExternalities currently has a hardcoded InMemoryBackend as a generic parameter. However, that could be updated to a more generic sp_state_machine::Backend.
  • Once that change is made, we should be able to use either an InMemoryBackend or DiskDbBackend (which is already implemented in fudge) in TestExternalities.
  • We can add a new Mode to remote-externalities called something like Disk, so we would have Online, Offline (perhaps rename this to Snap), and Disk.
  • Finally, we can update the CLI to accept live, snap, and a new option db when specifying where to get state. If the user chooses db, they pass the path, and the TestExternalities will be initialized with a DiskDbBackend instead of the InMemoryBackend.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da TestExternalities, dal suo parametro InMemoryBackend codificato staticamente e dalla gestione di remote-externalities Mode descritta nell’issue. Esamina l’interfaccia sp_state_machine::Backend e l’implementazione esistente di DiskDbBackend in fudge, quindi traccia il modo in cui la CLI seleziona attualmente le sorgenti di stato live e snap. Il lavoro è completo quando un percorso del database può selezionare uno stato basato su disco senza caricare l’intero snapshot in memoria.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
cli, databases, testing
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.