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

Firehose only provider should be possible for Ethereum #4304

Closed
maoueh opened this issue Jan 20, 2023 · 12 comments · Fixed by #4508 or #4553
Closed

Firehose only provider should be possible for Ethereum #4304

maoueh opened this issue Jan 20, 2023 · 12 comments · Fixed by #4508 or #4553
Labels

Comments

@maoueh
Copy link
Contributor

maoueh commented Jan 20, 2023

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

If only a Firehose provider is specified in the graph node config for an Ethereum chain, the chain is not wired correctly and will not be available for indexing.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

With this config:

[general]

[store]
[store.primary]
connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node"
weight = 1
pool_size = 10

[chains]
ingestor = "block_ingestor_node"
[chains.mainnet]
shard = "primary"
protocol = "ethereum"
provider = [
  { label = "firehose", details = { type = "firehose", url = "$FIREHOSE_ENDPOINT", token = "$STREAMING_FAST_API_TOKEN", features = [ "filters" ] }},
]

[deployment]
[[deployment.rule]]
shard = "primary"
indexers = [ "default" ]

No chain is available at all.

What is the expected behavior?

1 Ethereum mainnet chain should be available.

Details

Some hunting led me to create_ethereum_networks_for_chain. This function is what actually populate the initial eth_networks that is used later to connect to adapter and firehose endpoints.

This function is however only looking for web3 provider, so if no RPC node is configured at all, the chain is not created as no provider is set up.

@paymog
Copy link

paymog commented Feb 7, 2023

possibly related to #4059?

@azf20
Copy link
Contributor

azf20 commented Mar 9, 2023

Closing this as I believe it is now resolved, please re-open @maoueh if this is still live

@azf20 azf20 closed this as completed Mar 9, 2023
@matthewdarwin
Copy link

@azf20 is it really resolved that i need no RPC provider now?

@azf20
Copy link
Contributor

azf20 commented Mar 9, 2023

@matthewdarwin you still need a web3call provider if the subgraph requires eth_call (this could be an EVMX rather than an archive node)

@paymog
Copy link

paymog commented Mar 10, 2023

Seems that RPC providers will be needed until #4431 is resolved

@matthewdarwin
Copy link

Yes you need an RPC provider for eth_call, but if you have no eth_call, then should not be needed.

@YaroShkvorets
Copy link
Contributor

YaroShkvorets commented Mar 11, 2023

Doesn't seem to be resolved.

Getting this error on latest version:

