question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support for createAccessList

See original GitHub issue

Describe the Feature

By EIP-2930, transaction containing an access list can reduce gas price. However, it’s hard to determine what accessList should be passed when building a transaction. Fortunately, many geth nodes support eth_createAccessList rpc and this method creates accessList based on a given transaction.

It’s already issued before in #1364, but it’s closed without supporting eth_createAccessList. ethers.js supports accessList in transaction param, but it doesn’t support eth_createAccessList rpc to create accessList for the transaction.

According to EIP-2930 - Rationale: Charging less for accesses in the access list, passing accessList to transaction is encouraged since it helps to pre-load data from database (such as by loading the data in parallel). It also helps to reduce gas consumption for transactions.

RPC Documentation

https://geth.ethereum.org/docs/rpc/ns-eth#eth_createaccesslist

eth_createAccessList is similar with eth_estimateGas. It returns the estimated gas like eth_estimateGas, but it also returns accessList for the transaction.

Code Example

const { accessList, gasUsed } = await provider.createAccessList(txReq);
txReq.accessList = accessList;

const tx = await provider.sendTransaction(txReq);

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
CryptoKiddiescommented, Jun 29, 2022

Looking forward to this feature as well. @0xall in the meantime, you can still access the create list api using the low level ethers method send from your wallet instance.

2reactions
ricmoocommented, Jun 15, 2022

Cool cool. I’ll try it out and figure out the best way to add it to the API. We don’t want to include it by default (like we do for estimate gas, which is required) since the reads and writes may not be consistent, which could make transactions wildly more expensive as you would pre-pay for slots you end up not accessing.

But maybe it makes sense in v6 to add a pseudo-property, like the planned gasMultiplier which is part of the porcelain API to hint to fill in the accessList.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found