Fix #232
-
Review changes -
-
Download -
Patches
-
Plain diff
It seems that a chain using weights but no fees through a weight-to-fee and length-to-fee conversion is functional. The implemented solution is as follows:
When the current block's weight and length is less than a targeted weight and length, the conversion from weight to fee is mapped to 0, so no fee will be levied. When the current block's weight and length exceeds the target, the weight-to-fee conversion is mapped to the original values (see !227 (merged)).
To prevent any attacks, if the previous block's weight or length exceeds the targets, the chain will levy fees based on the current transaction weight multiplied by the FeeMultiplier
. For each consecutive block where the targets are surpassed, the multiplier will be incremented by one. Conversely, when the targets are not met, the multiplier will be decremented by one. The FeeMultiplier
will range from 1 (normal usage) to MaxMultiplier
(heavy usage, with n=MaxMultiplier
consecutive blocks surpassing the target).
Contrary to what is stated in the documentation, the FeeMultiplier
does not act directly on the fee but on the weight part, as fee = base_fee + length_fee + weight_fee * multiplier
.
This MR also fixes #236 (closed), originating from the discussion at https://forum.duniter.org/t/remboursement-des-frais-de-transaction-en-cas-de-bloc-non-plein/12249/17.
Merge request reports
- version 23cc77b92d
- version 22596419bd
- version 218aeaced0
- version 20985075ea
- version 19305d7c1c
- version 18063bad3b
- version 173847b08e
- version 165bb67dc5
- version 157af34957
- version 142bdecf86
- version 13f8e51fa3
- version 12dcaa23cc
- version 110ecdfb07
- version 101b938229
- version 9cdbbb20c
- version 82c88d1e6
- version 7e32c629d
- version 6d13a2132
- version 5a0e63b88
- version 481844922
- version 37f81f885
- version 29565800e
- version 1fa7b12e0
- master (base)
- latest version9670823211 commits,
- version 23cc77b92d10 commits,
- version 22596419bd10 commits,
- version 218aeaced09 commits,
- version 20985075ea8 commits,
- version 19305d7c1c8 commits,
- version 18063bad3b8 commits,
- version 173847b08e7 commits,
- version 165bb67dc57 commits,
- version 157af349577 commits,
- version 142bdecf866 commits,
- version 13f8e51fa35 commits,
- version 12dcaa23cc4 commits,
- version 110ecdfb074 commits,
- version 101b9382293 commits,
- version 9cdbbb20c3 commits,
- version 82c88d1e63 commits,
- version 7e32c629d3 commits,
- version 6d13a21323 commits,
- version 5a0e63b883 commits,
- version 4818449223 commits,
- version 37f81f8852 commits,
- version 29565800e1 commit,
- version 1fa7b12e01 commit,
- Side-by-side
- Inline