-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(All Runtimes) Parametrize the deposit for pallet_randomness #2941
Conversation
WASM runtime size check:Compared to target branchMoonbase runtime: 2192 KB (no changes) ✅ Moonbeam runtime: 2164 KB (no changes) ✅ Moonriver runtime: 2160 KB (no changes) ✅ Compared to latest release (runtime-3200)Moonbase runtime: 2192 KB (+232 KB compared to latest release) Moonbeam runtime: 2164 KB (+240 KB compared to latest release) Moonriver runtime: 2160 KB (+236 KB compared to latest release) |
Coverage Report@@ Coverage Diff @@
## master tarekkma/randomness-param +/- ##
=============================================================
+ Coverage 79.18% 79.24% +0.06%
+ Files 299 302 +3
+ Lines 87673 87695 +22
=============================================================
+ Hits 69419 69486 +67
- Misses 18254 18209 -45
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TarekkMA please write a short description that explain the feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please duplicate params config per runtime and not use another macro
What does it do?
The pull request parametrizes the deposit for the
pallet_randomness
. The deposit config can be changed later by a gov proposal, without a runtime upgrade.Since the deposit is now a parameter controlled via governance proposals, we don't want the full range of the balance type
[0, u128::MAX]
, since some values might not make sense or have security implications. We created a new type calledBoundedU128
to limit the allowed range for changing the parameter.What important points reviewers should know?
BoundedU128<LOWER, UPPER>
that will only decode if the value passed is within bounds.expose_u128_get!
that exposes aGet<u128>
from aGet<BoundedU128>
.Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
What value does it bring to the blockchain users?