Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ACP-224 proposes bringing ACP-176's dynamic fee mechanism to Subnet-EVM and adding a precompile for updating fee parameters on-chain. The design aims to support Streaming Asynchronous Execution (SAE) and align fee management with the C-Chain.
This article explains the proposal and provides additional context for its specification.
The proposal index also covers EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.
Overview
ACP-224 proposes implementing ACP-176 in Subnet-EVM and introducing a new precompiled contract, ACP224FeeManagerPrecompile.
The precompile lets authorized accounts configure and update fee parameters on-chain after ACP-176 is activated. It preserves the configurability offered by the existing FeeManagerPrecompile while adapting that functionality to the new fee model.
For more on ACP-176, see the following article.
[ACP-176] Understanding Dynamic Gas Adjustment in Avalanche EVM
Subnet-EVM can thus adopt dynamic gas and fee management based on the same mechanisms as the C-Chain.
Motivation
Background
ACP-176 improves the EVM's dynamic fee mechanism by introducing an adjustment mechanism that more accurately tracks target gas consumption. It also enables the target gas consumption rate itself to change dynamically.
At the time of the original article, ACP-176 was applied only to the C-Chain. Many Avalanche L1 chains relied on FeeManagerPrecompile and FeeConfig in their genesis configurations to manage fees and gas targets. The existing precompile, however, was incompatible with the new fee adjustment mechanism introduced by ACP-176.
Relationship to SAE
The Streaming Asynchronous Execution (SAE) model proposed in ACP-194 requires gas target and capacity management consistent with ACP-176.
For more on ACP-194, see the following article.
[ACP-194] How SAE Separates Transaction Ordering from Execution
SAE explicitly requires two quantities to be known.
- Gas capacity added per second
- Maximum gas capacity
Without these quantities, it is difficult to determine transaction validity and calculate an upper bound on fees. The historical Windower Fee Mechanism used by Subnet-EVM does not provide a fixed gas capacity replenishment rate of this kind. It is therefore difficult to calculate an upper bound on future gas prices and establish a static analysis model.
Integrating the dynamic gas capacity management introduced by ACP-176 is necessary to address this problem and support SAE on Subnet-EVM.
Benefits of Integrating ACP-176 into Subnet-EVM
Implementing ACP-176 in Subnet-EVM offers two main benefits.
-
Meeting the technical requirements for future SAE support SAE is designed to enable efficient asynchronous execution. It requires a mechanism that can accurately track gas capacity and target consumption.
-
Consistency with the C-Chain and lower maintenance costs Unifying gas and fee management across Subnet-EVM and the C-Chain improves consistency across Avalanche's codebase and reduces maintenance costs. Separate fee calculation implementations no longer need to be maintained independently, simplifying future upgrades and bug fixes.
Role of the New ACP224FeeManagerPrecompile
The other major component of the proposal is the introduction of ACP224FeeManagerPrecompile. This precompile serves as a fee manager compatible with ACP-176's dynamic fee model and lets chains update fee settings on-chain.
Fee parameters have traditionally been established through genesis configurations. The new precompile enables the following operations.
- Accounts with Admin permissions can change fee parameters while the network is running.
- Parameters such as the gas target and price adjustment settings can be updated dynamically on-chain.
- Fee policies can adapt more flexibly to changing demand.
Together, ACP-176 and ACP224FeeManagerPrecompile make Subnet-EVM's fee management more flexible and provide a foundation for future proposals such as SAE.
Specification
ACP-176 Parameters
ACP-224 adopts the same parameter framework as ACP-176, already introduced on the C-Chain, and allows values to be configured for individual Subnets or L1 chains.
| Parameter | Description | C-Chain setting |
|---|---|---|
| Target gas consumption per second | dynamic | |
| Gas capacity added per second | 2*T | |
| Maximum gas capacity | 10*T | |
| Minimum target gas consumption per second | 1,000,000 | |
| Target gas rate update constant | 2^25 | |
| Maximum target update per block | 2^15 | |
| Minimum gas price | 1×10^-18 AVAX | |
| Initial gas price update constant | 87*T |
The value dynamic indicates that the target can change according to block proposals and protocol rules.
Setting makes the rate at which gas prices can increase under maximum sustained consumption symmetric with the rate at which they decrease when no gas is consumed.
The constants and determine the granularity and permitted range of changes to the target gas consumption rate . They prevent excessively abrupt changes to the target in a single block while still allowing it to respond to network load. The C-Chain uses these parameters to balance stability with responsiveness.
Legacy Subnet-EVM Fee Configuration Parameters
Before ACP-176, Subnet-EVM controlled fees (the EIP-1559-style base fee and the block gas cost) using the following settings.
For more on EIP-1559, see the following article.
[EIP-1559] Understanding Ethereum's Gas Pricing Mechanism
- GasLimit Directly specifies the maximum amount of gas that can be consumed by a block.
- TargetBlockRate The target interval between blocks, measured in seconds, used for fee adjustment. If blocks arrive sooner than the target, the block gas cost increases; if they arrive later, it decreases.
- MinBaseFee The lower bound on a block's EIP-1559 base fee. Since the base fee is the minimum per-gas fee required for a transaction to be included, this establishes a network-wide floor.
- TargetGas The target total gas consumption over a 10-second window, including block gas costs. The base fee increases when actual consumption exceeds this target and decreases when it falls below the target.
- BaseFeeChangeDenominator Controls how strongly the difference between actual and target gas consumption affects the base fee. A larger denominator produces slower adjustments, while a smaller one produces faster changes.
- MinBlockGasCost / MaxBlockGasCost The lower and upper bounds on the gas cost associated with producing a block. These bound the block-level cost rather than imposing an equivalent amount of EVM execution.
- BlockGasCostStep
Determines how much the block gas cost changes in response to deviations from the target block interval.
When a block is produced at the target interval, it retains its parent's block gas cost. When a block arrives early, the cost increases by the number of seconds early multiplied by Step. When it arrives late, the cost decreases by the number of seconds late multiplied by Step, subject to the applicable bounds.
A very large step makes it more costly to produce blocks faster than
TargetBlockRate, effectively discouraging shorter intervals. For example, if a block arrives two seconds early, its block gas cost increases by 2 × Step before applying the bounds.
ACP-176 Parameters in Subnet-EVM
Introducing ACP-176 makes several existing Subnet-EVM settings unnecessary. GasLimit and BaseFeeChangeDenominator are replaced by ACP-176's framework. In addition, ACP-226 (Dynamic Minimum Block Times) removes TargetBlockRate, MinBlockGasCost, MaxBlockGasCost, and BlockGasCostStep.
The mappings between existing settings and ACP-176 parameters are as follows.
MinGasPricecorresponds to ACP-176's , setting the minimum gas price. It has a similar effect to the previousMinBaseFee. The original article describes the previous default as25 * 10^-18(25 nAVAX); these units are inconsistent. On an 18-decimal AVAX chain, 25 nAVAX equals AVAX, whereas AVAX is 25 wei. The proposed new floor is 1 wei, matching the C-Chain.TargetGascorresponds to ACP-176's , the target gas consumption per second.MaxCapacityFactorspecifies the multiplier used to determine , the maximum gas capacity (the upper bound on the block gas limit). It is calculated as , with a default factor of 10, matching the C-Chain.TimeToDoublecontrols the price response constant . The original article expresses the relationship as , with . That expression alone does not yield the stated gas-denominated constant; the target gas rate and the definition of the time-to-double parameter must also be taken into account. The later section gives the target-based expression . With the defaultTimeToDouble=60 seconds, the stated result is , matching the C-Chain.
The proposed defaults and configurability are summarized below.
| Parameter | Description | Default | Configurable |
|---|---|---|---|
| Target gas consumption per second | 1,000,000 | ✅ | |
| Gas capacity added per second | 2*T | ❌ | |
| Maximum gas capacity | 10*T | ✅ (MaxCapacityFactor, default 10) |
|
| Minimum target gas consumption per second | 1,000,000 | ❌ | |
| Target update constant | 2^25 | ❌ | |
| Maximum target update | 2^15 | ❌ | |
| Minimum gas price | 1Wei | ✅ | |
| Price response constant | Approximately 87*T | ✅ (TimeToDouble, default 60s) |
Fixing makes the maximum upward and downward price adjustment rates symmetric under sustained maximum usage and zero usage, respectively.
The constants and control how much can change in each block and the granularity of its adjustment. The same defaults as the C-Chain permit a relative change of approximately per block.
The floor gas per second is intended to be sufficiently low for any EVM L1. The proposal allows the target to increase dynamically without a separately specified upper target cap, subject to implementation limits.
Genesis Configuration
For a new chain, parameters can be supplied through the genesis chain configuration without activating the precompile. Unspecified parameters use the C-Chain defaults.
The original configuration example is shown below.
{
"...": "...",
"acp224Timestamp": 0,
"acp224FeeConfig": {
"minGasPrice": 0,
"maxCapacityFactor": 10,
"timeToDouble": 60
}
}acp224Timestamp specifies the activation time of ACP-224 as a 64-bit integer representing seconds since the Unix epoch. acp224FeeConfig defines , the multiplier determining , and the time parameter used to determine .
Dynamic Gas Targets Through Validator Configuration
As with ACP-176 on the C-Chain, individual validators can configure a gas target in their node settings.
The block builder uses this setting to calculate the proposed block's targetExcess within the permitted adjustment range. The on-chain gas target consequently moves gradually toward the value configured by validators.
Dynamic Gas Targets and Fee Configuration Through ACP224FeeManagerPrecompile
For L1s that want administrators to dynamically update gas targets and fee-related parameters on-chain, the proposal introduces the optional ACP224FeeManagerPrecompile.
Its operational model resembles the existing Subnet-EVM FeeManagerPrecompile and follows IAllowList for access control.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import "./IAllowList.sol";
/// @title ACP-224 Fee Manager Interface
/// @notice Interface for managing dynamic gas limit and fee parameters
/// @dev Inherits from IAllowList for access control
interface IACP224FeeManager is IAllowList {
/// @notice Configuration parameters for the dynamic fee mechanism
struct FeeConfig {
uint256 targetGas; // Target gas consumption per second
uint256 minGasPrice; // Minimum gas price in wei
uint256 maxCapacityFactor; // Maximum capacity factor (C = factor * T)
uint256 timeToDouble; // Time in seconds for gas price to double at max capacity
}
/// @notice Emitted when fee configuration is updated
/// @param sender Address that triggered the update
/// @param oldFeeConfig Previous configuration
/// @param newFeeConfig New configuration
event FeeConfigUpdated(address indexed sender, FeeConfig oldFeeConfig, FeeConfig newFeeConfig);
/// @notice Set the fee configuration
/// @param config New fee configuration parameters
function setFeeConfig(FeeConfig calldata config) external;
/// @notice Get the current fee configuration
/// @return config Current fee configuration
function getFeeConfig() external view returns (FeeConfig memory config);
/// @notice Get the block number when fee config was last changed
/// @return blockNumber Block number of last configuration change
function getFeeConfigLastChangedAt() external view returns (uint256 blockNumber);
}An important property of setFeeConfig is that configuration updates take effect at settlement, rather than during transaction acceptance or execution, in accordance with the execution lifecycle proposed in ACP-194.
This keeps the rules used to validate accepted transactions consistent across nodes. Changes to fee parameters do not introduce inconsistent validation rules during the intermediate execution stages.
In addition to the latest fee configuration, the precompile stores the derived values , used in calculating target excess, and .
The value is determined from targetGas using the same procedure as Coreth's desired target excess calculation. Mathematically, can be derived from . To avoid floating-point inaccuracies, the implementation uses binary search to obtain the appropriate integer approximation.
The following diagram shows how targetExcess is determined.
flowchart TD
A[ACP-224 activated] --> B{Is ACP224FeeManager precompile active?}
B -- Yes --> C[Use targetExcess from precompile storage at latest settled root]
B -- No --> D{Is gas-target set in node chain config file?}
D -- Yes --> E[Calculate targetExcess from configured preference and allowed update bounds]
D -- No --> F{Does parent block have ACP176 fields?}
F -- Yes --> G[Use parent block ACP176 gas target]
F -- No --> H[Use MinTargetPerSecond]
Adjustments to ACP-176 Price Discovery
Under ACP-176, the block gas price follows the exponential relationship below.
Here, is the minimum gas price, controls the rate at which the price responds to gas consumption, and is the current excess, an internal measure that reflects accumulated gas consumption relative to the target. Higher demand tends to increase excess, while lower demand tends to decrease it. The gas price is calculated exponentially from this value.
When ACP224FeeManagerPrecompile changes (minGasPrice) or (derived from timeToDouble), is adjusted as well to avoid an abrupt change in the prevailing gas price.
Changing M
When changes from to , the following theoretical adjustment to preserves the previous price.
Direct evaluation requires non-integer arithmetic and can introduce rounding errors. In practice, binary search is used to find the smallest nonnegative integer for which the gas price calculated using is at least the previous price.
This yields the following behavior.
- If the minimum gas price is lowered or set no higher than the prevailing gas price, the adjustment aims to preserve the prevailing price, subject to integer rounding.
- If the minimum gas price is set above the prevailing price, the gas price immediately rises to the new minimum.
Changing therefore adjusts the price floor. The prevailing price is preserved as closely as possible when it exceeds that floor, and raised to the new minimum otherwise.
Changing K
When changes from to , is recalculated using the following relationship.
This adjustment preserves the gas price in the mathematical model. Since determines how quickly gas prices respond to changes in consumption, changing it affects subsequent price movements rather than the price at the moment of the update, apart from integer rounding.
Parameter Calculation and Consistency
The parameters (used to derive targetExcess) and are calculated from targetGas and timeToDouble. The procedure follows the C-Chain implementation and uses binary search to obtain the appropriate integer values rather than relying on floating-point arithmetic.
All configuration changes made through setFeeConfig take effect when the transaction settles. This preserves consistent transaction admission criteria across nodes and prevents discrepancies caused by fee configuration changes.
It is particularly important for maintaining a consistent transaction queue under SAE (ACP-194).
With these changes, Subnet-EVM can adopt the same ACP-176-based dynamic fee model as the C-Chain. Authorized administrators can use ACP224FeeManagerPrecompile to adjust the network's fee configuration precisely while the network is operating.
Backwards Compatibility
Activating ACP-224 first requires a network upgrade to enable its new fee mechanism. Using the new ACP224FeeManagerPrecompile requires an additional activation.
The precompile must be activated after the ACP-224 fee mechanism because it depends on the corresponding fee update logic.
When the ACP-224 mechanism is activated, the previous fee mechanism and the legacy FeeManager precompile are disabled under the design described here. This avoids ambiguous behavior resulting from both fee mechanisms operating at once. As noted in the open questions below, the proposal also considers how the legacy precompile should be disabled.
For existing networks, network upgrade overrides allow operators to specify the activation timestamp and override the ACP-176 configuration parameters.
These upgrades are optional in the proposal as described at the time of writing. However, ACP-194's SAE model depends on ACP-224. A network that has not activated ACP-224 cannot use SAE under this design.
flowchart TD
A[Step1:ACP224の手数料メカニズムを有効化] --> B[旧フィー機構と旧FeeManagerを無効化]
B --> C{新FeeManagerを使うか}
C -- はい --> D[Step2:ACP224FeeManagerPrecompileを有効化]
C -- いいえ --> E[プリコンパイルなしで運用継続]
%% 注意: DはAの後でのみ有効化可
Security Considerations
The underlying security assumptions are the same as those of ACP-176. However, the dynamically configurable parameters exposed through ACP224FeeManagerPrecompile introduce an additional risk of misconfiguration.
Incorrect settings could make the network susceptible to denial-of-service attacks or lead to unnecessarily high fees. Operational procedures should carefully control which values are applied, when they take effect, and the order of configuration changes, including their activation at settlement.
Open Questions
The following issues remain unresolved in the proposal as described by the original article.
| Question |
|---|
Should activating the ACP224FeeManager precompile automatically disable the legacy precompile, or should a separate upgrade explicitly disable it? |
Should targetGas be an optional field in the genesis or chain configuration, signaling that the chain configuration takes precedence over validator settings? |
Relatedly, should the ACP224FeeManager precompile include a toggle that delegates control of targetGas to validators? |
Conclusion
ACP-224 proposes integrating ACP-176's dynamic fee mechanism into Subnet-EVM and adding a new precompile for on-chain fee configuration. The design aligns fee management with the C-Chain and establishes a prerequisite for SAE.
For questions about this article, contact the author on Twitter.
The author also publishes on the following platforms.


