With increasing the target to 4 and keeping the max at 6, we would end up with asymmetric max-scale rates of 6% (positive) and 11% negative. It would be better to achieve symmetry around the target. Thus we can simply scale the deviation form the taget by a scaling factor derived by comparing the max negative deviation with the max positive deviation. The scaling factor can then be applied directly or to the normalized excess gas.  ### Deriving the Scaling Factor #### Understanding the Asymmetry - **Maximum Negative Deviation ($D_{\text{neg}}$)**: $$ D_{\text{neg}} = \text{Target} - \text{Minimum~BlobGasUsed} = T - 0 = T $$ - **Maximum Positive Deviation ($D_{\text{pos}}$)**: $$ D_{\text{pos}} = \text{Max~BlobGasUsed} - \text{Target} = M - T $$ - For $T = 4$ and $M = 6$: $$ D_{\text{neg}} = 4, \quad D_{\text{pos}} = 6 - 4 = 2 $$ #### Equalizing the Deviations To achieve symmetry, set the maximum positive and negative deviations equal in magnitude by introducing a scaling factor $S$: $$ S = \frac{D_{\text{neg}}}{D_{\text{pos}}} = \frac{T}{M - T} $$ Substituting the values: $$ S = \frac{4}{6 - 4} = \frac{4}{2} = 2 $$ --- ### Adjusted Excess Blob Gas Calculation - **For $\text{BlobGasUsed} \gt T$**: $$ \text{AdjustedExcessBlobGas} = (\text{BlobGasUsed} - T) \times S = (\text{BlobGasUsed} - T) \times \left( \frac{T}{M - T} \right) $$ - **For $\text{BlobGasUsed} \leq T$**: $$ \text{AdjustedExcessBlobGas} = \text{BlobGasUsed} - T $$ This adjustment ensures the maximum deviations of the adjusted excess blob gas are equal in magnitude. --- ### Calculating the Update Fraction To achieve a maximum base fee change of ±12.5% (i.e., $R_{\text{max}} = 1.125$), calculate the update fraction: - **At Maximum Deviation**: $$ \left| \text{AdjustedExcessBlobGas}_{\text{max}} \right| = T $$ - **Exponent at Maximum Deviation**: $$ \left| \text{Exponent}_{\text{max}} \right| = \frac{\left| \text{AdjustedExcessBlobGas}_{\text{max}} \right|}{\text{UpdateFraction}} = \ln(R_{\text{max}}) $$ - **Solving for UpdateFraction**: $$ \text{UpdateFraction} = \frac{T}{\ln(R_{\text{max}})} $$ Substituting the values: $$ \text{UpdateFraction} = \frac{4}{\ln(1.125)} \approx \frac{4}{0.11778} \approx 33.95 $$ --- ### Final Base Fee Update Formula The base fee per blob gas is updated using: $$ \text{BaseFeePerBlobGas} = \text{PreviousBaseFeePerBlobGas} \times e^{\left( \dfrac{\text{AdjustedExcessBlobGas}}{\text{UpdateFraction}} \right)} $$ Where: - **AdjustedExcessBlobGas** is calculated as: - **For $\text{BlobGasUsed} \geq T$**: $$ \text{AdjustedExcessBlobGas} = (\text{BlobGasUsed} - T) \times \left( \dfrac{T}{M - T} \right) $$ - **For $\text{BlobGasUsed} \leq T$**: $$ \text{AdjustedExcessBlobGas} = \text{BlobGasUsed} - T $$ - **UpdateFraction**: $$ \text{UpdateFraction} = \dfrac{T}{\ln(R_{\text{max}})} \approx 33.95 $$ --- ### Verification of the Formula #### At $\text{BlobGasUsed} = 0$ Blobs - **AdjustedExcessBlobGas**: $$ \text{AdjustedExcessBlobGas} = 0 - 4 = -4 $$ - **Exponent**: $$ \text{Exponent} = \dfrac{-4}{33.95} = -0.11778 $$ - **Base Fee Adjustment**: $$ \text{BaseFeePerBlobGas} = 1 \times e^{-0.11778} \approx 0.8889 $$ - **Percentage Change**: $$ \text{Decrease} = 1 - 0.8889 = 0.1111 \text{ or } 11.11\% $$ #### At $\text{BlobGasUsed} = 6$ Blobs - **AdjustedExcessBlobGas**: $$ \text{AdjustedExcessBlobGas} = (6 - 4) \times \left( \dfrac{4}{6 - 4} \right) = 2 \times 2 = +4 $$ - **Exponent**: $$ \text{Exponent} = \dfrac{+4}{33.95} = +0.11778 $$ - **Base Fee Adjustment**: $$ \text{BaseFeePerBlobGas} = 1 \times e^{+0.11778} \approx 1.125 $$ - **Percentage Change**: $$ \text{Increase} = 1.125 - 1 = 0.125 \text{ or } 12.5\% $$ ---
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.