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.86k stars 933 forks source link

Trying again after eth_getTransactionReceipt RPC call for transaction: invalid hex character #5441

Open AlijonovMukhammaddiyor opened 1 month ago

AlijonovMukhammaddiyor commented 1 month ago

Bug report

Hello everyone. Thank you for the great work. I have a issue with graph-node and subgraph:

Description: I cloned graph-node repo and run it

cargo run -p graph-node --release -- \                                                                                        
  --postgres-url postgresql://postgres:12345@localhost:5432/graph-node \
  --ethereum-rpc chiliz:https://rpc.chiliz.com \
  --ipfs 127.0.0.1:5001 --debug

I deployed the subgraph to it graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 subgraph subgraph.yml:

specVersion: 1.0.0
indexerHints:
  prune: auto
schema:
  file: ./schema.graphql
dataSources:
  - kind: ethereum/contract
    name: Factory
    network: chiliz
    source:
      address: "0xE2918AA38088878546c1A18F2F9b1BC83297fdD3"
      abi: Factory
      startBlock: 10000000
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.7
      language: wasm/assemblyscript
      file: ./src/factory.ts
      entities:
        - Pair
        - Token
      abis:
        - name: Factory
          file: ./abis/Factory.json
        - name: IERC20
          file: ./abis/IERC20.json
        - name: ERC20SymbolBytes
          file: ./abis/ERC20SymbolBytes.json
        - name: ERC20NameBytes
          file: ./abis/ERC20NameBytes.json
      eventHandlers:
        - event: PairCreated(indexed address,indexed address,address,uint256)
          handler: handlePairCreated

templates:
  - kind: ethereum/contract
    name: Pair
    network: chiliz
    source:
      abi: Pair
    mapping:
      kind: ethereum/events
      apiVersion: 0.0.7
      language: wasm/assemblyscript
      entities:
        - Pair
        - Token
      abis:
        - name: Pair
          file: ./abis/Pair.json
        - name: Factory
          file: ./abis/Factory.json
      eventHandlers:
        - event: Burn(indexed address,uint256,uint256,indexed address)
          handler: handleBurn
        - event: Mint(indexed address,uint256,uint256)
          handler: handleMint
        - event: Swap(indexed address,uint256,uint256,uint256,uint256,indexed address)
          handler: handleSwap
        - event: Sync(uint112,uint112)
          handler: handleSync
        - event: Transfer(indexed address,indexed address,uint256)
          handler: handleTransfer
      file: ./src/pair.ts

It worked great on local (mac m1)

THEN I did the exactly the same things on AWS EC2( the same code) but getting error: Trying again after eth_getTransactionReceipt RPC call for transaction 0xa78883146351457bcd56741198180c0e8c7e91daa171ef219afb1bb268b39765 failed (attempt #2) with result Err(Decoder("Error(\"invalid hex character: -, at 0\", line: 0, column: 0)")), provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor

received response: "{\"jsonrpc\":\"2.0\",\"id\":12,\"result\":{\"blockHash\":\"0xd4e02cc8c178396fb77dedad50e4aef2ce25564b6aefb41ea70dc04de048c93a\",\"blockNumber\":\"0xcc68e3\",\"contractAddress\":null,\"cumulativeGasUsed\":\"0x4b9ad\",\"effectiveGasPrice\":\"-0x246139ca800\",\"from\":\"0xf84aed72066e635fd9b0f2fbddbdb77a8761d028\",\"gasUsed\":\"0x56ca\",\"logs\":[],\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"status\":\"0x1\",\"to\":\"0x0000000000000000000000000000000000001000\",\"transactionHash\":\"0xa78883146351457bcd56741198180c0e8c7e91daa171ef219afb1bb268b39765\",\"transactionIndex\":\"0x3\",\"type\":\"0x0\"}}"

I know that effectiveGasPrice has - sign but it is working on local.

Here are what I am getting when i execute cargo run: On local (mac m1): local.txt On ec2: ec2.txt

(For me it seems like on ec2, it is not starting from startBlock specified but trying to fetch the latest block).

Relevant log output

On Local:

❯ cargo run -p graph-node --release -- \
  --postgres-url postgresql://postgres:12345@localhost:5432/graph-node \
  --ethereum-rpc chiliz:https://rpc.chiliz.com \
  --ipfs 127.0.0.1:5001 --debug
warning: /Users/mukhammaddiyor/coding/jalaswap/graph-node/graph/Cargo.toml: unused manifest key: dependencies.stable-hash_legacy.doc
    Finished `release` profile [optimized] target(s) in 0.66s
     Running `target/release/graph-node --postgres-url 'postgresql://postgres:12345@localhost:5432/graph-node' --ethereum-rpc 'chiliz:https://rpc.chiliz.com' --ipfs '127.0.0.1:5001' --debug`
May 28 15:32:43.125 INFO Graph Node version: 0.35.0 :: v348+898 (3f5db05bc 2024-05-27) dirty 1 modification
May 28 15:32:43.125 WARN GRAPH_POI_ACCESS_TOKEN not set; might leak POIs to the public via GraphQL
May 28 15:32:43.125 INFO Generating configuration from command line arguments
May 28 15:32:43.125 WARN No fork base URL specified, subgraph forking is disabled
May 28 15:32:43.125 INFO Starting up
May 28 15:32:43.125 INFO Trying IPFS node at: http://127.0.0.1:5001/
May 28 15:32:43.129 INFO Creating transport, capabilities: archive, traces, url: https://rpc.chiliz.com, provider: chiliz-rpc-0
May 28 15:32:43.129 INFO Checking if provider supports getBlockReceipts, provider: chiliz-rpc-0, provider: chiliz-rpc-0
May 28 15:32:43.130 INFO Successfully connected to IPFS node at: http://127.0.0.1:5001/
May 28 15:32:44.584 WARN Block receipts are empty, provider: chiliz-rpc-0, provider: chiliz-rpc-0
May 28 15:32:44.584 INFO Checked if provider supports eth_getBlockReceipts, supports_block_receipts: false, provider: chiliz-rpc-0, provider: chiliz-rpc-0
May 28 15:32:44.868 DEBG Creating firehose networks [1 chains, ingestor default]
May 28 15:32:44.868 DEBG Creating firehose networks [1 chains, ingestor default]
May 28 15:32:44.873 WARN Expensive queries file not set to a valid file: /etc/graph-node/expensive-queries.txt
May 28 15:32:44.873 DEBG Cleaning up large notifications after about 300s, channel: store_events, component: NotificationListener
May 28 15:32:44.998 INFO Connecting to Postgres, weight: 1, conn_pool_size: 10, url: postgresql://postgres:HIDDEN_PASSWORD@localhost:5432/graph-node, pool: main, shard: primary
May 28 15:32:44.999 INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
May 28 15:32:45.000 DEBG Using postgres host order [Main], shard: primary, component: Store
May 28 15:32:45.268 INFO Setting up fdw, pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.291 INFO Running migrations, pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.297 INFO Migrations finished, pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.297 DEBG Postgres migration output, output: , pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.298 DEBG Release migration lock, pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.299 DEBG Setup finished, setup_time_s: 0, pool: main, shard: primary, component: ConnectionPool
May 28 15:32:45.299 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
May 28 15:32:45.319 INFO Connecting to Ethereum to get network identifier, capabilities: archive, traces, provider: chiliz-rpc-0
May 28 15:32:46.370 INFO Connected to Ethereum, capabilities: archive, traces, network_version: 88888, provider: chiliz-rpc-0
May 28 15:32:46.380 INFO Creating LoadManager in disabled mode, component: LoadManager
May 28 15:32:46.380 INFO Started block ingestor, network_name: chiliz
May 28 15:32:46.380 INFO Starting block ingestor for network, network_name: chiliz
May 28 15:32:46.380 INFO Starting job runner with 5 jobs, component: JobRunner
May 28 15:32:46.380 DEBG Schedule for Vacuum subgraphs.subgraph_deployment, first_run_in_s: 0, interval_s: 60, component: JobRunner
May 28 15:32:46.380 DEBG Schedule for Report pg_notification_queue_usage(), first_run_in_s: 0, interval_s: 60, component: JobRunner
May 28 15:32:46.380 DEBG Schedule for Reconcile important tables from the primary, first_run_in_s: 9, interval_s: 900, component: JobRunner
May 28 15:32:46.380 DEBG Schedule for Record and remove unused deployments, first_run_in_s: 79, interval_s: 7200, component: JobRunner
May 28 15:32:46.380 DEBG Schedule for Refresh materialized views, first_run_in_s: 237, interval_s: 21600, component: JobRunner
May 28 15:32:46.385 INFO Starting JSON-RPC admin server at: http://localhost:8020, component: JsonRpcServer
May 28 15:32:46.385 INFO Starting GraphQL HTTP server at: http://localhost:8000, component: GraphQLServer
May 28 15:32:46.385 INFO Starting GraphQL WebSocket server at: ws://localhost:8001, component: SubscriptionServer
May 28 15:32:46.385 INFO Starting index node server at: http://localhost:8030, component: IndexNodeServer
May 28 15:32:46.385 INFO Starting metrics server at: http://localhost:8040, component: MetricsServer
May 28 15:32:46.397 DEBG Subgraph started, start_ms: 11, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphRegistrar
May 28 15:32:46.397 INFO Started all assigned subgraphs, node_id: default, count: 1, component: SubgraphRegistrar
May 28 15:32:46.407 INFO Resolve subgraph files using IPFS, n_templates: 1, n_data_sources: 1, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.413 INFO Successfully resolved subgraph files using IPFS, features: ø, n_templates: 1, n_data_sources: 1, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.441 INFO Starting subgraph writer, queue_size: 5, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.449 INFO Data source count at start: 1, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.475 DEBG Starting or restarting subgraph, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.475 DEBG subscribing to chain head updates, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: BlockStream
May 28 15:32:46.672 INFO Syncing 250 blocks from Ethereum, code: BlockIngestionLagging, blocks_needed: 250, blocks_behind: 169773, latest_block_head: 13396259, current_block_head: 13226486, provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor
May 28 15:32:46.745 DEBG Starting block stream, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 15:32:46.746 INFO Scanning blocks [0, 0], range_size: 1, sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: BlockStream
May 28 15:32:46.746 DEBG Requesting logs for blocks [0, 0], contract 0xe2918aa38088878546c1a18f2f9b1bc83297fdd3, 1 events, topic1: [None], topic2: [None], topic3: [None], sgd: 67, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: BlockStream

On EC2:
root@ubuntu-g-2vcpu-8gb-sgp1-01:~/graphnode# cargo run -p graph-node --release --   --postgres-url postgresql://postgres:12345@localhost:5432/graph_node   --ethereum-rpc chiliz:https://rpc.ankr.com/chiliz/46eea1080721774ed6be3c607c20175add434865f16044a312bfdc34521dc4fb   --ipfs 127.0.0.1:5001 --debug
warning: /root/graphnode/graph/Cargo.toml: unused manifest key: dependencies.stable-hash_legacy.doc
    Finished `release` profile [optimized] target(s) in 0.33s
     Running `target/release/graph-node --postgres-url 'postgresql://postgres:12345@localhost:5432/graph_node' --ethereum-rpc 'chiliz:https://rpc.ankr.com/chiliz/46eea1080721774ed6be3c607c20175add434865f16044a312bfdc34521dc4fb' --ipfs '127.0.0.1:5001' --debug`
May 28 06:34:22.945 INFO Graph Node version: unknown (206c9111e 2024-05-28)
May 28 06:34:22.945 WARN GRAPH_POI_ACCESS_TOKEN not set; might leak POIs to the public via GraphQL
May 28 06:34:22.945 INFO Generating configuration from command line arguments
May 28 06:34:22.945 WARN No fork base URL specified, subgraph forking is disabled
May 28 06:34:22.945 INFO Starting up
May 28 06:34:22.945 INFO Trying IPFS node at: http://127.0.0.1:5001/
May 28 06:34:22.979 INFO Successfully connected to IPFS node at: http://127.0.0.1:5001/
May 28 06:34:23.009 INFO Creating transport, capabilities: archive, traces, url: https://rpc.ankr.com/chiliz/46eea1080721774ed6be3c607c20175add434865f16044a312bfdc34521dc4fb, provider: chiliz-rpc-0
May 28 06:34:23.749 DEBG Creating firehose networks [1 chains, ingestor default]
May 28 06:34:23.749 DEBG Creating firehose networks [1 chains, ingestor default]
May 28 06:34:23.749 WARN Expensive queries file not set to a valid file: /etc/graph-node/expensive-queries.txt
May 28 06:34:23.749 DEBG Cleaning up large notifications after about 300s, channel: store_events, component: NotificationListener
May 28 06:34:23.795 INFO Connecting to Postgres, weight: 1, conn_pool_size: 10, url: postgresql://postgres:HIDDEN_PASSWORD@localhost:5432/graph_node, pool: main, shard: primary
May 28 06:34:23.796 INFO Pool successfully connected to Postgres, pool: main, shard: primary, component: Store
May 28 06:34:23.796 DEBG Using postgres host order [Main], shard: primary, component: Store
May 28 06:34:23.833 INFO Setting up fdw, pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.868 INFO Running migrations, pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.872 INFO Migrations finished, pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.875 DEBG Postgres migration output, output: , pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.881 DEBG Release migration lock, pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.882 DEBG Setup finished, setup_time_s: 0, pool: main, shard: primary, component: ConnectionPool
May 28 06:34:23.886 DEBG Cleaning up large notifications after about 300s, channel: chain_head_updates, component: ChainHeadUpdateListener > NotificationListener
May 28 06:34:23.975 INFO Connecting to Ethereum to get network identifier, capabilities: archive, traces, provider: chiliz-rpc-0
May 28 06:34:24.266 INFO Connected to Ethereum, capabilities: archive, traces, network_version: 88888, provider: chiliz-rpc-0
May 28 06:34:24.268 INFO Creating LoadManager in disabled mode, component: LoadManager
May 28 06:34:24.269 INFO Started block ingestor, network_name: chiliz
May 28 06:34:24.269 INFO Starting block ingestor for network, network_name: chiliz
May 28 06:34:24.269 INFO Starting job runner with 5 jobs, component: JobRunner
May 28 06:34:24.269 DEBG Schedule for Vacuum subgraphs.subgraph_deployment, first_run_in_s: 0, interval_s: 60, component: JobRunner
May 28 06:34:24.269 DEBG Schedule for Report pg_notification_queue_usage(), first_run_in_s: 0, interval_s: 60, component: JobRunner
May 28 06:34:24.269 DEBG Schedule for Reconcile important tables from the primary, first_run_in_s: 9, interval_s: 900, component: JobRunner
May 28 06:34:24.269 DEBG Schedule for Record and remove unused deployments, first_run_in_s: 79, interval_s: 7200, component: JobRunner
May 28 06:34:24.269 DEBG Schedule for Refresh materialized views, first_run_in_s: 237, interval_s: 21600, component: JobRunner
May 28 06:34:24.270 INFO Starting JSON-RPC admin server at: http://localhost:8020, component: JsonRpcServer
May 28 06:34:24.270 INFO Starting metrics server at: http://localhost:8040, component: MetricsServer
May 28 06:34:24.271 INFO Starting GraphQL HTTP server at: http://localhost:8000, component: GraphQLServer
May 28 06:34:24.271 INFO Starting GraphQL WebSocket server at: ws://localhost:8001, component: SubscriptionServer
May 28 06:34:24.271 INFO Starting index node server at: http://localhost:8030, component: IndexNodeServer
May 28 06:34:24.271 DEBG Subgraph started, start_ms: 1, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphRegistrar
May 28 06:34:24.271 INFO Started all assigned subgraphs, node_id: default, count: 1, component: SubgraphRegistrar
May 28 06:34:24.273 INFO Resolve subgraph files using IPFS, n_templates: 1, n_data_sources: 1, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.277 INFO Successfully resolved subgraph files using IPFS, features: ø, n_templates: 1, n_data_sources: 1, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.288 INFO Starting subgraph writer, queue_size: 5, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.291 INFO Data source count at start: 1, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.339 DEBG Starting or restarting subgraph, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.339 DEBG subscribing to chain head updates, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: BlockStream
May 28 06:34:24.348 INFO Downloading latest blocks from Ethereum, this may take a few minutes..., provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor
May 28 06:34:24.417 DEBG Starting block stream, sgd: 1, subgraph_id: QmYrN6h8Tzu6xjCSpmagzj6GoaNc78xDFdcDZQNi92MBzz, component: SubgraphInstanceManager
May 28 06:34:24.684 INFO Checking eth_getBlockReceipts support, provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor
May 28 06:34:24.753 WARN Skipping use of block receipts, reason: Error fetching block receipts: Decoder error: Error("invalid hex character: -, at 0", line: 0, column: 0), provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor
May 28 06:34:24.831 DEBG Trying again after eth_getTransactionReceipt RPC call for transaction 0xb5fd7c80f6bf78df7aea631b115c91237cef555ad777b97a1a33408e4777c85a failed (attempt #1) with result Err(Decoder("Error(\"invalid hex character: -, at 0\", line: 0, column: 0)")), provider: chiliz-rpc-0, component: EthereumPollingBlockIngestor

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

OS information

None

incrypto32 commented 1 month ago

I think its defenitely due to the '-'. Maybe when the local environment makes the call it gets the right result back