Skip to main content

Try it Live

Run FeeMarket examples in the interactive playground

FeeMarket Constants

Protocol constants for EIP-1559 and EIP-4844 fee markets.

EIP-1559

Base fee mechanism constants.

MIN_BASE_FEE

Minimum base fee per gas (wei). Base fee cannot go below this value. Usage:
Rationale: Prevents base fee from reaching zero, ensuring minimum transaction cost and spam prevention.

BASE_FEE_CHANGE_DENOMINATOR

Denominator for maximum base fee change per block. Maximum change = 1/8 = 12.5%. Usage:
Rationale: Limits volatility. Base fee adjusts gradually, giving users time to adapt.

ELASTICITY_MULTIPLIER

Gas limit elasticity multiplier. Target gas = gasLimit / ELASTICITY_MULTIPLIER. Usage:
Rationale: Provides buffer for demand spikes while maintaining 50% target utilization.

EIP-4844

Blob fee mechanism constants.

MIN_BLOB_BASE_FEE

Minimum blob base fee per blob gas (wei). Usage:
Rationale: Prevents blob fees from reaching zero, ensuring minimum data availability cost.

BLOB_BASE_FEE_UPDATE_FRACTION

Denominator for blob base fee exponential update. Used in fake exponential calculation. Usage:
Value: Chosen to provide appropriate pricing curve for blob demand. Growth rate: Higher excess → exponentially higher fees.

TARGET_BLOB_GAS_PER_BLOCK

Target blob gas per block (3 blobs worth). Calculation:
Usage:
Rationale: 3 blobs per block target balances data availability with network capacity.

BLOB_GAS_PER_BLOB

Gas per blob (2^17 = 128 KiB). Calculation:
Usage:
Rationale: 128 KiB per blob matches 4096 field elements × 32 bytes in BLS12-381.

MAX_BLOBS_PER_BLOCK

Maximum blobs allowed per block. Usage:
Rationale: Limits block size while allowing sufficient data availability. 6 blobs = 768 KiB.

MAX_BLOB_GAS_PER_BLOCK

Maximum blob gas per block (6 blobs worth). Calculation:
Usage:
Rationale: 2x target provides elasticity for demand spikes (similar to gas limit elasticity).

Constant Relationships

EIP-1559 Relationships

EIP-4844 Relationships

Usage Examples

Fee Boundaries

Target Calculations

Validation

Implementation

Locations:
  • eip1559Constants.js - EIP-1559 constants
  • eip4844Constants.js - EIP-4844 constants
Both re-exported from FeeMarket.js:

References