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.
Summary
The Web3Gateway link check (GitHub Action) reports
400: Bad Requesterrors with the messageInvalid method namefor certain links:Description
This error occurs after uploading a new file to a
FlatDictionarycontract 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
FlatDictionarycontract implements aresolveModemethod that should returnmanual.web3protocol-go. (The debug log was specifically added to web3protocol-go to troubleshoot this issue.)resolveModereturns nothing, the system defaults toautomode 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 withinvalid method name.Mitigation Steps Taken
web3protocol-go, the cache is temporarily disabled whenresolveModereturns nothing, reducing the frequency of the issue.Next Steps
resolveModeon the SWC beta testnet may require more in-depth monitoring or analysis of the underlying RPC service.