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

Feature suggestion , "AndThen" instruction #46

Open
MrishoLukamba opened this issue Sep 10, 2023 · 7 comments
Open

Feature suggestion , "AndThen" instruction #46

MrishoLukamba opened this issue Sep 10, 2023 · 7 comments

Comments

@MrishoLukamba
Copy link

We have nested Xcm instruction whereby the preceding instruction will be executed using certain origin in a certain destination environment.

For example, TransferReserveAsset instruction.
But the existing nested xcm instructions they are rigid in terms of working with Assets.

Suggestions: What is there is a " AndThen" instruction whereby you can nest xcm instructions while be flexible on whether you should work with Assets or just Transact instructions.

AndThen {
.. Instruction {
... The following instruction with other asset perhaps and different destination.
}
}

@dzmitry-lahoda
Copy link

@MrishoLukamba may you format it and expand please? How it will work and interaction with other XCM things?

@MrishoLukamba
Copy link
Author

@MrishoLukamba may you format it and expand please? How it will work and interaction with other XCM things?

For now follow up XCM instructions are only limited to asset transfers, thus includes TransferReserveAsset and others.
But this is limiting. I am suggesting we add AndThen instruction. This instruction will enable setting number of messages M < MaxConfigMessages. The instructions may include transact instructions and asset manipulation instructions.

AndThen { FirstInstruction { Followup Instruction depending on the first } }
And this instruction should enable changing of destination per instruction included inside

@bkchr
Copy link
Contributor

bkchr commented Nov 6, 2023

CC @franciscoaguirre

@franciscoaguirre
Copy link
Contributor

@MrishoLukamba
I did not understand the need for the instruction, in which way is the nested XCM restricted?

@MrishoLukamba
Copy link
Author

@MrishoLukamba

I did not understand the need for the instruction, in which way is the nested XCM restricted?

The only nested instructions are of asset transfers. But it without that it is not possible

@franciscoaguirre
Copy link
Contributor

You don't need to nest XCMs to achieve running multiple things. You can put a lot of instructions for creating complex programs.
If you need one set of instructions to only be executed depending on the success of some first instructions, you could use the error handler to do a sort of if else structure where your XCM program can take one of two paths.

If you want to expand more on this suggestion, I suggest you write an RFC for it and I'd be happy to take a look at it. You can see some RFCs that have passed already, like ExecuteWithOrigin and SetAssetClaimer.

@MrishoLukamba
Copy link
Author

MrishoLukamba commented Nov 9, 2023

You don't need to nest XCMs to achieve running multiple things. You can put a lot of instructions for creating complex programs.

If you need one set of instructions to only be executed depending on the success of some first instructions, you could use the error handler to do a sort of if else structure where your XCM program can take one of two paths.

If you want to expand more on this suggestion, I suggest you write an RFC for it and I'd be happy to take a look at it. You can see some RFCs that have passed already, like ExecuteWithOrigin and SetAssetClaimer.

Okey I will create an RFC as I do believe nested Xcm instructions with different destination context is necessary for flexibility. Thanks @franciscoaguirre for the mentioned RFC especially the executewithOrgin

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

No branches or pull requests

4 participants