Skip to content

Commit 1176bce

Browse files
committed
Increase target block fullness to 50% (#2692)
* increase target block fullness to 50% * fix tests * change the target block fullness for moonbeam and moonriver
1 parent f9b3d7b commit 1176bce

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

runtime/moonbase/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ parameter_types! {
411411
= U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS);
412412
/// The portion of the `NORMAL_DISPATCH_RATIO` that we adjust the fees with. Blocks filled less
413413
/// than this will decrease the weight and more will increase.
414-
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
414+
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50);
415415
/// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to
416416
/// change the fees more rapidly. This fast multiplier responds by doubling/halving in
417417
/// approximately one hour at extreme block congestion levels.

runtime/moonbase/tests/integration_test.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,37 +2948,37 @@ mod fee_tests {
29482948

29492949
assert_eq!(
29502950
sim(1_000_000_000, Perbill::from_percent(0), 1),
2951-
U256::from(999_000_500),
2951+
U256::from(998_002_000),
29522952
);
29532953
assert_eq!(
29542954
sim(1_000_000_000, Perbill::from_percent(25), 1),
2955-
U256::from(1_000_000_000),
2955+
U256::from(999_000_500),
29562956
);
29572957
assert_eq!(
29582958
sim(1_000_000_000, Perbill::from_percent(50), 1),
2959-
U256::from(1_001_000_500),
2959+
U256::from(1_000_000_000),
29602960
);
29612961
assert_eq!(
29622962
sim(1_000_000_000, Perbill::from_percent(100), 1),
2963-
U256::from(1_003_004_500),
2963+
U256::from(1_002_002_000),
29642964
);
29652965

29662966
// 1 "real" hour (at 12-second blocks)
29672967
assert_eq!(
29682968
sim(1_000_000_000, Perbill::from_percent(0), 300),
2969-
U256::from(740_818_257),
2969+
U256::from(548_811_855),
29702970
);
29712971
assert_eq!(
29722972
sim(1_000_000_000, Perbill::from_percent(25), 300),
2973-
U256::from(1_000_000_000),
2973+
U256::from(740_818_257),
29742974
);
29752975
assert_eq!(
29762976
sim(1_000_000_000, Perbill::from_percent(50), 300),
2977-
U256::from(1_349_858_740),
2977+
U256::from(1_000_000_000),
29782978
);
29792979
assert_eq!(
29802980
sim(1_000_000_000, Perbill::from_percent(100), 300),
2981-
U256::from(2_459_599_798u128),
2981+
U256::from(1_822_118_072u128),
29822982
);
29832983

29842984
// 1 "real" day (at 12-second blocks)
@@ -2988,11 +2988,11 @@ mod fee_tests {
29882988
);
29892989
assert_eq!(
29902990
sim(1_000_000_000, Perbill::from_percent(25), 7200),
2991-
U256::from(1_000_000_000),
2991+
U256::from(125_000_000),
29922992
);
29932993
assert_eq!(
29942994
sim(1_000_000_000, Perbill::from_percent(50), 7200),
2995-
U256::from(1_339_429_158_283u128),
2995+
U256::from(1_000_000_000u128),
29962996
);
29972997
assert_eq!(
29982998
sim(1_000_000_000, Perbill::from_percent(100), 7200),

runtime/moonbeam/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ parameter_types! {
393393
= U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS);
394394
/// The portion of the `NORMAL_DISPATCH_RATIO` that we adjust the fees with. Blocks filled less
395395
/// than this will decrease the weight and more will increase.
396-
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
396+
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50);
397397
/// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to
398398
/// change the fees more rapidly. This low value causes changes to occur slowly over time.
399399
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(4, 1_000);

runtime/moonriver/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ parameter_types! {
393393
= U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / WEIGHT_PER_GAS);
394394
/// The portion of the `NORMAL_DISPATCH_RATIO` that we adjust the fees with. Blocks filled less
395395
/// than this will decrease the weight and more will increase.
396-
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
396+
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50);
397397
/// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to
398398
/// change the fees more rapidly. This low value causes changes to occur slowly over time.
399399
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(4, 1_000);

test/suites/dev/moonbase/test-fees/test-fee-multiplier-max.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describeSuite({
139139
blockNumber = (await context.polkadotJs().rpc.chain.getHeader()).number.toBigInt();
140140
baseFeePerGas = (await context.viem().getBlock({ blockNumber: blockNumber }))
141141
.baseFeePerGas!;
142-
expect(baseFeePerGas).to.equal(124_883_131_084_512n);
142+
expect(baseFeePerGas).to.equal(124_758_310_508_112n);
143143

144144
const rawSigned = await createEthersTransaction(context, {
145145
to: contractAddress,
@@ -171,7 +171,7 @@ describeSuite({
171171
expect(withdrawEvents?.length).to.equal(1);
172172
const withdrawEvent = withdrawEvents![0];
173173
const amount = withdrawEvent.event.data.amount.toBigInt();
174-
expect(amount).to.equal(11_880_382_026_331_795_584n);
174+
expect(amount).to.equal(11_868_507_595_257_710_784n);
175175
},
176176
});
177177
},

test/suites/dev/moonbase/test-fees/test-fee-multiplier-xcm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
// export const TARGET_FILL_AMOUNT =
1515
// ((MAX_BLOCK_WEIGHT * 0.75 * 0.25 - EXTRINSIC_BASE_WEIGHT) / MAX_BLOCK_WEIGHT) * 1_000_000_000;
1616
// In 0.9.43 rootTesting::fillBlock() now uses more weight so we need to account for that
17-
const TARGET_FILL_AMOUNT = 186_927_918;
17+
const TARGET_FILL_AMOUNT = 374_427_918;
1818

1919
// Note on the values from 'transactionPayment.nextFeeMultiplier': this storage item is actually a
2020
// FixedU128, which is basically a u128 with an implicit denominator of 10^18. However, this

0 commit comments

Comments
 (0)