✗ graph-node --ipfs localhost:5001 --config eth-mainnet-firehose.toml
Mar 11 11:43:25.581 INFO Graph Node version: 0.30.0 :: fraction+14 (94e93b075 2023-03-09) dirty 3 modifications
Mar 11 11:43:25.583 WARN GRAPH_POI_ACCESS_TOKEN not set; might leak POIs to the public via GraphQL
Mar 11 11:43:25.583 INFO Reading configuration file `eth-mainnet-firehose.toml`
Mar 11 11:43:25.597 WARN No fork base URL specified, subgraph forking is disabled
Mar 11 11:43:25.597 INFO Starting up
Mar 11 11:43:25.601 INFO Trying IPFS node at: http://localhost:5001/
Mar 11 11:43:25.609 DEBG Creating firehose networks [1 chains, ingestor block_ingestor_node]
Mar 11 11:43:25.609 INFO Configuring firehose endpoint, provider: firehose
Mar 11 11:43:25.622 INFO Successfully connected to IPFS node at: http://localhost:5001/
Mar 11 11:43:28.884 DEBG Creating substreams networks [1 chains, ingestor block_ingestor_node]
Mar 11 11:43:28.885 WARN Expensive queries file not set to a valid file: /etc/graph-node/expensive-queries.txt
Mar 11 11:43:28.885 DEBG Cleaning up large notifications after about 300s, channel: store_events, component: NotificationListener
Mar 11 11:43:28.978 INFO Connecting to Postgres, weight: 1, conn_pool_size: 10, url: postgresql://graph-node:HIDDEN_PASSWORD@localhost:5432/graph-node, pool: main, shard: primary
Mar 11 11:43:28.980 INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
Mar 11 11:43:28.982 DEBG Using postgres host order [Main], shard: primary, component: Store
Mar 11 11:43:29.055 INFO Setting up fdw, pool: main, shard: primary, component: ConnectionPool
Mar 11 11:43:29.120 INFO Running migrations, pool: main, shard: primary, component: ConnectionPool
Mar 11 11:43:29.127 INFO Migrations finished, pool: main, shard: primary, component: ConnectionPool
Mar 11 11:43:29.130 DEBG Release migration lock, pool: main, shard: primary, component: ConnectionPool
Mar 11 11:43:29.137 DEBG Setup finished, setup_time_s: 0, pool: main, shard: primary, component: ConnectionPool
Mar 11 11:43:29.140 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
Mar 11 11:43:29.693 INFO Creating LoadManager in disabled mode, component: LoadManager
Mar 11 11:43:29.694 INFO Starting job runner with 4 jobs, component: JobRunner
Mar 11 11:43:29.694 DEBG Schedule for Vacuum subgraphs.subgraph_deployment, first_run_in_s: 0, interval_s: 60, component: JobRunner
Mar 11 11:43:29.695 DEBG Schedule for Report pg_notification_queue_usage(), first_run_in_s: 0, interval_s: 60, component: JobRunner
Mar 11 11:43:29.695 DEBG Schedule for Reconcile important tables from the primary, first_run_in_s: 9, interval_s: 900, component: JobRunner
Mar 11 11:43:29.695 DEBG Schedule for Record and remove unused deployments, first_run_in_s: 79, interval_s: 7200, component: JobRunner
Mar 11 11:43:29.727 INFO Starting JSON-RPC admin server at: http://localhost:8020, component: JsonRpcServer
Mar 11 11:43:29.729 INFO Starting GraphQL HTTP server at: http://localhost:8000, component: GraphQLServer
Mar 11 11:43:29.729 INFO Starting index node server at: http://localhost:8030, component: IndexNodeServer
Mar 11 11:43:29.731 INFO Starting GraphQL WebSocket server at: ws://localhost:8001, component: SubscriptionServer
Mar 11 11:43:29.731 INFO Starting metrics server at: http://localhost:8040, component: MetricsServer
Mar 11 11:43:29.752 DEBG Subgraph started, start_ms: 21, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphRegistrar
Mar 11 11:43:29.753 INFO Started all assigned subgraphs, node_id: default, count: 1, component: SubgraphRegistrar
Mar 11 11:43:29.814 INFO Starting subgraph writer, queue_size: 5, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphInstanceManager
Mar 11 11:43:29.825 INFO Resolve subgraph files using IPFS, n_templates: 0, n_data_sources: 1, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphInstanceManager
Mar 11 11:43:29.843 INFO Successfully resolved subgraph files using IPFS, features: ø, n_templates: 0, n_data_sources: 1, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphInstanceManager
Mar 11 11:43:29.913 INFO Data source count at start: 1, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphInstanceManager
Mar 11 11:43:29.916 ERRO Failed to start subgraph, code: SubgraphStartFailure, error: no chain configured for network mainnet: no network mainnet found on chain ethereum, sgd: 1, subgraph_id: QmSQZQjgsyfc785k3mhwrjR1cFsc65EAUYfVLPbEzQrkkP, component: SubgraphInstanceManager

Deployed subgraph doesn't make any eth calls and indexes if I uncomment RPC provider.

Config:

[general]

[store]
[store.primary]
connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node"
weight = 1
pool_size = 10

[chains]
ingestor = "block_ingestor_node"
[chains.mainnet]
shard = "primary"
protocol = "ethereum"
provider = [
  { label = "firehose", details = { type = "firehose", url = "$FIREHOSE_ENDPOINT", token = "$FIREHOSE_API_TOKEN", features = [ "filters" ] }},
  # { label = "peering", url = "$ETH_MAINNET_RPC", features = [] },
]

[deployment]
[[deployment.rule]]
shard = "primary"
indexers = [ "default" ]

@YaroShkvorets
Copy link
Contributor

If you add web3call provider, it works

  { label = "calls", details = { type = "web3call", url = "$EVMX_RPC", features = [ "archive" ] }},

Interestingly, if you add a "fake" web3call provider with non-existing url, it still works:

  { label = "calls", details = { type = "web3call", url = "http://xxxxxx", features = [ "archive" ] }},

So I guess it's not needed really, just need to fix that no network mainnet found on chain ethereum check.

@azf20 azf20 reopened this Mar 13, 2023
@maoueh
Copy link
Contributor Author

maoueh commented Mar 13, 2023

@azf20 Issue Details describes the problematic code and has link to place where change(s) need to happen.

@azf20
Copy link
Contributor

