Commit 1dabc40
alloy-op-evm: pin post-exec settlement conservation at arithmetic extremes
Closes the max-input saturation gap the SDM FMA flags as NON-BLOCKING under
FM2. Nothing pinned that the saturating arithmetic in post_exec_settlement_deltas
cannot silently truncate a settlement leg and break value conservation under
the widest inputs a hostile producer can reach.
Sweeps base_fee in {0, 1, 1e9, u64::MAX} x refund in {1, 21k, u64::MAX/2,
u64::MAX} x effective_gas_price in {basefee, basefee+1, u128::MAX}, asserting
each leg against its exact closed form as well as the conservation identity
sender == beneficiary + base_fee + operator_fee. Checking the legs individually
matters: the identity alone still holds if two legs clamp by offsetting
amounts. All of them hold exactly, so no saturation engages — the widest
product is ~2^192, well inside U256.
Only effective_gas_price >= basefee is exercised: below-basefee txs never reach
settlement (revm rejects them with GasPriceLessThanBasefee upstream), which is
the precondition the beneficiary_gas_price saturating_sub relies on.
This is coverage only; no behavior change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 3d10b89 commit 1dabc40
1 file changed
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
848 | 903 | | |
849 | 904 | | |
850 | 905 | | |
| |||
0 commit comments