graphprotocol / graphprotocol/graph-node

Make ChainStore agnostic to block serialization format

オープン
#2,999 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず ChainStore.blocks と ChainStore.ancestor_block、および PR #2886 と #2998 で特定された前提を確認します。これらのメソッドがシリアライズされたブロックをどのようにデシリアライズするか、また object safety が API をどのように制約するかを追跡します。呼び出し側がデシリアライズの指示を提供し、トランザクションレシートの処理が適切なまま維持され、Ethereum 以外のブロック形式をそれぞれ独自のシリアライゼーションで読み戻せるようになれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
blockchain
issue の種類
リファクタリング
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。