eth_createAccessList
The eth_createAccessList method creates an EIP-2930 access list for a transaction by simulating its execution. This method analyzes what storage slots and addresses will be accessed during transaction execution and generates an optimal access list that can be included in the transaction.
Access lists were introduced in EIP-2930 as part of the Berlin hard fork to mitigate some of the gas cost increases from EIP-2929. By pre-declaring which addresses and storage slots a transaction will access, you can receive discounted gas prices for those accesses. This method is particularly useful for complex transactions that interact with multiple contracts or access many storage slots, such as DEX swaps, flash loans, or complex DeFi protocols. The method returns both the generated access list and the estimated gas usage, helping you decide whether using an access list will actually reduce costs for your specific transaction.
The access list includes all addresses and storage slots touched during simulation. Including this list in your transaction can reduce gas costs, but the list itself has a cost (2400 gas per address + 1900 gas per storage key), so it's beneficial mainly for transactions with multiple storage accesses.
Parameters
parameter | type | description |
|---|---|---|
transaction | object (required) | Transaction object with from, to, gas, gasPrice, value, data fields |
blockParameter | string (optional) | Block number in hex or tag (latest, earliest, pending) |
Return Object
The method returns an object containing the generated access list and gas estimation:
field | type | description |
|---|---|---|
accessList | array | Array of access list entries. Each entry contains: address (contract address that will be accessed) and storageKeys (array of storage slot keys that will be read or written) |
gasUsed | string | Estimated gas consumption for the transaction if the access list is used (hexadecimal). This estimate includes the gas cost of the access list itself |
error | string | Optional error message if the transaction simulation failed. The access list may still be partially generated up to the point of failure |
Request Example
Response Example