graphprotocol / graphprotocol/graph-node

Make ChainStore agnostic to block serialization format

Offen
#2,999 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
1.1k
Ø Merge
4 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

PR #2886 and #2998 still leave some assumptions about how blocks are serialized and deserialized in the ChainStore. In particular, they assume that the serialization follows the form of an EthereumBlock. That can cause issues for other chains if they store blocks with a different serialization format and try to read them, assuming they get their own serialization back.

A more robust fix would parametrize ChainStore.blocks and ChainStore,ancestor_block (the only methods that read the serialized data from the chain store and now return a json::Value) so that the caller passes in instructions on how to deserialize instead of leaving it up to the store. That is not entirely trivial because

  • the current code does not read transaction receipts in ChainStore.blocks which helps reduce the data that needs to be deserialized.
  • ChainStore needs to be object safe, so blocks and ancestor_block can't be parametrized on some sort of FromChainStoreData trait

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Überprüfung von ChainStore.blocks und ChainStore.ancestor_block sowie der in den PRs #2886 und #2998 identifizierten Annahmen. Verfolge, wie diese Methoden serialisierte Blöcke deserialisieren und wie die Objektsicherheit die API einschränkt. Als erledigt gilt die Änderung, wenn Aufrufer Deserialisierungsanweisungen bereitstellen, die Verarbeitung von Transaktionsquittungen angemessen bleibt und Blockformate außerhalb von Ethereum in ihrer eigenen Serialisierung wieder eingelesen werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
blockchain
Issue-Typ
Refactoring
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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