azf20 commented Mar 31, 2023

@maoueh @matthewdarwin @YaroShkvorets this is fixed on latest Master if you're able to test + verify (and thanks to @mangas)

@maoueh
Copy link
Contributor Author

maoueh commented Apr 12, 2023

I'm stilling having trouble getting a Firehose only config working on a fresh database. The fresh database is important, if I add an RPC provider, it start working. If I revert back to the config shown below, it start working correctly. So it seems it happens really only when Firehose only config and fresh database.

Tried on latest master this morning (commit ), using config:

[general]

[store]
[store.primary]
connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node"
weight = 1
pool_size = 10

[chains]
ingestor = "block_ingestor_node"
[chains.mainnet]
shard = "primary"
protocol = "ethereum"
provider = [
  { label = "firehose", details = { type = "firehose", url = "$FIREHOSE_ENDPOINT", features = [ "filters" ] }},
]

[deployment]
[[deployment.rule]]
shard = "primary"
indexers = [ "default" ]

This leads toApr 12 09:53:04.666 ERRO No store configured for Ethereum chain mainnet; ignoring this chain when starting graph-node

Logs
Apr 12 09:52:56.119 INFO Graph Node version: 0.30.0 :: fraction3+826 (a3bcfc65e 2023-04-10) dirty 2 modifications
Apr 12 09:52:56.119 WARN GRAPH_POI_ACCESS_TOKEN not set; might leak POIs to the public via GraphQL
Apr 12 09:52:56.119 INFO Reading configuration file `../graph-node-dev/config/eth-mainnet-firehose.toml`
Apr 12 09:52:56.124 WARN No fork base URL specified, subgraph forking is disabled
Apr 12 09:52:56.124 INFO Starting up
Apr 12 09:52:56.125 INFO Trying IPFS node at: http://localhost:5001/
Apr 12 09:52:56.131 DEBG Creating firehose networks [1 chains, ingestor block_ingestor_node]
Apr 12 09:52:56.131 INFO Configuring firehose endpoint, provider: firehose
Apr 12 09:52:56.137 INFO Successfully connected to IPFS node at: http://localhost:5001/
Apr 12 09:52:59.610 DEBG Creating firehose networks [1 chains, ingestor block_ingestor_node]
Apr 12 09:52:59.610 WARN Expensive queries file not set to a valid file: /etc/graph-node/expensive-queries.txt
Apr 12 09:52:59.610 DEBG Cleaning up large notifications after about 300s, channel: store_events, component: NotificationListener
Apr 12 09:52:59.797 INFO Connecting to Postgres, weight: 1, conn_pool_size: 10, url: postgresql://graph-node:HIDDEN_PASSWORD@localhost:5432/graph-node, pool: main, shard: primary
Apr 12 09:52:59.797 INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
Apr 12 09:52:59.798 DEBG Using postgres host order [Main], shard: primary, component: Store
Apr 12 09:52:59.868 INFO Setting up fdw, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:00.011 INFO Running migrations, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.484 INFO Migrations finished, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.492 DEBG Postgres migration output, output: Running migration 20180710061642 Running migration 20180710061659 Running migration 20180710062717 Running migration 20180710062730 Running migration 20180816143800 Running migration 20180822130000 Running migration 20180822140000 Running migration 20180829120000 Running migration 20180907220000 Running migration 20180918180000 Running migration 20181202114100 Running migration 20181203150000 Running migration 20181221003727 Running migration 20190107120000 Running migration 20190118195346 Running migration 20190118195526 Running migration 20190201045927 Running migration 20190204114900 Running migration 20190225182843 Running migration 20190226182914 Running migration 20190226183156 Running migration 20190227035443 Running migration 20190228190800 Running migration 20190304235349 Running migration 20190307171355 Running migration 20190328004319 Running migration 20190331010824 Running migration 20190419171709 Running migration 20190422190022 Running migration 20190503164052 Running migration 20190509135900 Running migration 20190509232642 Running migration 20190514200255 Running migration 20190515215022 Running migration 20190605214320 Running migration 20190626164405 Running migration 20190720195916 Running migration 20190802001120 Running migration 20190901135850 Running migration 20190902230613 Running migration 20191001173616 Running migration 20200114235608 Running migration 20200117013633 Running migration 20200124065338 Running migration 20200306020253 Running migration 20200311162100 Running migration 20200325170527 Running migration 20200404002817 Running migration 20200410111111 Running migration 20200516225611 Running migration 20200707002933 Running migration 20200731162138 Running migration 20201031150000 Running migration 20201103170839 Running migration 20201110100000 Running migration 20201211142000 Running migration 20201212000001 Running migration 20201212000002 Running migration 20201212000003 Running migration 20201212000004 Running migration 20201212000005 Running migration 20201215000000 Running migration 2020127190800 Running migration 20210107004939 Running migration 20210114175654 Running migration 20210114193022 Running migration 20210115013524 Running migration 20210119033749 Running migration 20210126044443 Running migration 20210126172953 Running migration 20210126173710 Running migration 20210126204036 Running migration 20210217205502 Running migration 20210218000721 Running migration 20210218171423 Running migration 20210224051050 Running migration 20210225233156 Running migration 20210311010830 Running migration 20210311231340 Running migration 20210312014815 Running migration 20210312070453 Running migration 20210316001809 Running migration 20210316165131 Running migration 20210319161012 Running migration 20210320001347 Running migration 20210324220541 Running migration 20210520130220 Running migration 20210521165219 Running migration 20210601222649 Running migration 20210614201635 Running migration 20210709144144 Running migration 20211202212506 Running migration 20211205061157 Running migration 2022030907000 Running migration 20220321172028 Running migration 20220323010300 Running migration 20220426125552 Running migration 20220612003442 Running migration 20220919161239 Running migration 20221013000000 Running migration 20221103213140 Running migration 20221110185105 Running migration 20230124192319 Running migration 20230215184255 Running migration 20230306002954 Running migration 20230306233030 Running migration 20230328004152, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.496 INFO Mapping primary, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.520 DEBG Release migration lock, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.526 DEBG Setup finished, setup_time_s: 4, pool: main, shard: primary, component: ConnectionPool
Apr 12 09:53:04.528 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
Apr 12 09:53:04.666 ERRO No store configured for Ethereum chain mainnet; ignoring this chain
Apr 12 09:53:05.152 INFO Creating LoadManager in disabled mode, component: LoadManager

@maoueh maoueh reopened this Apr 12, 2023
@maoueh
Copy link
Contributor Author

maoueh commented Apr 12, 2023

This manifest differently when dealing with substreams only deployment:

[general]

[store]
[store.primary]
connection = "postgresql://graph-node:let-me-in@localhost:5432/graph-node"
weight = 1
pool_size = 10

[chains]
ingestor = "block_ingestor_node"
[chains.mainnet]
shard = "primary"
provider = [
    { label = "firehose", details = { type = "firehose", url = "$SUBSTREAMS_ENDPOINT" }},
    { label = "substreams", details = { type = "substreams", url = "$SUBSTREAMS_ENDPOINT" }},
]

[deployment]
[[deployment.rule]]
shard = "primary"
indexers = [ "default" ]

It actually panics at:

Apr 12 15:07:12.918 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
Apr 12 15:07:13.059 ERRO No store configured for Ethereum chain mainnet; ignoring this chain
thread 'tokio-runtime-worker' panicked at 'any substreams endpoint needs an rpc or firehose chain defined: no network mainnet found on chain ethereum', node/src/main.rs:742:18
stack backtrace:
   0:        ...
   ...
  17:        0x1004b9328 - graph_node::ethereum_networks_as_chains::h61feb777cf9cd320
                               at /Users/maoueh/work/sf/graph-node/node/src/main.rs:740:31
  18:        0x1004be1f0 - graph_node::main::{{closure}}::{{closure}}::{{closure}}::h738c82fc042a27d0
                               at /Users/maoueh/work/sf/graph-node/node/src/main.rs:337:31
  19:        0x100e489bc - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::future::future::Future>::poll::h677d1053d1eea354
                               at /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/core/src/panic/unwind_safe.rs:296:9
...

But it seems to be the same problem as my other firehose report but with a different result.

A workaround is to defined once an RPC provider, let it boot, close, restart with firehose/substreams only config, it works properly, I'm able to index a Substreams.

Workaround:

  • Add a web3 provide in config: { label = "bootstrap", details = { type = "web3", url = "$RPC_NODE", features = [ "archive" ] }},
  • Restart graph-node give it time to bootstrap, until message Blockstream connected, consuming blocks, network_name: mainnet, provider: firehose, component: EthereumFirehoseBlockIngestor
  • Kill graph-node
  • Remove just added the web3 provider labelled bootstrap
  • Restart graph-node again with original config (firehose/substreams only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants