-
Notifications
You must be signed in to change notification settings - Fork 683
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
Add set_partial_params dispatchable function #3843
Merged
bkchr
merged 23 commits into
paritytech:master
from
openguild-labs:chungquantin/fellowship_core_set_params
Jun 18, 2024
Merged
Add set_partial_params dispatchable function #3843
bkchr
merged 23 commits into
paritytech:master
from
openguild-labs:chungquantin/fellowship_core_set_params
Jun 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xlc
reviewed
Mar 27, 2024
xlc
approved these changes
Mar 28, 2024
ggwpez
reviewed
Apr 9, 2024
ggwpez
reviewed
Apr 9, 2024
…hub.com/openguild-labs/polkadot-sdk into chungquantin/fellowship_core_set_params
@ggwpez I have resolved your feedback. CI passes as well. |
ggwpez
approved these changes
Apr 18, 2024
The CI pipeline was cancelled due to failure one of the required jobs. |
seadanda
reviewed
Jun 3, 2024
Co-authored-by: Dónal Murray <donalm@seadanda.dev>
…hub.com/openguild-labs/polkadot-sdk into chungquantin/fellowship_core_set_params
@xlc Apologize for tagging you, I am trying to wrap up this PR but there is an issue with CI that I don't know how to reproduce.
|
ggwpez
reviewed
Jun 10, 2024
ggwpez
reviewed
Jun 15, 2024
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bkchr
approved these changes
Jun 17, 2024
Co-authored-by: Bastian Köcher <git@kchr.de>
Merged
via the queue into
paritytech:master
with commit Jun 18, 2024
cc38713
153 of 157 checks passed
TarekkMA
pushed a commit
to moonbeam-foundation/polkadot-sdk
that referenced
this pull request
Aug 2, 2024
# ISSUE - Link to issue: paritytech#3617 # Description > Any set parameter / update config call with multiple arguments should have each argument to be an Option field. Please put this to some best practice document. This allows new update config call does not need to duplicate the fields that does not need to update. It also makes concurrent votes of update call possible, otherwise there will be race condition. It also helps with review such proposal otherwise reviewers need to check the other fields should remain the same. - [ ] Concurrent call & race condition testing - [x] Each argument of the `ParamsType` is an `Option` field. Introduce through ```rust pub type PartialParamsOf<T, I> = ParamsType<Option<<T as Config<I>>::Balance>, Option<BlockNumberFor<T>>, RANK_COUNT>; ``` # Outcome ```rust let params = ParamsType { active_salary: [None; 9], passive_salary: [None; 9], demotion_period: [None, Some(10), None, None, None, None, None, None, None], min_promotion_period: [None; 9], offboard_timeout: Some(1), }; CoreFellowship::set_partial_params(signed(2), Box::new(params.clone())), ``` Test coverage ```diff running 21 tests test tests::unit::__construct_runtime_integrity_test::runtime_integrity_tests ... ok test tests::unit::basic_stuff ... ok test tests::integration::test_genesis_config_builds ... ok test tests::integration::__construct_runtime_integrity_test::runtime_integrity_tests ... ok test tests::unit::auto_demote_offboard_works ... ok test tests::unit::auto_demote_works ... ok test tests::unit::get_salary_works ... ok test tests::unit::active_changing_get_salary_works ... ok test tests::integration::swap_bad_noops ... ok test tests::unit::promote_postpones_auto_demote ... ok test tests::unit::infinite_demotion_period_works ... ok test tests::unit::proof_postpones_auto_demote ... ok test tests::unit::induct_works ... ok test tests::unit::set_params_works ... ok test tests::unit::test_genesis_config_builds ... ok test tests::unit::offboard_works ... ok test tests::unit::sync_works ... ok + test tests::unit::set_partial_params_works ... ok test tests::integration::swap_exhaustive_works ... ok test tests::unit::promote_works ... ok test tests::integration::swap_simple_works ... ok test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s Doc-tests pallet_core_fellowship running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ``` polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J --------- Co-authored-by: Dónal Murray <donalm@seadanda.dev> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Bastian Köcher <git@kchr.de>
This was referenced Aug 21, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ISSUE
Description
ParamsType
is anOption
field. Introduce throughOutcome
Test coverage
running 21 tests test tests::unit::__construct_runtime_integrity_test::runtime_integrity_tests ... ok test tests::unit::basic_stuff ... ok test tests::integration::test_genesis_config_builds ... ok test tests::integration::__construct_runtime_integrity_test::runtime_integrity_tests ... ok test tests::unit::auto_demote_offboard_works ... ok test tests::unit::auto_demote_works ... ok test tests::unit::get_salary_works ... ok test tests::unit::active_changing_get_salary_works ... ok test tests::integration::swap_bad_noops ... ok test tests::unit::promote_postpones_auto_demote ... ok test tests::unit::infinite_demotion_period_works ... ok test tests::unit::proof_postpones_auto_demote ... ok test tests::unit::induct_works ... ok test tests::unit::set_params_works ... ok test tests::unit::test_genesis_config_builds ... ok test tests::unit::offboard_works ... ok test tests::unit::sync_works ... ok + test tests::unit::set_partial_params_works ... ok test tests::integration::swap_exhaustive_works ... ok test tests::unit::promote_works ... ok test tests::integration::swap_simple_works ... ok test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s Doc-tests pallet_core_fellowship running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
polkadot address: 19nSqFQorfF2HxD3oBzWM3oCh4SaCRKWt1yvmgaPYGCo71J