MetaMask / MetaMask/core

bug: transaction with access list should not be assumed type `0x01`

Open
#5,720 0 comments 0 reactions 0 assignees View on GitHub
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.