Transaction Fees & Validator Rewards
Configure fee parameters and reward mechanisms for your Avalanche L1 blockchain.
Overview
The Subnet-EVM provides two powerful precompiles for managing transaction fees and rewards:
- Fee Manager: Configure dynamic fee parameters and gas costs
- Reward Manager: Control how transaction fees are distributed or burned
Both precompiles use the AllowList interface to restrict access to their functionality.
Fee Manager
Purpose
The Fee Manager allows you to configure the parameters of the dynamic fee algorithm on-chain. This gives you control over:
- Gas limits and target block rates
- Base fee parameters
- Block gas cost parameters
Configuration
Located at address 0x0200000000000000000000000000000000000003
, you can activate this precompile in your genesis file:
Fee Parameters
The Fee Manager allows configuration of the following parameters:
Parameter | Description | Recommended Range |
---|---|---|
gasLimit | Maximum gas allowed per block | 8M - 100M |
targetBlockRate | Target time between blocks (seconds) | 2 - 10 |
minBaseFee | Minimum base fee (in wei) | 25 - 500 gwei |
targetGas | Target gas usage per block | 5M - 50M |
baseFeeChangeDenominator | Controls how quickly base fee changes | 8 - 1000 |
minBlockGasCost | Minimum gas cost for a block | 0 - 1B |
maxBlockGasCost | Maximum gas cost for a block | > minBlockGasCost |
blockGasCostStep | How quickly block gas cost changes | < 5M |
Access Control and Additional Features
The FeeManager precompile uses the AllowList interface to restrict access to its functionality.
In addition to the AllowList interface, the FeeManager adds the following capabilities:
getFeeConfig
: retrieves the current dynamic fee configgetFeeConfigLastChangedAt
: retrieves the timestamp of the last block where the fee config was updatedsetFeeConfig
: sets the dynamic fee config on chain. This function can only be called by an Admin, Manager or Enabled address.FeeConfigChanged
: an event that is emitted when the fee config is updated. Topics include the sender, the old fee config, and the new fee config.
You can also get the fee configuration at a block with the eth_feeConfig
RPC method. For more information see here.
Reward Manager
Purpose
The Reward Manager allows you to control how transaction fees are handled in your network. You can:
- Send fees to a specific address (e.g., treasury)
- Allow validators to collect fees
- Burn fees entirely
Configuration
Located at address 0x0200000000000000000000000000000000000004
, you can activate this precompile in your genesis file:
Reward Mechanisms
The Reward Manager supports three mutually exclusive mechanisms:
-
Validator Fee Collection (
allowFeeRecipients
)- Validators can specify their own fee recipient addresses
- Fees go to the block producer's chosen address
- Good for incentivizing network participation
-
Fixed Reward Address (
rewardAddress
)- All fees go to a single specified address
- Can be a contract or EOA
- Useful for treasury or DAO-controlled fee collection
-
Fee Burning (default)
- All transaction fees are burned
- Reduces total token supply over time
- Similar to Ethereum's EIP-1559
Implementation
Fee Manager Interface
Reward Manager Interface
Best Practices
-
Reward Management:
- Choose reward mechanism based on network goals
- Consider using a multi-sig or DAO as reward address
- Monitor fee collection and distribution
- Keep documentation of fee policy changes
-
Security Considerations:
- Use multi-sig for admin addresses
- Test fee changes on testnet first
- Monitor events for unauthorized changes
- Have a plan for fee parameter adjustments
You can find the implementations in the subnet-evm repository:
Is this guide helpful?