Make ChainStore agnostic to block serialization format

未關閉
#2,999 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
35/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
rust
領域
blockchain

研究方向

首先檢視 ChainStore.blocks 和 ChainStore.ancestor_block,以及 PR #2886 和 #2998 中確認的假設。追蹤這些方法如何反序列化已序列化的區塊,以及物件安全性如何限制 API。當呼叫端提供反序列化指示、交易收據處理仍然適當,且非 Ethereum 區塊格式能以其自身的序列化形式讀回時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

enhancement

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
主要語言
Rust
星號
3.2k
分支
1.1k
平均合併
4 天 1 小時
30 天內合併 PR
1

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

graphprotocol/graph-node 的其他 Issue

查看 graphprotocol/graph-node 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。