test_create_tx_header_gas_used()¶
Documentation for tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py::test_create_tx_header_gas_used@ffe48572.
Generate fixtures for these test cases for Bogota with:
Verify block header gas_used for a successful CREATE transaction.
A contract creation tx (to=None) with known gas costs. Compute exact gas_used from first principles and verify against the block header. Catches bugs where clients report gas_limit instead of actual consumed gas.
For a fresh target the top-frame NEW_ACCOUNT state gas is charged and dominates the execution gas, so gas_used == NEW_ACCOUNT. For a pre-existing balance-only leaf the target is not EMPTY pre-tx, so the top-frame NEW_ACCOUNT is never charged: net state gas is zero and only the execution dimension remains. The block-level calldata floor tops up that execution remainder, so the expected value is the greater of the execution intrinsic and the floor, and fails if a stray NEW_ACCOUNT is charged.
Source code in tests/amsterdam/eip8037_state_creation_gas_cost_increase/test_state_gas_create.py
1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | |
Parametrized Test Cases¶
This test generates 2 parametrized test cases across 2 forks.