Skip to content

Gateway shows Invalid method name for auto mode resources on L2 beta testnet sometimes #70

@syntrust

Description

@syntrust

Summary

The Web3Gateway link check (GitHub Action) reports 400: Bad Request errors with the message Invalid method name for certain links:

The following links failed:
https://0x6270Fb385806f52341eb68258Ac6BF8012dCddCF.3337.w3link.io/test.txt -> HTTP status 400: <title>Error</title>

400: Bad Request

Invalid method name: test.txt


https://0x6270Fb385806f52341eb68258Ac6BF8012dCddCF.3337.web3gateway.dev/test.txt -> HTTP status 400: <title>Error</title>

400: Bad Request

Invalid method name

Description

This error occurs after uploading a new file to a FlatDictionary contract and persists until the gateway is restarted. The issue does not reproduce when running the same tests on Sepolia, and continuous testing indicates that the error occurs randomly.

Root Cause Analysis

  • The FlatDictionary contract implements a resolveMode method that should return manual.
  • Occasionally, calls to this method return no value (without throwing an error), as observed in the logs from web3protocol-go. (The debug log was specifically added to web3protocol-go to troubleshoot this issue.)
  • Per the specification, when resolveMode returns nothing, the system defaults to auto mode and treats the first part of the URL path as a contract method name. Since the contract does not have a method matching this part (test.txt), the gateway responds with invalid method name.
  • This behavior appears to be linked to unreliable RPC responses on the SWC beta testnet.

Mitigation Steps Taken

  • In the debug version of web3protocol-go, the cache is temporarily disabled when resolveMode returns nothing, reducing the frequency of the issue.
  • In the GitHub workflow, failed link tests are now automatically retried up to three times with progressively increasing intervals.

Next Steps

  • Further investigation into the root cause of the empty responses from resolveMode on the SWC beta testnet may require more in-depth monitoring or analysis of the underlying RPC service.
  • Alternatively, migrating the tests from the SWC beta testnet to the upcoming beta2 testnet could provide additional insights and help determine whether the issue is specific to the current environment.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions