|
35 | 35 | )
|
36 | 36 |
|
37 | 37 | from .computation import LondonComputation
|
38 |
| -from .transactions import LondonTypedTransaction |
39 | 38 | from .validation import validate_london_normalized_transaction
|
40 | 39 |
|
41 | 40 |
|
@@ -180,18 +179,18 @@ def get_transaction_context(self: StateAPI,
|
180 | 179 | London-specific transaction context creation,
|
181 | 180 | where gas_price includes the block base fee
|
182 | 181 | """
|
183 |
| - if isinstance(transaction, LondonTypedTransaction): # TODO probably do this somewhere else |
184 |
| - priority_fee_per_gas = min( |
185 |
| - transaction.max_priority_fee_per_gas, |
186 |
| - transaction.max_fee_per_gas - self.execution_context.base_fee_per_gas |
187 |
| - ) |
188 |
| - else: |
189 |
| - priority_fee_per_gas = min( |
190 |
| - transaction.gas_price, |
191 |
| - transaction.gas_price - self.execution_context.base_fee_per_gas |
192 |
| - ) |
| 182 | + effective_gas_price = min( |
| 183 | + transaction.max_priority_fee_per_gas + self.execution_context.base_fee_per_gas, |
| 184 | + transaction.max_fee_per_gas, |
| 185 | + ) |
| 186 | + # See how this reduces in a pre-1559 transaction: |
| 187 | + # 1. effective_gas_price = min( |
| 188 | + # transaction.gas_price + self.execution_context.base_fee_per_gas, |
| 189 | + # transaction.gas_price, |
| 190 | + # ) |
| 191 | + # base_fee_per_gas is non-negative, so: |
| 192 | + # 2. effective_gas_price = transaction.gas_price |
193 | 193 |
|
194 |
| - effective_gas_price = self.execution_context.base_fee_per_gas + priority_fee_per_gas |
195 | 194 | return self.get_transaction_context_class()(
|
196 | 195 | gas_price=effective_gas_price,
|
197 | 196 | origin=transaction.sender
|
|
0 commit comments