test_call_pre_charged_costs_excluded_from_forwarding()¶
Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py::test_call_pre_charged_costs_excluded_from_forwarding@a9abd46e.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py::test_call_pre_charged_costs_excluded_from_forwarding --fork Amsterdam
Verify pre-charged CALL costs do not reduce the 63/64 forwarding budget.
CALL charges access gas and memory expansion up front, before computing the 63/64 sub-call gas. Those costs must not be subtracted again during the forwarding calculation.
A wrapper contract receives a precise gas budget and calls a child with maximum gas and a large ret_size (triggering memory expansion). The child does a cold zero-to-nonzero SSTORE as proof of execution. The gas budget is tight enough that any double-counting of the pre-charged costs (access gas, memory expansion, or both) causes the child to OOG and the SSTORE to revert.
Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_call.py
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 1 fork.