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?
2 Answers
You can follow this PR.
https://github.com/darwinia-network/darwinia/pull/1173
This is how we handle it on our mainnet.
-
Perfect! Thank you! I will study the code changes and follow suit. Commented Nov 6, 2023 at 13:36
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.
-
That would be a great feature. I hope that goes through! Commented Nov 6, 2023 at 13:36