bug: transaction with access list should not be assumed type `0x01`
- Dominant language
- TypeScript
- Stars
- 413
- Forks
- 308
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Description
The setEnvelopeType function will currently will set a transaction to have a type of `0x01` if `accessList` is specified:
https://github.com/MetaMask/core/blob/04001ea16d2565661e73d24848f664bfaad248ff/packages/transaction-controller/src/utils/utils.ts#L225-L230
`accessList` however, can also appear in a 1559 transaction (type `0x02`).
This leads to an issue for [addTransaction](https://github.com/MetaMask/core/blob/04001ea16d2565661e73d24848f664bfaad248ff/packages/transaction-controller/src/TransactionController.ts#L1057) where `accessList` can never be used in a transaction with `maxFeePerGas`/`maxPriorityFeePerGas` unless the type is explicitly stated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in packages/transaction-controller/src/utils/utils.ts at setEnvelopeType, then inspect addTransaction in packages/transaction-controller/src/TransactionController.ts. Trace how accessList is handled alongside maxFeePerGas and maxPriorityFeePerGas. Done means an access-list transaction with those fee fields is not assumed to be type 0x01 when no explicit type is provided, with regression coverage for the reported case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100