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

Manage XCM through maintenance mode filters #243

Merged
merged 27 commits into from
Sep 15, 2023
Merged

Conversation

Agusrodri
Copy link
Contributor

@Agusrodri Agusrodri commented Sep 4, 2023

This PR adds the possibility of managing XCM functionalities through maintenance mode filters.

The following changes were applied to frontier and simple templates, and also to the dancebox runtime:

  • MaintenanceFilter will forbid any call to polkadotXcm pallet.

  • xcm-support feature was added to pallet-maintenance-mode, alongside with the custom implementations of XcmExecutionManager, NormalDmpHandler and MaintenanceDmpHandler types.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Master coverage: 72.05%
Coverage generated "Fri Sep 15 13:09:27 UTC 2023":
https://d3gkbsry1ehhqi.cloudfront.net/tanssi-coverage/pulls/243/index.html
Pull coverage: 71.89%

@@ -520,10 +522,20 @@ impl pallet_utility::Config for Runtime {
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
}

pub struct XcmExecutionManager;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am starting to think we should move this into xcm-pritmitives

@Agusrodri
Copy link
Contributor Author

Agusrodri commented Sep 7, 2023

TODO: add tests for DMP and general XCM messages in maintenance mode.

Edit: the XCM queue works as expected (after disabling maintenance mode the queued message is automatically executed in the corresponding block).

On the other hand, that is not the case with DMP queue, which is failing only on frontier template (the queued message is not being automatically executed after disabling maintenance mode). I'm investigating the issue.

Second edit: (solved)


Explanation of the problem

The issue was related to fixed XCM weights and their impact inside the Configuration storage present in DmpQueue pallet.

The ConfigData struct that is saved in this storage, owns a field called max_individual, that represents the maximum amount of weight any individual message coming by DMP may consume during its execution. By default, this field has a related proof_size of 64KB, which conflicts with the fixed size of proof_size for XCM execution (also 64KB).

Due to this conflict, the incoming DMP message is put inside the Overweight queue and is not properly queued in the normal queue for its later execution.

To solve this, a proper solution would be to add a extrinsic to the DmpQueue pallet that allows to change the value inside max_individual field. Meanwhile, we will opt in to add a function inside tests that allows to change the value of max_individual as desired, but the problem will still be there for big XCM messages until we have an upstream solution in DmpQueue pallet.

@girazoki
Copy link
Collaborator

@Agusrodri can you merge master in? Also we can merge as is but I will create an issue to move these into their proper primitives crates in moonkit

@Agusrodri Agusrodri merged commit c7804e4 into master Sep 15, 2023
22 checks passed
@Agusrodri Agusrodri deleted the agustin-maintenance-mode branch September 15, 2023 14:03
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.

2 participants