Skip to content

test_large_access_list_cost()

Documentation for tests/amsterdam/eip7981_increase_access_list_cost/test_access_list_cost.py::test_large_access_list_cost@a9abd46e.

Generate fixtures for these test cases for Amsterdam with:

fill -v tests/amsterdam/eip7981_increase_access_list_cost/test_access_list_cost.py::test_large_access_list_cost --fork Amsterdam

Test gas costs for large access lists.

With EIP-7981, large access lists should incur: 1. Storage access costs (2400 per address + 1900 per key) 2. Data footprint costs (16 per floor token)

Source code in tests/amsterdam/eip7981_increase_access_list_cost/test_access_list_cost.py
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
@pytest.mark.with_all_tx_types(selector=lambda tx_type: tx_type >= 1)
@pytest.mark.parametrize(
    "access_list",
    [
        pytest.param(
            [
                AccessList(
                    address=Address(i),
                    storage_keys=[Hash(j) for j in range(5)],
                )
                for i in range(1, 6)
            ],
            id="five_addresses_five_keys_each",
        ),
    ],
)
@pytest.mark.parametrize(
    "to",
    [pytest.param("eoa", id="")],
    indirect=True,
)
def test_large_access_list_cost(
    state_test: StateTestFiller,
    pre: Alloc,
    tx: Transaction,
) -> None:
    """
    Test gas costs for large access lists.

    With EIP-7981, large access lists should incur:
    1. Storage access costs (2400 per address + 1900 per key)
    2. Data footprint costs (16 per floor token)
    """
    state_test(
        pre=pre,
        post={},
        tx=tx,
    )

Parametrized Test Cases

This test generates 4 parametrized test cases across 1 fork.