Skip to content

Commit 1dfac2e

Browse files
committed
docs(fee): correct ADR historical example and add kRate=10000 case
Drop the mistaken Arc-curve attribution for early-testnet's 7 wei floor (that era was EIP-1559), clarify committed vs live fee params, note the EIP-1559-equivalence of the 1250/5000 test vector, and cover the ProtocolConfig max kRate=10000 empty-block-to-zero boundary.
1 parent d9630c8 commit 1dfac2e

2 files changed

Lines changed: 21 additions & 5 deletions

File tree

‎crates/execution-config/src/gas_fee.rs‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,11 @@ mod tests {
390390

391391
/// Empty blocks stop lowering the fee once `base_fee * k_rate < 10_000`
392392
/// (integer truncation on the decrease path). At production-scale gas
393-
/// limits the resting value is `ceil(10000/k_rate) - 1` — matching early
394-
/// testnet (`k_rate = 1250` → 7 wei) from #367.
393+
/// limits the resting value is `ceil(10000/k_rate) - 1`.
394+
///
395+
/// `k_rate = 1250` / `iem = 5000` is the EIP-1559 equivalence point
396+
/// (`10000/8`, `10000/2`) already exercised by `test_calc_next_block_base_fee`
397+
/// — not a historical Arc testnet parameter set (see #367 / #372).
395398
#[test]
396399
fn empty_blocks_rest_at_truncation_floor() {
397400
let k_rate = 1250;
@@ -421,5 +424,17 @@ mod tests {
421424
base_fee, resting,
422425
"long empty-block run reaches resting value"
423426
);
427+
428+
// Max ProtocolConfig kRate: decrease == base_fee, so one empty block
429+
// reaches 0 (resting = ceil(10000/10000) - 1 = 0) before output clamps.
430+
assert_eq!(
431+
arc_calc_next_block_base_fee(0, gas_limit, 42, 10_000, iem),
432+
0,
433+
"kRate=10000 empties the fee in one step"
434+
);
435+
assert_eq!(
436+
arc_calc_next_block_base_fee(0, gas_limit, 0, 10_000, iem),
437+
0
438+
);
424439
}
425440
}

‎docs/adr/0004-base-fee-validation.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ next_base_fee = arc_calc_next_block_base_fee(smoothed_gas, gas_limit, base_fee,
132132
if fee_params is not None:
133133
next_base_fee = clamp(next_base_fee, fee_params.minBaseFee, fee_params.maxBaseFee)
134134

135-
136135
# 4. Apply chainspec absolute bounds
137136
next_base_fee = clamp(next_base_fee, config.absolute_min_base_fee, config.absolute_max_base_fee)
138137

@@ -172,9 +171,11 @@ resting_value = ceil(10000 / kRate) - 1
172171
effective_floor ≈ max(minBaseFee, resting_value)
173172
```
174173

175-
`10000 / kRate` is the truncation *threshold*; the fee comes to rest one wei below it (e.g. `kRate = 1250` ⇒ threshold 8, rest 7; `kRate = 200` ⇒ threshold 50, rest 49). Operators reading only `feeParams.minBaseFee` can miss this interaction. It does not affect mainnet as currently configured (`minBaseFee = 20 gwei`, `kRate = 200`), but early testnet sat at 7 wei for millions of blocks against a declared `minBaseFee` of 1. A future governance update that lowers `minBaseFee` below that resting value (or lowers `kRate` enough to raise it above `minBaseFee`) would recreate the gap. See #367.
174+
`10000 / kRate` is the truncation *threshold*; the fee comes to rest one wei below it (e.g. `kRate = 1250` ⇒ threshold 8, rest 7; `kRate = 200` ⇒ threshold 50, rest 49; `kRate = 10000` ⇒ rest 0, so a single empty block reaches zero before the output clamp). Operators reading only `feeParams.minBaseFee` can miss this interaction.
175+
176+
This is a **forward-looking governance risk**, not a past Arc-curve incident: since the Arc fee curve has been live on testnet (`kRate = 200` from block ~21,659,090), `minBaseFee` has stayed well above the resting value (49 wei). The 7 wei floor observed earlier on testnet came from plain EIP-1559 dynamics (`/8`), not from Arc `kRate` truncation — do not treat that history as evidence the Arc curve already gapped. A future `updateFeeParams` that lowers `minBaseFee` below `ceil(10000/kRate) - 1` (or raises that resting value above `minBaseFee`) would create the gap. See #367.
176177

177-
Also note: the fee parameters in `assets/testnet/config.json` are **historical genesis values**. Live testnet `ProtocolConfig.feeParams()` currently matches the mainnet parameter set.
178+
Also note: `assets/testnet/config.json` / `assets/devnet/config.json` fee params (`kRate: 25`, `minBaseFee: 1`) are **historical genesis values** (predicted Arc resting value 399). Live testnet `ProtocolConfig.feeParams()` currently matches the mainnet-like set (`kRate: 200`).
178179

179180
## Consequences
180181

0 commit comments

Comments
 (0)