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

Unable to fetch block using Hardhat node #9134

Closed
zeGzD opened this issue Jan 11, 2024 · 6 comments · Fixed by #9178
Closed

Unable to fetch block using Hardhat node #9134

zeGzD opened this issue Jan 11, 2024 · 6 comments · Fixed by #9178
Assignees

Comments

@zeGzD
Copy link

zeGzD commented Jan 11, 2024

Description

When launching Blockscout along side an Hardhat node it fails to fetch the blocks.

Here is what the log displays when a tx is submitted (with success) to the Hardhat node:

{"time":"2024-01-11T09:40:28.968Z","severity":"info","message":"Checking if index needs to catch up in 10000ms.","metadata":{"fetcher":"block_catchup"}}
{"time":"2024-01-11T09:40:29.600Z","severity":"error","message":"failed to fetch block: [%{code: 404, data: %{number: 5}, message: \"Not Found\"}].  Block will be retried by catchup indexer.","metadata":{"block_number":5,"fetcher":"block_realtime"}}
{"time":"2024-01-11T09:40:34.162Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":1,"error_count":1,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:37.165Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":1,"error_count":1,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:38.970Z","severity":"info","message":"Index already caught up.","metadata":{"fetcher":"block_catchup","first_block_number":null,"last_block_number":null,"missing_block_count":0,"shrunk":false}}
{"time":"2024-01-11T09:40:38.970Z","severity":"info","message":"Checking if index needs to catch up in 20000ms.","metadata":{"fetcher":"block_catchup"}}
{"time":"2024-01-11T09:40:40.164Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":2,"error_count":2,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:43.165Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":3,"error_count":3,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:46.167Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":3,"error_count":3,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:49.168Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":4,"error_count":4,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:52.167Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":4,"error_count":4,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:55.167Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":5,"error_count":5,"fetcher":"internal_transaction"}}
{"time":"2024-01-11T09:40:58.169Z","severity":"error","message":"failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32602, data: %{block_number: 5, transaction_hash: \"0x39375e282e7023513d0718ea0a44c4518a22cd1a5a4054178da133f2c7731b97\", transaction_index: 0}, message: \"Hardhat currently only supports the default tracer, so no tracer parameter should be passed.\"}]","metadata":{"count":6,"error_count":6,"fetcher":"internal_transaction"}}

(the same error keep occurring virtually forever and no transaction appears on the frontend)

Type of the installation

Docker-compose

Type of the JSON RPC archive node

Hardhat

Type of the chain

Local dev

Link to the page

No response

Steps to reproduce

  1. Run on a single machine containers for Blockscout and Hardhat node as well
  2. Submit a tx
  3. Blockscout fails to fetch/index anything

Backend version

latest (6.0.0 ?)

Frontend version

latest (6.0.0 ?)

Elixir & Erlang/OTP versions

latest

Operating system

Ubuntu 22.04

Additional information

Hardhat version: 2.19.3
Solidity version: 0.8.21

@marty-nilli
Copy link

I'm seeing this same error on Ubuntu. When I run the same setup on Mac, it does work properly (and the frontend returns transactions made against Hardhat). It may have to do with host.docker.internal reference that seemingly doesn't exist on Linux the same way it does on Mac/Win??

@zeGzD
Copy link
Author

zeGzD commented Feb 27, 2024

This issue is still there with the last version.

@zeGzD
Copy link
Author

zeGzD commented Apr 15, 2024

@vbaranov Still not working with the last release.
The backend log keeps getting spammed with things like:
{"time":"2024-04-15T15:16:25.828Z","severity":"error","message":"failed to fetch block: [%{code: 404, data: %{number: 6}, message: \"Not Found\"}]. Block will be retried by catchup indexer.","metadata":{"block_number":6,"fetcher":"block_realtime"}}

@vbaranov
Copy link
Member

Please provide all steps to reproduce the issue.

@zeGzD
Copy link
Author

zeGzD commented Apr 15, 2024

  1. Grab blockscout for docker-compose : https://github.com/blockscout/blockscout/tree/master/docker-compose
  2. Add one container running hadhat with, by example, this config:
require("hardhat-tracer");

module.exports = {
    defaultNetwork: "hardhat",  
    networks: {
      hardhat: {
        chainId: 31337,
        gas: 30000000,
        blockGasLimit: 0x1fffffffffffff,
        gasPrice: 20000000000,
        mining: {
          auto: true
        },
      },
    },
    solidity: "0.8.21"
};
  1. Up the container stack and wait for every single container to be running
  2. Setup metamask on the hardhat container and verify the default wallet addresses actually own 1000 ETH
  3. Start making basic transferts from those addresses and verify in the hardhat node log the transactions are passed (and in metamask the balances have changed)
  4. Check the blockscout frontend to see no data are populated, then check the blockscout backend container log to see the errors I told about previously

@zeGzD
Copy link
Author

zeGzD commented Apr 16, 2024

@vbaranov feel free to let me know if you need more details

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

Successfully merging a pull request may close this issue.

3 participants