Skip to content

Commit 4f54e1b

Browse files
Update EIP-7999: Minor edits to EIP-7999
Merged by EIP-Bot.
1 parent 9bda52a commit 4f54e1b

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

EIPS/eip-7999.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ def get_required_max_fee(base_fees: list[int], tx_gas_limits: list[int]) -> int:
145145
return sum(vector_mul(base_fees, tx_gas_limits))
146146
```
147147

148-
**At the start of block processing**:
148+
**At the start of processing a block**:
149149

150-
* We initialize a vector `gas_used_so_far` to `[0, 0, 0]`.
150+
* initialize a vector `gas_used_so_far` to `[0, 0, 0]`,
151+
* derive the base fee `base_fees = get_block_base_fees(block.parent)`.
151152

152153
**At the start of processing a transaction**:
153154

154155
* Derive basic properties of the tx:
155156
* `max_fee = get_max_fee(tx)`,
156-
* `base_fees = get_block_base_fees(block.parent)`,
157157
* `tx_gas_limits = get_gas_limits(tx)`.
158158
* `max_base = get_required_max_fee(base_fees, tx_gas_limits)`
159159
* Require that
@@ -275,33 +275,23 @@ Besides UX, resource-specific fee limits can also be unfortunate at a deeper eco
275275

276276
Consider a multidimensional transaction with a `gas_limit` vector $\mathbf{l} = (l_1, l_2,\dots, l_n)$, a `max_fee_per_gas` vector $\mathbf{f} = (f_1, f_2, \dots, f_n)$, and a `max_priority_fee_per_gas` vector $\mathbf{p} = (p_1, p_2, \dots, p_n)$. The consumed gas of the transaction is denoted $\mathbf{g} = (g_1, g_2, \dots, g_n)$, and the vector of base fees is denoted $\mathbf{b} = (b_1, b_2, \dots, b_n)$. The realized priority fee, after ensuring a sufficient base fee, is then
277277

278-
$$
279-
p{\prime}_i = \min(p_i, f_i-b_i)
280-
$$
278+
$p{\prime}_i = \min(p_i, f_i-b_i)$
281279

282280
for all resources $i$. Assume that when the transaction is submitted, the user specifies a `max_fee_per_gas` vector $\mathbf{f}$ such that all entries individually satisfy all base fee $\mathbf{b}$ criteria
283281

284-
$$
285-
f_i \ge b_i \quad \text{for all resources } i.
286-
$$
282+
$f_i \ge b_i \quad \text{for all resources } i.$
287283

288284
The gas limits also satisfy the actual gas consumption
289285

290-
$$
291-
l_i \ge g_i \quad \text{for all resources } i.
292-
$$
286+
$l_i \ge g_i \quad \text{for all resources } i.$
293287

294288
The `max_priority_fee_per_gas` vector $\mathbf{p}$ is also considered sufficient by many proposers, when they jointly weigh the reward against competing transactions using a weight vector $\mathbf{w}$, considering contention across relevant resources:
295289

296-
$$
297-
\sum p{\prime}_i g_i \ge \sum w_i g_i.
298-
$$
290+
$\sum p{\prime}_i g_i \ge \sum w_i g_i.$
299291

300292
While not evaluated in the existing EIP, the base fees $\mathbf{b}$ could also be satisfied in aggregate against the max fees:
301293

302-
$$
303-
\sum f_i l_i \ge \sum b_i l_i.
304-
$$
294+
$\sum f_i l_i \ge \sum b_i l_i.$
305295

306296
Now assume that the base fee for any of the resources rapidly rises before the transaction is included, such that it becomes higher than the `max_fee_per_gas` in that dimension. In this scenario, the transaction can no longer be included. This may happen, even though the *aggregate* fees that the user is offering to pay, $\sum f_i l_i$, remain at a level above the aggregate fees that the protocol demands to execute it, $\sum b_i l_i$, just as initially. The aggregate priority fees may still also satisfy the proposer. The welfare loss consists of a user, a proposer, and a protocol willing to process a transaction, hamstrung by rigidity in the protocol design.
307297

0 commit comments

Comments
 (0)