graphprotocol / graphprotocol/graph-node
[Bug] Graph-node save incorrect block cache during reorgs
还没有人认领这个 Issue。
- 主要语言
- Rust
- 星标
- 3.2k
- 派生
- 1.1k
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 1
描述
Bug report
In case reorg happend and graph-node has seen it we would have 2 entries in the cache table:
Example for reorg on ethereum mainnet on block 17820205 with depth=1
graph=# select hash, number, parent_hash from chain1.blocks where number=17820205 (https://etherscan.io/block/17820205/f)
hash | number | parent_hash
--------------------------------------------------------------------+----------+--------------------------------------------------------------------
\xdcb02b80a71bb335a8247298cfde2af9f589b491a1eb794a88fa377fb00e6fb8 | 17820205 | \x9432a65af5ecd186859c22bf4d809561aaa4daf3bf8101fccb3f228e34b64756
\xc0455fae763cd8d53bc294cbd32225f207dee56cb396aee84eaaa5011513731a | 17820205 | \x9432a65af5ecd186859c22bf4d809561aaa4daf3bf8101fccb3f228e34b64756
(2 rows)
graph=# select hash, number, parent_hash from chain1.blocks where number=17820206;
hash | number | parent_hash
--------------------------------------------------------------------+----------+--------------------------------------------------------------------
\x409c0bb686a5fac90e706a556d02cf99122b49c683374c82341cccc836807964 | 17820206 | \xc0455fae763cd8d53bc294cbd32225f207dee56cb396aee84eaaa5011513731a
(1 row)
graph=# select hash, number, parent_hash from chain1.blocks where number=17820204;
hash | number | parent_hash
--------------------------------------------------------------------+----------+--------------------------------------------------------------------
\x9432a65af5ecd186859c22bf4d809561aaa4daf3bf8101fccb3f228e34b64756 | 17820204 | \x737d8549261f685b18b6c6f2dac460c6dfc4b88bf16b03d2a813ed51f9c08c40
(1 row)
From our experience that sometimes cause errors in subgraphs, because the subgraph takes incorrect data from the cache (This need confirming)
We had a problem when the subgraph was stuck until we remove duplicates from the cache.
Relevant log output
No response
IPFS hash
No response
Subgraph name or link to explorer
No response
Some information to help us out
- Tick this box if this bug is caused by a regression found in the latest release.
- Tick this box if this bug is specific to the hosted service.
- I have searched the issue tracker to make sure this issue is not a duplicate.
OS information
None
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,针对 17820204–17820206 区块处所述的重组,在 chain1.blocks 缓存上重现报告中的 SQL 查询。跟踪重组区块的保存和选择方式,然后验证重复的区块条目是否会导致 subgraph 使用错误数据或陷入停滞。完成的标准是通过回归测试或记录在案的复现确认或否定缓存行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, rust
- 领域
- blockchain, databases
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100