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

Girazoki xcm queues to maintenance mode #1031

Merged
merged 33 commits into from Dec 2, 2021

Conversation

girazoki
Copy link
Collaborator

@girazoki girazoki commented Nov 26, 2021

What does it do?

This PR adds support for disabling XCM in maintenance mode. We do so by making the maintenance_mode control two things:

  • xcmp and dmp handlers for the queues. This is gonna be called each time a new xcm message arrives. For maintenance mode, we have set a max_weight_limit of 0, which prevents any message from being executed and it enqueues them.

  • Pallet hooks. The main reason for making maintenance_mode control this is that both dmp and xcmp queues executed messages onIdle. I added the possibility of removing specific hooks in maintenance mode, and in the particular case of xcm, I did set this to 0.

This scenario is difficult to test, at least until we have an xcm mocker. So for now I just added a integration test, which does not run in the CI but anyone can verify it works.

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

@girazoki girazoki added the B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes label Nov 26, 2021
@girazoki girazoki marked this pull request as ready for review November 26, 2021 13:57
Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

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

Looks good to me! Nice design.

The pallet's doc comments should be updated to indicate these changes, including removing point 5 under "future improvements". #TheFutureIsHere

runtime/moonbase/src/lib.rs Show resolved Hide resolved
pallets/maintenance-mode/Cargo.toml Outdated Show resolved Hide resolved
runtime/moonbase/src/lib.rs Outdated Show resolved Hide resolved
pallets/maintenance-mode/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@JoshOrndorff JoshOrndorff left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

@girazoki girazoki merged commit 6327ae8 into master Dec 2, 2021
@girazoki girazoki deleted the girazoki-xcm-queues-to-maintenance-mode branch December 2, 2021 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants