Trace's methods are intermittent

As the title says, I’m attempting to use the trace methods (specifically trace_block). Everything is good with the response when it works normally. The only problem I face is intermittent: sometimes it works, other times it responds saying “the method does not exist or is not available.”

cURL:

curl --location --request POST 'https://mainnet.infura.io/v3/API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "trace_block",
    "params": [
        "0x132fed1"
    ],
    "id": 4
}'

Expected result:
Given the same request, receive the same response

Steps to reproduce:
Call the trace_block method on Ethereum mainnet repeatedly without modifying any parameters from the initial ones.

Obtained result:
Sometimes you will obtain the normal results, while other times you will receive an error (-32601) implying the method does not exist

{
    "jsonrpc": "2.0",
    "id": 4,
    "error": {
        "code": -32601,
        "message": "The method trace_block does not exist/is not available"
    }
}

Hey @FLiotta ,

The trace methods are available only to our paying customers. This response is expected if you’re using our Core Free account. I can’t reproduce the behaviour on my end. The response I am getting on my free account is the same as yours but consistent with each attempt.
Would mind sharing:

  • your email account + API key you’re using;
  • a request/response sample that worked;

Emil

Hello @epop,

API Keys are not meant to be shared.

According to the Infura documentation about JSON-RPC errors, the error -32601 indicates a method that does not exist or cannot be found. If the method does exist, but the problem is related to my account plan, it should respond with a different error code (e.g., -32005). This would save many headaches during development.

Infura JSON-RPC Errors Documentation

Greetings.

Hello @FLiotta ,

Yes, you’re correct. I shouldn’t have asked for the API key. It looks like I built this reflex while working on our TS requests in Zendesk. I appreciate you reminded me.
And I see your point concerning the error message. It could be phrased better.
The -32005 error code, though, is linked to exceeding the account request limit: " The request exceeds your request limit. For more information, refer to [Avoid rate limiting (Avoid rate limiting | INFURA)."
I don’t see it as a better fit for the situation raised here. Until this part receives an update, the error codes will remain as they are. Should you encounter something like this again in the future, please feel free to reach out. We’re more than happy to assist in any way we can.

Regards,
Emil

Hi,

I can confirm this issue.
I’m dealing with the same error, but just for a different method trace_filter instead of trace_block.
The corresponding Infura account is a non-free account.
Sometimes the API return -32601 or the expected response with the tracings.

curl https://holesky.infura.io/v3/API_KEY \
> -X POST \
> -H "Content-Type: application/json" \
> -d '{"jsonrpc":"2.0","method":"trace_filter","params":[{"fromBlock":"0x1fa24a","toBlock":"0x1fa24a", "count":1}],"id":415}'
{
  "jsonrpc": "2.0",
  "id": 415,
  "error": {
    "code": -32601,
    "message": "the method trace_filter does not exist/is not available"
  }
}
{
  "jsonrpc": "2.0",
  "id": 415,
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0x54ac97466cc2dbb739b752086b5740602c2d88ae",
        "gas": "0x7a3f",
        "input": "0x",
        "to": "0x3027baded70e0c28e8ae3472563e8beb23edb36d",
        "value": "0x2a964894cb23000"
      },
      "blockHash": "0x38be9b763f275caefcd57ca7f7b3aaf3b380369b38d9b9067d9814c944c1e708",
      "blockNumber": 2073162,
      "result": {
        "gasUsed": "0x0",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [],
      "transactionHash": "0x02f288f8668d0f626b484d50b8842adb341480e2e5c439c46c3ab5d9d4da5b6a",
      "transactionPosition": 0,
      "type": "call"
    }
  ]
}

Hi @sm_softjury ,

I managed to reproduce this on my end as well.
I’ll speak with our dev team and find the reason.
Please be aware that support is limited throughout the whole week, so I’d expect to get a reply no sooner than next Monday.

This topic was automatically closed after 30 days. New replies are no longer allowed.