Skip to content
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

Merged
merged 6 commits into from
Nov 2, 2021
Merged

feat: remove sudo #285

merged 6 commits into from
Nov 2, 2021

Conversation

weichweich
Copy link
Contributor

@weichweich weichweich commented Oct 28, 2021

  • try runtime doesn't go through because of the vesting pallet

M

Checklist:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • This PR does not introduce new custom types
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@weichweich weichweich self-assigned this Oct 29, 2021
Copy link
Contributor

@wischli wischli left a 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.

@weichweich weichweich requested a review from ntn-x2 November 1, 2021 16:55
@ntn-x2
Copy link
Member

ntn-x2 commented Nov 2, 2021

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.

Copy link
Member

@ntn-x2 ntn-x2 left a 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Contributor Author

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).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next time...

@weichweich weichweich merged commit 2e937de into develop Nov 2, 2021
@weichweich weichweich deleted the aw-remove-sudo branch November 2, 2021 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants