graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.9k stars 968 forks source link

Local node never fully syncs (on Rinkeby) #2745

Closed dombinorbert closed 2 years ago

dombinorbert commented 3 years ago

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

Report a bug (perhaps?)

What is the current behavior?

Graph node sync process on rinkeby never seems to complete. Its consistently one block behind (with some occasional receipt block mismatches). I'm not experiencing any network issues and I've even tried messing with --ethereum-polling-interval but it didn't seem to help.

Aug 27 10:56:12.073 INFO Graph Node version: 0.23.1 :: hosted-current+3 (2e0dc0b68 2021-08-06)
Aug 27 10:56:12.073 INFO Generating configuration from command line arguments
Aug 27 10:56:12.073 INFO Starting up
Aug 27 10:56:12.073 INFO Trying IPFS node at: http://127.0.0.1:5001/
Aug 27 10:56:12.088 INFO Creating transport, capabilities: archive, traces, url: https://rinkeby.infura.io/v3/f24e64d88af24692aaf37a7fc2888dc3, provider: rinkeby-rpc-0
Aug 27 10:56:12.088 INFO Successfully connected to IPFS node at: http://127.0.0.1:5001/
Aug 27 10:56:12.628 DEBG Cleaning up large notifications after about 300s, channel: store_events, component: NotificationListener
Aug 27 10:56:12.633 INFO Connecting to Postgres, weight: 1, conn_pool_size: 10, url: postgresql://postgres:HIDDEN_PASSWORD@localhost:5433/graphnode, pool: main, shard: primary
Aug 27 10:56:12.676 INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
Aug 27 10:56:12.676 DEBG Using postgres host order [Main], shard: primary, component: Store
Aug 27 10:56:12.677 INFO Setting up fdw, pool: main, shard: primary, component: ConnectionPool
Aug 27 10:56:12.679 INFO Running migrations, pool: main, shard: primary, component: ConnectionPool
Aug 27 10:56:12.680 INFO Migrations finished, pool: main, shard: primary, component: ConnectionPool
Aug 27 10:56:12.680 INFO Mapping primary, pool: main, shard: primary, component: ConnectionPool
Aug 27 10:56:12.699 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
Aug 27 10:56:12.702 INFO Connecting to Ethereum to get network identifier, capabilities: archive, traces, provider: rinkeby-rpc-0
Aug 27 10:56:12.968 INFO Connected to Ethereum, capabilities: archive, traces, network_version: 4, provider: rinkeby-rpc-0
Aug 27 10:56:12.969 INFO Creating LoadManager in disabled mode, component: LoadManager
Aug 27 10:56:12.969 INFO Starting block ingestors
Aug 27 10:56:12.969 INFO Starting block ingestor for network, network_name: rinkeby
Aug 27 10:56:12.969 INFO Starting job runner with 1 jobs, component: JobRunner
Aug 27 10:56:12.969 DEBG Schedule for Vacuum subgraphs.subgraph_deployment, first_run_in_s: 0, interval_s: 60, component: JobRunner
Aug 27 10:56:12.970 INFO Starting JSON-RPC admin server at: http://localhost:8020, component: JsonRpcServer
Aug 27 10:56:12.970 INFO Started all subgraphs, component: SubgraphRegistrar
Aug 27 10:56:12.971 INFO Starting GraphQL HTTP server at: http://localhost:8000, component: GraphQLServer
Aug 27 10:56:12.971 INFO Starting index node server at: http://localhost:8030, component: IndexNodeServer
Aug 27 10:56:12.971 INFO Starting metrics server at: http://localhost:8040, component: MetricsServer
Aug 27 10:56:12.971 INFO Starting GraphQL WebSocket server at: ws://localhost:8001, component: SubscriptionServer
Aug 27 10:56:13.106 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187277, current_block_head: 9187276, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:56:19.338 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187278, current_block_head: 9187277, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:56:34.456 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187279, current_block_head: 9187278, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:56:49.530 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187280, current_block_head: 9187279, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:57:04.599 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187281, current_block_head: 9187280, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:57:20.962 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187282, current_block_head: 9187281, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:57:33.834 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187283, current_block_head: 9187282, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:57:48.889 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187284, current_block_head: 9187283, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:05.063 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187285, current_block_head: 9187284, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:05.385 INFO receipt block mismatch, tx_hash: 0x6fa9…f838, block_hash: 0x2cef…b990, receipt_block_hash: 0x827e…b4a5, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:09.286 INFO receipt block mismatch, tx_hash: 0x6fa9…f838, block_hash: 0x827e…b4a5, receipt_block_hash: 0x2cef…b990, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:12.051 INFO receipt block mismatch, tx_hash: 0x6fa9…f838, block_hash: 0x827e…b4a5, receipt_block_hash: 0x2cef…b990, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:12.225 INFO receipt block mismatch, tx_hash: 0x6fa9…f838, block_hash: 0x827e…b4a5, receipt_block_hash: 0x2cef…b990, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:19.217 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187286, current_block_head: 9187285, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:34.326 INFO Syncing 1 blocks from Ethereum., code: BlockIngestionStatus, blocks_needed: 1, blocks_behind: 1, latest_block_head: 9187287, current_block_head: 9187286, provider: rinkeby-rpc-0, component: BlockIngestor
Aug 27 10:58:34.455 INFO Trying again after block polling failed: Block data unavailable, block was likely uncled (block hash = 0xbb831ab734f1cf0f0dc52739ccedcd056972d1289e8a6f77ed466ef443b1c40d), provider: rinkeby-rpc-0, component: BlockIngestor

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

Run a local node with the following startup script:

cargo run -p graph-node --release -- --postgres-url postgresql://PG_USERNAME:PG_PASSWORD@localhost:5433/graphnode --ethereum-rpc rinkeby:https://rinkeby.infura.io/v3/INFURA_KEY --ipfs 127.0.0.1:5001 --ethereum-polling-interval 500 --debug

What is the expected behavior?

Have the node fully synced.

azf20 commented 3 years ago

That looks like the startup logs - have you deployed a subgraph on the graph-node?

azf20 commented 2 years ago

Hey @dnor1 closing this for now, but let us know and please re-open if you are still having this issue!