Skip to content

Support using access lists in a transaction #11863

Open
@ricmoo

Description

@ricmoo

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):

{"gas":"0x62f4","type":"0x2","from":"0x8ba1f109551bd432803012645ac136ddd64dba72","to":"0x8ba1f109551bd432803012645ac136ddd64dba72","data":"0x1234","accessList":[{"address":"0x8ba1f109551bD432803012645Ac136ddd64DBA72","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000001234"]}]}

Here is the transaction on Etherscan, 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>
  <body>
    <script type="text/javascript" src="ethers.umd.js"></script>
    <script type="text/javascript">
(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" ]
        }
      ]
    });
})();
    </script>
  </body>
</html>

(Note: ethers is available on GitHub)

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions