EIP-1559 modualarized
Parameter | Type | Default | Description |
---|---|---|---|
NoBaseFee | bool | false | Disables EIP-1559 base fee (enables legacy pricing) |
BaseFeeChangeDenominator | uint32 | 8 | Controls max base fee change per block (higher = more stable) |
ElasticityMultiplier | uint32 | 2 | Determines target block utilization (2 = 50% target) |
EnableHeight | int64 | 0 | Block height to activate fee market (0 = genesis) |
BaseFee | sdk.Dec | 1000000000 | Current base fee (auto-adjusts each block) |
MinGasPrice | sdk.Dec | 0 | Minimum gas price floor (cannot go below) |
MinGasMultiplier | sdk.Dec | 0.5 | Minimum gas used multiplier for gas wanted |
sdk.Dec
(LegacyDec) values are stored as strings with 18 decimal precision (cosmos-sdk):
Human Value | Stored String | Formula |
---|---|---|
1 unit | ”1000000000000000000” | 1 × 10^18 |
0.5 (50%) | “500000000000000000” | 0.5 × 10^18 |
1 billion | ”1000000000000000000000000000” | 10^9 × 10^18 |
Goal | Parameter | Adjustment | Effect |
---|---|---|---|
Faster fee response | base_fee_change_denominator | 8 → 4 | 2x faster adjustments (±25% vs ±12.5%) |
More stable fees | base_fee_change_denominator | 8 → 16 | 2x slower adjustments (±6.25% vs ±12.5%) |
Earlier fee increases | elasticity_multiplier | 2 → 4 | Fees rise at 25% vs 50% utilization |
Stronger spam deterrent | min_gas_price | Low → High | Higher transaction cost floor |
Config | 5 Blocks | 10 Blocks | 10x Time |
---|---|---|---|
Ethereum (d=8, e=2) | +34% | +79% | ~20 blocks |
Stable (d=16, e=2) | +16% | +34% | ~40 blocks |
Aggressive (d=4, e=4) | +101% | +304% | ~8 blocks |
Decimals | Conversion Factor | Min Unit Gas | Example |
---|---|---|---|
6 | 10^12 | 10^-12 | USDC |
8 | 10^10 | 10^-10 | BTC-wrapped |
18 | 1 | 1 | ETH, most EVM |
Chain Type | Denominator | Elasticity | MinGasPrice | Why |
---|---|---|---|---|
Testing/Development | 8 | 2 | Zero/Low | Quick iteration |
Production General | 8-16 | 2 | Medium | Balance stability and responsiveness |
High-Frequency Trading | 16-32 | 1-2 | Low | Predictable fees, high throughput |
Enterprise/Private | 32 | 2-3 | High | Maximum stability, cost predictability |
Gaming/Micro-tx | 4-8 | 1 | Very Low | Fast adjustments, minimal fees |
Metric | Formula | Healthy | Action if Unhealthy |
---|---|---|---|
Fee Volatility | σ(fees)/μ(fees) | <20% daily | Increase denominator |
Utilization Rate | gasUsed/maxGas | 40-60% avg | Adjust elasticity |
Floor Hit Rate | count(fee==min)\/blocks | <10% | Lower min_gas_price |
Recovery Speed | Blocks to return to baseline | 20-40 | Tune denominator |
baseFeePerGas
field when EIP-1559 is enabled.State Object | Description | Key | Value | Store |
---|---|---|---|---|
BlockGasWanted | Gas wanted in the current block | []byte{1} | []byte{uint64} | Transient |
BaseFee | Current base fee | Params.BaseFee | sdk.Dec | KV |
Params | Module parameters | []byte{0x00} | Params | KV |
Method | Description | Usage |
---|---|---|
GetBaseFee() / SetBaseFee() | Current base fee | Read/update during block processing |
GetParams() / SetParams() | Module parameters | Governance updates |
GetBlockGasWanted() / SetBlockGasWanted() | Gas tracking | Base fee calculation |
CalculateBaseFee() | Compute next base fee | Called in BeginBlock |
PostTxProcessing
hooks for EVM transaction processing (source).
Attribute Key | Attribute Value |
---|---|
height | Current block height |
base_fee | New base fee |
gas_wanted | Total gas wanted in block |
gas_used | Total gas used in block |
EVMMonoDecorator
, which performs all fee-related validations in a single pass (source):
Aspect | Standard Cosmos SDK | cosmos/evm Feemarket |
---|---|---|
Fee Model | Static, validator-configured min gas prices | Dynamic EIP-1559 base fee |
Price Discovery | Manual adjustment by validators | Automatic based on utilization |
Transaction Types | Cosmos SDK Tx only | Both Cosmos & Ethereum txs |
Decimal Handling | Chain-specific precision | 18-decimal EVM compatibility |
State Storage | Not tracked | Base fee in state, gas in transient store |
Consensus Impact | No consensus on fees | Base fee part of consensus |