Skip to content

test_call_large_args_offset_size_zero()

Documentation for tests/frontier/opcodes/test_call.py::test_call_large_args_offset_size_zero@88e9fb8f.

Generate fixtures for these test cases for Osaka with:

fill -v tests/frontier/opcodes/test_call.py::test_call_large_args_offset_size_zero --fork Osaka

Test xCALL with an extremely large args_offset and args_size set to zero. Since the size is zero, the large offset should not cause a revert.

Source code in tests/frontier/opcodes/test_call.py
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
@pytest.mark.with_all_call_opcodes
@pytest.mark.valid_from("Berlin")
def test_call_large_args_offset_size_zero(
    state_test: StateTestFiller,
    pre: Alloc,
    fork: Fork,
    call_opcode: Op,
) -> None:
    """
    Test xCALL with an extremely large args_offset and args_size set to zero.
    Since the size is zero, the large offset should not cause a revert.
    """
    sender = pre.fund_eoa()

    gsc = fork.gas_costs()
    very_large_offset = 2**100

    call_measure = CodeGasMeasure(
        code=call_opcode(gas=0, args_offset=very_large_offset, args_size=0),
        # Cost of pushing xCALL args
        overhead_cost=gsc.G_VERY_LOW * len(call_opcode.kwargs),
        extra_stack_items=1,  # Because xCALL pushes 1 item to the stack
        sstore_key=0,
    )

    contract = pre.deploy_contract(call_measure)

    tx = Transaction(
        gas_limit=500_000,
        to=contract,
        value=0,
        sender=sender,
    )

    # this call cost is just the address_access_cost
    call_cost = gsc.G_COLD_ACCOUNT_ACCESS

    state_test(
        env=Environment(),
        pre=pre,
        tx=tx,
        post={
            contract: Account(
                storage={
                    0: call_cost,
                },
            )
        },
    )

Parametrized Test Cases

The interactive table below is also available as a standalone page.

Test ID (Abbreviated) call_opcode evm_code_type
...fork_Berlin-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Berlin-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Berlin-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Berlin-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Berlin-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Berlin-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Berlin-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Berlin-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_London-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_London-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_London-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_London-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_London-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_London-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_London-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_London-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Paris-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Paris-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Paris-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Paris-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Paris-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Paris-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Paris-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Paris-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Shanghai-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Shanghai-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Shanghai-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Shanghai-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Shanghai-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Shanghai-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Shanghai-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Shanghai-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Cancun-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Cancun-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Cancun-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Cancun-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Cancun-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Cancun-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Cancun-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Cancun-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Prague-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Prague-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Prague-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Prague-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Prague-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Prague-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Prague-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Prague-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY
...fork_Osaka-call_opcode_STATICCALL-evm_code_type_LEGACY-state_test STATICCALL LEGACY
...fork_Osaka-call_opcode_STATICCALL-evm_code_type_LEGACY-blockchain_test_from_state_test STATICCALL LEGACY
...fork_Osaka-call_opcode_DELEGATECALL-evm_code_type_LEGACY-state_test DELEGATECALL LEGACY
...fork_Osaka-call_opcode_DELEGATECALL-evm_code_type_LEGACY-blockchain_test_from_state_test DELEGATECALL LEGACY
...fork_Osaka-call_opcode_CALL-evm_code_type_LEGACY-state_test CALL LEGACY
...fork_Osaka-call_opcode_CALL-evm_code_type_LEGACY-blockchain_test_from_state_test CALL LEGACY
...fork_Osaka-call_opcode_CALLCODE-evm_code_type_LEGACY-state_test CALLCODE LEGACY
...fork_Osaka-call_opcode_CALLCODE-evm_code_type_LEGACY-blockchain_test_from_state_test CALLCODE LEGACY