test_top_level_failure_refunds_execution_state_gas()¶
Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_reservoir.py::test_top_level_failure_refunds_execution_state_gas@c74f1a67.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_reservoir.py::test_top_level_failure_refunds_execution_state_gas --fork Amsterdam
Verify top level tx failure returns execution state gas to the reservoir across revert, exceptional halt, and out of gas paths.
On top level failure no state was created, so execution state gas
is credited back to the reservoir and state_gas_used is zeroed.
The billing formula tx.gas - gas_left - state_gas_left sees a
restored reservoir and refunds the sender. Without the refund the
receipt would bill the consumed state gas despite the failure.
Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_reservoir.py
712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 | |
Parametrized Test Cases¶
This test generates 3 parametrized test cases across 1 fork.