MetaMask / MetaMask/metamask-extension
Support using access lists in a transaction
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Describe the bug**
In ethers.js I use a method to convert an accessList from a variety of formats to into the JSON-RPC format, which is then sent along with the transaction.
I'm currently having an issue where the access list is not being included. It may be a bug in MetaMask or in ethers and I'm trying to debug it, but am leaning towards the former, or that my format created within ethers needed by MetaMask is incorrect.
I am using the format outlined here: https://openethereum.github.io/JSONRPC
Here is a the transaction being sent to MetaMask (JSON-encoded to look nicer in this issue; the object sent to MM was not JSON-encoded):
```javascript
{"gas":"0x62f4","type":"0x2","from":"0x8ba1f109551bd432803012645ac136ddd64dba72","to":"0x8ba1f109551bd432803012645ac136ddd64dba72","data":"0x1234","accessList":[{"address":"0x8ba1f109551bD432803012645Ac136ddd64DBA72","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000001234"]}]}
```
Here is the [transaction on Etherscan](https://ropsten.etherscan.io/tx/0xcc52db4e686073efbbabef19190aa736b773924140685ad2c418bfb6888448d9#accesslist), which has an empty accessList (and if you decode the raw transaction is missing the accessList, but possesses the correct hash based on the missing accessList, so it isn't a bug on Etherscan's side).
**Steps to reproduce (REQUIRED)**
Use the following HTML:
```html
(async function() {
const signer = await new ethers.providers.Web3Provider(
window.ethereum
).getSigner()
let tx = await signer.sendTransaction({
to: signer.getAddress(),
data: "0x1234",
type: 2,
accessList: [
{
address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72",
storageKeys: [ "0x0000000000000000000000000000000000000000000000000000000000001234" ]
}
]
});
})();
```
(**Note:** ethers is [available on GitHub](https://github.com/ethers-io/ethers.js/tree/master/packages/ethers/dist))
**Expected behavior**
Transaction List is included.
**Browser details (please complete the following information):**
- OS: macOS
- Browser: Chrome (Version 92.0.4515.159)
- MetaMask Version: 10.0.0
Contributor guide
Research direction
Start with the supplied HTML reproduction and trace the MetaMask transaction submission path for type-2 transactions. Compare the accessList in the request with the resulting transaction and verify that the submitted transaction retains the access list shown in the reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100