-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat: remove sudo #285
feat: remove sudo #285
Conversation
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.
LGTM!
Let's set up one to three council members which are also technical committee on WILT before upgrading.
Don't have a strong argument in favor of implementing my suggestions, also because the sudo migration will be removed soon, but I think it would still make it easier to read now and in future, if we need a similar approach for other pallets. |
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.
Don't have a strong argument in favour of implementing my suggestions, especially since the sudo migration will be removed soon. Anyway, I think it would make it easier to read it now and in the future, if we want to apply a similar migration to other pallets.
|
||
log::info!("Pre check Sudo-Removal."); | ||
let res = frame_support::storage::unhashed::get::<AccountId>(&hex![ | ||
"5c0d1176a568c1f92944340dbfed9e9c530ebca703c85910e7164cb7d1c9e47b" |
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 would probably derive this value using some function? Like https://docs.substrate.io/rustdocs/latest/frame_support/storage/migration/fn.get_storage_value.html.
|
||
fn on_runtime_upgrade() -> frame_support::weights::Weight { | ||
// Magic bytes are the sudo pallet prefix | ||
let _ = frame_support::storage::unhashed::kill_prefix(&hex!["5c0d1176a568c1f92944340dbfed9e9c"], Some(2)); |
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.
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.
that would not work since we already get the prefix of a storage entry and not that of a the whole pallet
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 could do twox_128(pallet_name)
.
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.
next time...
M
Checklist:
array[3]
useget(3)
, ...)