MetaMask / MetaMask/metamask-extension
Prevent setting gas price below minimum
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
We should query `txpool.pricebump` from the current network and disallow setting a new gas price that falls below that. This way users wouldn't even get to the point of trying to submit a transaction with a gas price below the minimum (which will be certainly rejected).
_Original issue description (see discussion below for edit reason):_
Somewhat related to #9317, in that the way to reproduce is the same, only the error message is now different:
`Transaction N failed! Error: [ethjs-rpc] while formatting outputs from RPC '{"value":{"code":-32000, "message":"replacement transaction underpriced"}}'`
Stop making decisions instead of the user on what gas price is allowed. If I want to speed up by only adding 10 Gwei to the original, and I'm fine with my transaction confirming within 48 hours, then let me do it.
- MetaMask Version: 9.0.5
Contributor guide
Research direction
Start by tracing the transaction gas-price validation and submission flow, then identify how the current network exposes txpool.pricebump. Done means a new gas price below that network minimum is rejected before submission, with behavior covering the replacement-transaction case described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100