graph-node icon indicating copy to clipboard operation
graph-node copied to clipboard

Remove use of web3 types outside of chain/ethereum

Open evaporei opened this issue 3 years ago • 4 comments

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.

evaporei avatar May 05 '22 19:05 evaporei

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.

maoueh avatar May 05 '22 21:05 maoueh

I think we should go even one step further: nothing outside of chain/ethereum should be using H256

lutter avatar Jun 03 '22 18:06 lutter

Is this fixed by https://github.com/graphprotocol/graph-node/pull/3623 cc @leoyvens ?

azf20 avatar Jun 06 '22 05:06 azf20

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.

leoyvens avatar Jun 06 '22 07:06 leoyvens