Commit 5259132
Amsterdam: EIP-8037: State Creation Gas Cost Increase (besu-eth#9815)
* EIP-8037: multidimensional gas metering - EVM core
Implement state gas tracking in the EVM layer:
- StateGasCostCalculator and Eip8037StateGasCostCalculator for cost-per-state-byte
- AmsterdamGasCalculator with split regular/state gas costs
- MessageFrame state gas reservoir, spill, and collision tracking
- State gas charging in SSTORE, CREATE, CALL, and SELFDESTRUCT operations
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* EIP-8037: protocol-level 2D gas accounting integration
Wire state gas into transaction processing, block building, and validation:
- MainnetTransactionProcessor: intrinsic state gas, reservoir init, spill handling
- BlockGasAccountingStrategy.AMSTERDAM: 2D gas metering (max of regular, state)
- BlockGasUsedValidator.AMSTERDAM: pre-refund 2D validation
- OsakaTargetingGasLimitCalculator: Amsterdam constructor with uncapped tx gas limit
- Block creation: 2D headroom checks for transaction selection
- TransactionProcessingResult: carry state gas used
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* EIP-8037: update execution spec tests for bal-devnet-3
Update reference test fixtures to bal@v5.2.0 for EIP-8037 compatibility.
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* EIP-8037: extract TransactionGasAccounting and add test coverage
Extract gas accounting logic from MainnetTransactionProcessor into a
testable TransactionGasAccounting class with builder pattern. Add tests
for SSTORE state gas, block gas accounting strategy, state gas spill,
and regular gas limit enforcement.
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* trigger DCO re-check
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* Add -Pcases to jmh (besu-eth#9982)
e.g. ./gradlew --no-daemon :ethereum:core:jmh -Pincludes=Mod -Pexcludes=Mul,Add,SMod -Pcases=MOD_256_128,MOD_256_192
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
* Preserve caller-provided gas pricing in eth_simulateV1 results (besu-eth#9972)
* preserve caller-provided gas prices in TransactionSimulator
When isAllowExceedingBalance is true but the caller explicitly provided
non-zero gas pricing parameters, preserve them and the block header's
baseFee so effective gas price is computed correctly during execution.
This ensures gas fees are actually charged so that stateRoot and block
hash are correct in eth_simulateV1 results.
When gas params are absent or zero (typical eth_call, or explicitly
zero maxFeePerGas), behavior is unchanged - all fields stay zero and
baseFee is zeroed to avoid validation failures.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
---------
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* trigger DCO re-check
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* spotless
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* update to BAL v5.3.0 spec tests
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* remove referenceTestDevnet test compilation from the referenceTest gradle task
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* addressed comments
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* renamed BlockGasAccountingStrategy.calculateBlockGas to calculateTransactionRegularGas
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
* 1. use BlockGasAccountingStrategy.hasBlockCapacity() in AbstractBlockProcessor.java, AbstractBlockProcessorTest.java
2. move handleStateGasSpill into its own method
3. Added CREATE state gas underflow guard
4. Improved failCodeDepositWithoutRollback documentation
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
---------
Signed-off-by: daniellehrner <daniel.lehrner@consensys.net>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>1 parent f1dd5ff commit 5259132
File tree
40 files changed
+2926
-230
lines changed- acceptance-tests/tests/src/acceptanceTest/java/org/hyperledger/besu/tests/acceptance/ethereum
- ethereum
- blockcreation/src
- main/java/org/hyperledger/besu/ethereum/blockcreation
- txselection
- selectors
- test/java/org/hyperledger/besu/ethereum/blockcreation
- txselection/selectors
- core/src
- main/java/org/hyperledger/besu/ethereum
- mainnet
- processing
- test/java/org/hyperledger/besu/ethereum/mainnet
- referencetests
- src/main/java/org/hyperledger/besu/ethereum/referencetests
- evm/src
- main/java/org/hyperledger/besu/evm
- frame
- gascalculator
- operation
- processor
- test/java/org/hyperledger/besu/evm
- gascalculator
- operation
- gradle
40 files changed
+2926
-230
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
329 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | | - | |
| 686 | + | |
687 | 687 | | |
688 | 688 | | |
689 | 689 | | |
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
885 | | - | |
| 885 | + | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
| |||
Lines changed: 24 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | | - | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
65 | 68 | | |
66 | | - | |
| 69 | + | |
67 | 70 | | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
73 | | - | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
92 | 96 | | |
93 | 97 | | |
94 | 98 | | |
95 | | - | |
96 | | - | |
| 99 | + | |
| 100 | + | |
97 | 101 | | |
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
103 | 111 | | |
104 | 112 | | |
105 | 113 | | |
| |||
137 | 145 | | |
138 | 146 | | |
139 | 147 | | |
140 | | - | |
| 148 | + | |
141 | 149 | | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
| |||
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
153 | | - | |
154 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
158 | | - | |
159 | | - | |
| 168 | + | |
| 169 | + | |
160 | 170 | | |
161 | 171 | | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| |||
Lines changed: 61 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | | - | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
40 | 46 | | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
54 | | - | |
| 61 | + | |
55 | 62 | | |
56 | | - | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
61 | | - | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | | - | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
88 | 110 | | |
89 | 111 | | |
90 | 112 | | |
91 | 113 | | |
92 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
93 | 117 | | |
94 | | - | |
95 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
96 | 123 | | |
97 | 124 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
102 | 128 | | |
103 | 129 | | |
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
107 | | - | |
| 133 | + | |
108 | 134 | | |
109 | 135 | | |
110 | | - | |
111 | | - | |
112 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
113 | 141 | | |
114 | 142 | | |
115 | 143 | | |
116 | 144 | | |
117 | | - | |
| 145 | + | |
118 | 146 | | |
119 | 147 | | |
120 | 148 | | |
| |||
125 | 153 | | |
126 | 154 | | |
127 | 155 | | |
128 | | - | |
| 156 | + | |
129 | 157 | | |
130 | 158 | | |
131 | | - | |
132 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
133 | 163 | | |
134 | 164 | | |
135 | 165 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
0 commit comments