-
Notifications
You must be signed in to change notification settings - Fork 51
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 pallet-invulnerables (#163) #221
Conversation
@rimbi Can you provide a description of what the PR does? |
use sp_std::prelude::*; | ||
|
||
pub struct MigrateToV1<T>(sp_std::marker::PhantomData<T>); | ||
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> { |
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.
I dont understand this migraiton. At the beginning there wont be any invulnerables. What we need to do is set them for the first time, but that has nothing to do with the storage version of the pallet (as it did not change). You can remove this fiole for now, as we need to do the migration in some other way
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.
I assumed we would work on it together. You can ignore it for now.
At some point I think it might be good to offer this pallet-abstraction to cumulus, leaving this comment here to remember :) |
ed4a023
to
9263b47
Compare
1d5e498
to
bdb2040
Compare
}) | ||
.build() | ||
.execute_with(|| { | ||
let invulnerables_collator_selection = CollatorSelection::invulnerables(); |
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.
One suggestion now that we got this test working: remove the
.with_collators(vec![
(AccountId::from(ALICE), 210 * UNIT),
(AccountId::from(BOB), 100 * UNIT),
])
and use put_storage_value
like in https://github.com/moonbeam-foundation/moonbeam/blob/446faeb04153d127211a499244c900a1a5c71e54/pallets/asset-manager/src/tests.rs#L468. That way we are ready to remove the CollatorSelection in the following PR without having to change the test
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.
done
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.
A small comment regarding the migration test, but otherwise looking good!
6addca3
to
0ff7bec
Compare
* Add pallet-invulnerables * Update api-augment interfaces * Update migration * Fix try-runtime build * Rename migration variable * Rename the migration * Fix the build problem with try-runtime feature * Add logging to runtime upgrade functions * Add integration test for invulnerables migration * Remove the explicit use of CollatorSelection in the integration test * Remove the explicit use of CollatorSelection in the migration * Fix typo * Populate the invulnerables w/o using CollatorSelection pallet
This pallet mimics what we do in collator-selection:
We would also need to include a migration to migrate those invulnerables from pallet-collator-selection to pallet-invulnerables.