For the complete documentation index, see llms.txt. This page is also available as Markdown.

eth_createAccessList - Ethereum

Example code for the eth_createAccessList JSON RPC method. Сomplete guide on how to use eth_createAccessList JSON RPC in GetBlock Web3 documentation.

This method returns an EIP-2930 access list for a transaction — the list of accounts and storage slots the transaction would touch during execution. Transactions with a pre-declared access list pay lower gas per SLOAD/BALANCE than without one (though the access list itself has a size cost). Nodes and MEV searchers use this to pre-compute optimal access lists.

Parameters

Parameter
Type
Required
Description

transaction

object

Yes

Transaction call object — same shape as eth_call transaction object

blockParameter

string

No

Block number in hex, or latest, earliest, pending, finalized, safe. Defaults to latest

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_createAccessList",
    "params": [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://go.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_createAccessList',
    params: [
        {
            "from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
            "to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
            "data": "0x70a08231000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045"
        },
        "latest"
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

Response

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC protocol version ("2.0")

id

string

Request identifier matching the request

result.accessList

array of object

The computed access list — array of {address, storageKeys} entries

result.gasUsed

string

Total gas the transaction would consume with this access list

Use Cases

  • Type-1 Transaction Optimization: Wrap a transaction in a type-1 EIP-2930 transaction with the returned access list for slightly lower gas cost

  • MEV Bundle Optimization: Precompute access lists for bundle transactions to reduce total bundle gas

  • Complex Call Preflight: Understand what state a complex call will touch before executing it on-chain

  • Multi-Contract Access Analysis: Reveal cross-contract state touches for security analysis or gas budgeting

Error Handling

Error Code
Message
Description

-32602

Invalid params

Transaction object is malformed

3

Execution reverted

The transaction would revert during simulation

-32000

Execution error

Node failed to compute the access list

Web3 Integration

Last updated

Was this helpful?