MetaMask / MetaMask/metamask-extension

Metamask does not display the expected error message

Open
#24,901 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

external-contributor
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

1. base env
* Chrome 122.0.6261.57
* MetaMask 11.15.6
2. send invalid tx to [**xlayer** testnet](https://www.okx.com/xlayer/docs/getting-started/user-guide/network-information), the `eth_sendRawTransaction` response and error display:
```
{
"jsonrpc": "2.0",
"id": 7577166421925616,
"error": {
"code": -32000,
"message": "nonce too low"
}
}
```
截屏2024-05-30 18 42 41

3. send invalid tx to **sepolia** testnet, the `eth_sendRawTransaction` response and error display:
```
{
"jsonrpc": "2.0",
"id": 7577166421925488,
"error": {
"code": -32000,
"message": "nonce too low: next nonce 4, tx nonce 1"
}
}
```
截屏2024-05-30 18 40 43

4. Why is the information displayed different, `Internal JSON-RPC error.` and `nonce too low: next nonce 4, tx nonce 1`.
I think it should show "nonce too low" for `2 xlayer testnet`.

### Scenario

_No response_

### Design

_No response_

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the invalid eth_sendRawTransaction cases on XLayer and Sepolia and compare how their JSON-RPC errors are handled. Trace the extension's error-display path from the RPC response; done means the XLayer case shows "nonce too low" instead of "Internal JSON-RPC error."

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.