Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add a maximum value for trait MultiplierUpdate #12240

Closed
kianenigma opened this issue Sep 12, 2022 · 0 comments · Fixed by #12282
Closed

Add a maximum value for trait MultiplierUpdate #12240

kianenigma opened this issue Sep 12, 2022 · 0 comments · Fixed by #12282
Labels
J0-enhancement An additional feature request. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@kianenigma
Copy link
Contributor

... and enforce it in all implementations, including the one being added in #12222

Outcome should be:

/// Something that can convert the current multiplier to the next one.
pub trait MultiplierUpdate: Convert<Multiplier, Multiplier> {
	/// Minimum multiplier. Any outcome of the `convert` function should be more than this.
	fn min() -> Multiplier;
	/// Maximum multiplier. Any outcome of the `convert` function should be less than this.
	fn max() -> Multiplier;
	/// Target block saturation level. The `convert` function could possibly update itself based on this target.
	fn target() -> Perquintill;
	/// Variability factor. The `convert function` could possible tune its speed of update based on this.
	fn variability() -> Multiplier;
}

This would help implementations ensure that even if the fees should increase forever, they will not go above a certain threshold.

This remains backwards compatible by setting the maximum to Bounded::max_value().

@kianenigma kianenigma added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder J0-enhancement An additional feature request. labels Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant