graphprotocol / graphprotocol/graph-node
[Bug] Graph-node save incorrect block cache during reorgs
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Rust
- Estrellas
- 3.2k
- Forks
- 1.1k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 1
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza reproduciendo las consultas SQL reportadas contra la caché de chain1.blocks para la reorganización citada en los bloques 17820204–17820206. Traza cómo se guardan y seleccionan los bloques reorganizados y, después, verifica si las entradas de bloques duplicadas pueden hacer que un subgraph use datos incorrectos o quede atascado. Se considera terminado cuando el comportamiento de la caché se confirma o se refuta mediante una prueba de regresión o una reproducción documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- postgresql, rust
- Área
- blockchain, databases
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 35/100