3

We have the sudo pallet on a running live mainnet. It is almost time to remove it. What is the safest way to remove it in the code? We have made code upgrades before but removing a pallet (especially sudo) makes me nervous. What precisely is the right way to do this safely?

1
  • A way to render the sudo unreachable or provably defunct would also work here. Commented Nov 5, 2023 at 17:52

2 Answers 2

3

You can follow this PR.

https://github.com/darwinia-network/darwinia/pull/1173

This is how we handle it on our mainnet.

1
  • Perfect! Thank you! I will study the code changes and follow suit. Commented Nov 6, 2023 at 13:36
2

There is currently no call in the sudo pallet to set the key to None.

Undeploying the pallet is therefore the only non-hacky secure solution.
There are other ways, like setting the key to 0x000... or deleting it by a System::kill_storage call, but they are all a bit hacky. Undeploying the pallet is quite easy, just deleting the code in the runtime file should be enough.

PS: Opened #2165 to make this easier.

1
  • That would be a great feature. I hope that goes through! Commented Nov 6, 2023 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.