From 69b7f1767c42951321e41a52e7e3bacc78d833a0 Mon Sep 17 00:00:00 2001 From: bgallois <benjamin@gallois.cc> Date: Wed, 25 Sep 2024 11:30:18 +0200 Subject: [PATCH] fix fees for small length --- runtime/common/src/fees.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/src/fees.rs b/runtime/common/src/fees.rs index d6657c93d..a1d0ccbd7 100644 --- a/runtime/common/src/fees.rs +++ b/runtime/common/src/fees.rs @@ -21,8 +21,8 @@ /// When the current block's weight and length are below the targeted thresholds, no fees are charged, /// as the weight-to-fee conversion results in zero. Once the block's weight and length exceed these /// targets, the weight-to-fee conversion maps 5 (5cG) to a base extrinsic weight. -/// Additionally, a fee is applied based on the length of the extrinsic and is mapped linearly: -/// 1_000 (10G) corresponds to an extrinsic length of 3.5 kilobytes and will be applied only if the extrinsic +/// Additionally, a fee is applied based on the length of the extrinsic and is mapped affinely: +/// 2_000 (20G) corresponds to an extrinsic length of 3.5 kilobytes and will be applied only if the extrinsic /// exceeds 256 bytes or if the block target in weight or length is surpassed. /// /// To further deter abuse, if the previous block's weight or length the target thresholds, @@ -103,7 +103,7 @@ where { 0u32.into() } else { - Self::Balance::saturated_from(length_in_bytes.ref_time() / 350u64) + Self::Balance::saturated_from(length_in_bytes.ref_time() / 350u64 + 5u64) } } -- GitLab