The Wayback Machine - https://web.archive.org/web/20201107065643/https://github.com/graphprotocol/graph-node/issues/474
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if subgraph contract addresses are in blockchain #474

Open
timmclean opened this issue Oct 9, 2018 · 0 comments
Open

Check if subgraph contract addresses are in blockchain #474

timmclean opened this issue Oct 9, 2018 · 0 comments

Comments

@timmclean
Copy link
Contributor

@timmclean timmclean commented Oct 9, 2018

If a user writes a subgraph referencing contract addresses from (for example) a testnet, and then accidentally deploys the subgraph to a graph node running mainnet, the subgraph will run but won't find any events. We can provide a better experience using eth_getTransactionCount to check that the contract addresses exist on the blockchain in use.

I think it is technically possible to write a subgraph using contract addresses that are not yet present in the blockchain, but will eventually appear. Contract addresses are just a hash of the sender address and sender's nonce, so they could be determined ahead of time. This use case seems unusual however, and may not be something we want to support.

Open questions:

  • error or just a warning?
  • require at least one subgraph data source to have transaction(s) on chain, or all subgraph data sources to have transaction(s) on chain?

(thanks @leodasvacas for the suggestion)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.