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

Add HRMP Cancel variant to hrmp_manage #2159

Merged
merged 8 commits into from
Mar 17, 2023
Merged

Conversation

Agusrodri
Copy link
Contributor

@Agusrodri Agusrodri commented Mar 14, 2023

What does it do?

This PR introduces the possibility to cancel a request within hrmp_manage() extrinsic present in xcm-transactor pallet.

Changes

  • Added Cancel variant to HrmpOperation enum.
pub enum HrmpOperation {
		InitOpen(HrmpInitParams),
		Accept {
			para_id: ParaId,
		},
		Close(HrmpChannelId),
		Cancel {
			channel_id: HrmpChannelId,
			open_requests: u32,
		},
	}
  • Added CancelOpenChannel variant to HrmpAvailableCalls enum.
pub enum HrmpAvailableCalls {
	InitOpenChannel(ParaId, u32, u32),
	AcceptOpenChannel(ParaId),
	CloseChannel(HrmpChannelId),
	CancelOpenChannel(HrmpChannelId, u32),
}
  • Also modified hrmp_encode_call() implementation of polkadot, kusama and westend relay encoders to accept these new variants.

@Agusrodri Agusrodri added B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. not-breaking Does not need to be mentioned in breaking changes labels Mar 14, 2023
@Agusrodri Agusrodri requested a review from girazoki March 14, 2023 19:40
@girazoki
Copy link
Collaborator

I dont think Adding an enum variant is a breaking change

@Agusrodri Agusrodri requested a review from girazoki March 16, 2023 19:33
Copy link
Collaborator

@girazoki girazoki 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

@girazoki
Copy link
Collaborator

Maybe you can add the variant to https://github.com/PureStake/moonbeam/blob/master/precompiles/relay-encoder/RelayEncoder.sol too. Or we can leave it for a future pr

@Agusrodri
Copy link
Contributor Author

Maybe you can add the variant to https://github.com/PureStake/moonbeam/blob/master/precompiles/relay-encoder/RelayEncoder.sol too. Or we can leave it for a future pr

I will open a new ticket and a new PR for that, to decouple changes a bit more.

@Agusrodri Agusrodri merged commit 93175f9 into master Mar 17, 2023
@Agusrodri Agusrodri deleted the agustin-hrmp-manage branch March 17, 2023 16:09
@notlesh notlesh added D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D5-nicetohaveaudit⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Apr 26, 2023
imstar15 pushed a commit to AvaProtocol/moonbeam that referenced this pull request May 16, 2023
* hrmp_manage modified - allow to cancel a request

* hrmp_manage - added Cancel variant to HrmpOperation

* added unit test for Cancel variant (hrmp)

* cargo fmt

* fixed parachain runtime files within xcm_mock

* fixed params and index of Cancel variant

* added test_hrmp_cancel unit test within encoders

* fixed test_relay_runtime in precompiles
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 D1-audited👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants