-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove retry validation #4617
Conversation
Create util function to calculate new params. Remove duplication in speed up and cancel.
@metamaskbot publish-preview |
@metamaskbot publish-preview |
@metamaskbot publish-preview |
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions.
|
Hey @matthewwalsh0 : PR is changing and at same time moving the code which makes hard to review. |
The vast majority of changes are to remove the duplication, meaning the resulting logic should be identical except that |
Explanation
When calling
speedUpTransaction
orstopTransaction
, the existing gas fee values are increased by10%
unless specificgasValues
are provided.If provided, these are validated to at least be an increase of
10%
over the existing values in the original transaction.This validation has resulted in multiple errors due to scenarios such as:
maxFeePerGas
ormaxPriorityFeePerGas
was too low so it alone is increased via the UI, causing these validations to fail since the other value has not increased by at least10%
.10%
.This PR ultimately removes these validations so the controller can still automatically increase the previous gas fees if no new values are provided, however it is now the responsibility of the client to provide suitable values, and these are always respected.
In addition, to simplify the implementation and future maintenance of the fix, existing duplication between the
speedUpTransaction
andstopTransaction
methods has been removed via a new#retryTransaction
andgetTransactionParamsWithIncreasedGasFee
methods.References
Relates to #25337 #2444
Changelog
@metamask/transaction-controller
gasValues
passed tospeedUpTransaction
andstopTransaction
methods.Checklist