Skip to content
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

fix(TXL-207): fixes gaps in transaction validation and async error logging #4596

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

dbrans
Copy link
Contributor

@dbrans dbrans commented Aug 12, 2024

Explanation

This PR repairs some gaps in our validation of transaction parameters:

  • validate that if a transaction envelope type is specified that it is a valid type
  • validate transaction parameters before right before adding transaction to state
  • catch and log async errors

Notes

References

This PR will fix these bugs once clients are updated:

Changelog

@metamask/transaction-controller

  • FIXED: Fixes gaps in transaction parameter validation and async error logging

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@dbrans dbrans added the team-transactions Transactions team label Aug 12, 2024
@dbrans dbrans requested a review from a team as a code owner August 12, 2024 12:38
@@ -2439,8 +2445,8 @@ export class TransactionController extends BaseController<

private async updateGasProperties(transactionMeta: TransactionMeta) {
const isEIP1559Compatible =
(await this.getEIP1559Compatibility(transactionMeta.networkClientId)) &&
transactionMeta.txParams.type !== TransactionEnvelopeType.legacy;
transactionMeta.txParams.type !== TransactionEnvelopeType.legacy &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swapped operands so that compatibility can be determined synchronously by tx type in some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-transactions Transactions team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants