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 #185

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Feat/remove sudo #185

merged 8 commits into from
Mar 11, 2024

Conversation

lrazovic
Copy link
Member

@lrazovic lrazovic commented Mar 11, 2024

What?

  • Remove the Sudo pallet.
  • Remove the calls from the BaseCallFilter.

Why?

It's about time.

How?

  • Remove the Sudo pallet from the construct_runtime! macro.
  • Add a new RemovePallet migration to remove all the keys (2) in the DB.

Anything Else?

@lrazovic lrazovic self-assigned this Mar 11, 2024
@lrazovic lrazovic marked this pull request as ready for review March 11, 2024 14:25
@lrazovic
Copy link
Member Author

lrazovic commented Mar 11, 2024

try-runtime-cli input:

try-runtime \
          --runtime target/release/wbuild/polimec-base-runtime/polimec_base_runtime.compact.compressed.wasm \
          on-runtime-upgrade \
          live --uri wss://rpc.polimec.org:443

try-runtime-cli output:

[2024-03-11T14:27:24Z INFO  try-runtime::cli] Original runtime [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 5000] [Code hash: 0x0162...c6f6]
[2024-03-11T14:27:24Z INFO  try-runtime::cli] New runtime      [Name: RuntimeString::Owned("polimec-mainnet")] [Version: 5005] [Code hash: 0xaf64...35a3]
[2024-03-11T14:27:24Z INFO  try-runtime::cli] 🚀 Speed up your workflow by using snapshots instead of live state. See `try-runtime create-snapshot --help`.
[2024-03-11T14:27:24Z INFO  try_runtime_core::commands::on_runtime_upgrade] 🔬 Running TryRuntime_on_runtime_upgrade with checks: PreAndPost
[2024-03-11T14:27:24Z INFO  frame_support::migrations] Found Sudo keys pre-removal 👀
[2024-03-11T14:27:24Z INFO  frame_support::migrations] Removed 2 Sudo keys 🧹
[2024-03-11T14:27:24Z INFO  frame_support::migrations] No Sudo keys found post-removal 🎉
[2024-03-11T14:27:24Z INFO  runtime::frame-support] ⚠️ PolkadotXcm declares internal migrations (which *might* execute). On-chain `StorageVersion(1)` vs current storage version `StorageVersion(1)`
[2024-03-11T14:27:24Z INFO  try_runtime_core::commands::on_runtime_upgrade] 🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.
[2024-03-11T14:27:24Z INFO  frame_support::migrations] Removed 2 Sudo keys 🧹
[2024-03-11T14:27:24Z INFO  runtime::frame-support] ⚠️ PolkadotXcm declares internal migrations (which *might* execute). On-chain `StorageVersion(1)` vs current storage version `StorageVersion(1)`
[2024-03-11T14:27:24Z INFO  try_runtime_core::commands::on_runtime_upgrade] 🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: PreAndPost
[2024-03-11T14:27:24Z WARN  frame_support::migrations] Migration RemovePallet<Sudo> can be removed (no keys found pre-removal).
[2024-03-11T14:27:24Z INFO  frame_support::migrations] Removed 2 Sudo keys 🧹
[2024-03-11T14:27:24Z INFO  frame_support::migrations] No Sudo keys found post-removal 🎉
[2024-03-11T14:27:24Z INFO  runtime::frame-support] ⚠️ PolkadotXcm declares internal migrations (which *might* execute). On-chain `StorageVersion(1)` vs current storage version `StorageVersion(1)`
[2024-03-11T14:27:24Z INFO  try-runtime::cli] PoV size (zstd-compressed compact proof): 635 B. For parachains, it's your responsibility to verify that a PoV of this size fits within any relaychain constraints.
[2024-03-11T14:27:24Z INFO  try-runtime::cli] Consumed ref_time: 0s (0.00% of max 0.5s)
[2024-03-11T14:27:24Z INFO  try-runtime::cli] ✅ No weight safety issues detected. Please note this does not guarantee a successful runtime upgrade. Always test your runtime upgrade with recent state, and ensure that the weight usage of your migrations will not drastically differ between testing and actual on-chain execution.

@lrazovic lrazovic requested review from vstam1 and JuaniRios March 11, 2024 14:32
Copy link
Contributor

@JuaniRios JuaniRios left a comment

Choose a reason for hiding this comment

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

LGTM.
Using a json file for the live polimec genesis seems to be the way to do it if we look at polkadot's implementation

@lrazovic lrazovic merged commit 29fceb9 into main Mar 11, 2024
@JuaniRios JuaniRios deleted the feat/remove-sudo branch March 26, 2024 08:18
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