test_worst_modarith()¶
Documentation for tests/benchmark/test_worst_compute.py::test_worst_modarith@88e9fb8f.
Generate fixtures for these test cases for Osaka with:
fill -v tests/benchmark/test_worst_compute.py::test_worst_modarith -m benchmark
Test running a block with as many "op" instructions with arguments of the parametrized range. The test program consists of code segments evaluating the "op chain": mod[0] = calldataload(0) mod[1] = (fixed_arg op args[indexes[0]]) % mod[0] mod[2] = (fixed_arg op args[indexes[1]]) % mod[1] The "args" is a pool of 15 constants pushed to the EVM stack at the program start. The "fixed_arg" is the 0xFF...FF constant added to the EVM stack by PUSH32 just before executing the "op". The order of accessing the numerators is selected in a way the mod value remains in the range as long as possible.
Source code in tests/benchmark/test_worst_compute.py
1743 1744 1745 1746 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 1837 1838 1839 1840 1841 1842 1843 1844 1845 | |
Parametrized Test Cases¶
This test case is only parametrized by fork.
| Test ID (Abbreviated) | op | mod_bits |
|---|---|---|
| ...fork_Prague-blockchain_test-op_ADDMOD-mod_bits_255 | ADDMOD | 255 |
| ...fork_Prague-blockchain_test-op_ADDMOD-mod_bits_191 | ADDMOD | 191 |
| ...fork_Prague-blockchain_test-op_ADDMOD-mod_bits_127 | ADDMOD | 127 |
| ...fork_Prague-blockchain_test-op_ADDMOD-mod_bits_63 | ADDMOD | 63 |
| ...fork_Prague-blockchain_test-op_MULMOD-mod_bits_255 | MULMOD | 255 |
| ...fork_Prague-blockchain_test-op_MULMOD-mod_bits_191 | MULMOD | 191 |
| ...fork_Prague-blockchain_test-op_MULMOD-mod_bits_127 | MULMOD | 127 |
| ...fork_Prague-blockchain_test-op_MULMOD-mod_bits_63 | MULMOD | 63 |
| ...fork_Osaka-blockchain_test-op_ADDMOD-mod_bits_255 | ADDMOD | 255 |
| ...fork_Osaka-blockchain_test-op_ADDMOD-mod_bits_191 | ADDMOD | 191 |
| ...fork_Osaka-blockchain_test-op_ADDMOD-mod_bits_127 | ADDMOD | 127 |
| ...fork_Osaka-blockchain_test-op_ADDMOD-mod_bits_63 | ADDMOD | 63 |
| ...fork_Osaka-blockchain_test-op_MULMOD-mod_bits_255 | MULMOD | 255 |
| ...fork_Osaka-blockchain_test-op_MULMOD-mod_bits_191 | MULMOD | 191 |
| ...fork_Osaka-blockchain_test-op_MULMOD-mod_bits_127 | MULMOD | 127 |
| ...fork_Osaka-blockchain_test-op_MULMOD-mod_bits_63 | MULMOD | 63 |