Repository navigation
Conversation
MOZGIII
force-pushed
the
adjustable-fee
branch
2 times, most recently
from
October 27, 2026 20:53
5d29ef1 to
47d2b24
Compare
Adds a pallet that holds the native and EVM fee multipliers in the state, with root-gated setters, defaults of 1 and 2, and a v1 migration that enacts provided multipliers on chains upgrading from a runtime without the pallet.
The fee constants become unit prices that put a basic transfer at 1 HMND and 1 eHMND; the runtime scales them by the multipliers held in the state. New networks start at the pallet defaults of 1 and 2, and the migration enacts 10 and 15 on the chains upgrading from the previous runtime.
Covers changing each multiplier through a root call, the gas price runtime API following the EVM multiplier, and the migration reproducing the fee levels of the previous runtime.
The dev node fee expectations follow the pallet defaults of 1 and 2, and new cases change each multiplier through sudo and check the fee follows.
MOZGIII
force-pushed
the
adjustable-fee
branch
from
October 28, 2026 19:38
47d2b24 to
33e6720
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the native and EVM transaction fees configurable at the state level.
The runtime prices fees from baseline constants that put a simple transfer at ~1 HMND / ~1 eHMND, and scales them by multipliers held in the state of the new
pallet-humanode-fee-params.Design
NativeFeeMultiplierWeightToFeeandLengthToFeeofpallet_transaction_paymentEvmFeeMultiplierFeeCalculator::min_gas_priceofpallet_evmFixedU128, so fractional values work.set_native_fee_multiplier/set_evm_fee_multiplier; each emits an...Updatedevent.NativeWeightToFee<Runtime, Baseline>wrapping the existingConstantMultipliers, andEvmFeeCalculator<Runtime, BaselineFeePerGas>replacing the formerEvmFeePerGas.WEIGHT_TO_FEE_BASELINE,LENGTH_TO_FEE_BASELINE,FEE_PER_GAS_BASELINE.Upgrade path
Chains upgrading from the previous runtime keep their current fee levels. The
EnactFeeMultipliersmigration, driven by the pallet's storage version going 0 → 1, sets the multipliers toNativeFeeMultiplierBeforeFeeParams(10) andEvmFeeMultiplierBeforeFeeParams(15), which reproduce the previousWEIGHT_TO_FEEandFEE_PER_GASvalues. The EVM one matches within 0.1%, as the old gas price was a hand-rounded number.New networks start from the pallet defaults; 10 and 15 exist only in the migration.
Tests
tests::fees: the existing cases follow the defaults of 1 and 2, and new cases change each multiplier and check the fee follows, plus one that runs the migration and checks the previous fee levels come out.base/rpc: the dev node expectations are 1 HMND / 2 eHMND, and new cases set each multiplier through sudo.Reviewer notes
crates/humanode-runtime/src/weights/pallet_humanode_fee_params.rsare hand-written as a placeholder and need regenerating withutils/weights/benchmark-all.spec_versionbump goes in a separate PR, as usual.