Skip to content
Snippets Groups Projects

Fix #232

Merged Benjamin Gallois requested to merge fix-232 into master
All threads resolved!

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.

Edited by Benjamin Gallois

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Hugo Trentesaux approved this merge request

    approved this merge request

  • added 1 commit

    Compare with previous version

  • Benjamin Gallois resolved all threads

    resolved all threads

  • mentioned in commit 1ea24193

  • Please register or sign in to reply
    Loading