graph-node
graph-node copied to clipboard
Remove use of web3 types outside of chain/ethereum
As seen in the Arweave integration PR the BlockPtr hash is limited to 32 bytes / 256 bits (H256 type).
This should be refactored so graph-node can deal with chains that have larger block hashes.
To add a bit more details, this is an implicit limit because underlying chain agnostic part of graph-node related to storage with Postgres uses H256 on some of their code path leading to panic/errors on chain with block hash with longer values.
For example chain_head_ptr which does an implicit cast to H256 which fails on Arweave.
Also fn graft(
There is a few other places like that. hash_to_h256 should be removed also in my opinion.
I think we should go even one step further: nothing outside of chain/ethereum should be using H256
Is this fixed by https://github.com/graphprotocol/graph-node/pull/3623 cc @leoyvens ?
That fixed the issues we've observed so far but it didn't systematically replace web3 types such as H256 and H160 with chain-agnostic ones.