Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
XCM coretime region transfers #3455
XCM coretime region transfers #3455
Changes from 15 commits
5581f42
89b8829
55844cf
c398930
9200399
7f9eb12
99a447e
507eb47
4b0ee5d
eb7a61b
e1f99dd
01ffbe0
6307dd3
c9c2504
2ebe29d
beee619
5448324
911c8c2
30a9133
8ec636b
7809eba
663dc0b
799a1d9
52f7d4b
5b5f8de
b414856
fd70daa
d8eb54b
fdd21e4
128b665
9b2575b
09789f9
afc3193
c75b486
3c714a5
962b589
94fc92f
883ded4
0f510c8
e6cc759
73e9c7f
a04285e
e312286
948aafa
1374042
8d1d338
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will still fail since we don't support minting regions, resulting in setting the weight to the max value.
I added 'region minting' here: #3553, however, that would still disallow this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@franciscoaguirre Any ideas on what we might do in this regard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @seadanda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Szegoo is this still an issue? I think you need to create a region with
raw_region_id=42
first, so maybe some broker pallet magic, e.g.:or alternatively, simply inserting some data could do the trick:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside
pallet-xcm
when running the benchmark for reserve transfers it will attempt to deposit the region to an account before transferring it.This requires the
mint_into
to be implemented for regions.A possible solution could be to do something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will still fail:
Broker::create_region_for_benchmark
<- creates the region we will be reserve transferringAssetTransactor::deposit_asset
will fail since based on the code from Fix: Region reserve transfers #3553 we can't mint an already existing region: https://github.com/paritytech/polkadot-sdk/pull/3553/files#diff-40b92c4632f430a76d4f2c6a366582cbd2e4898fb24cd1a106a20c39872ea4d1R76Yeah, I agree, that isn't a good solution.
Maybe branching based on the feature flag might not actually be a bad solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly will fail?
Broker::create_region_for_benchmark
will create region without owner (I see, that in #3553 is changed to Option):AssetTransactor::deposit_asset
will callmint_into
and thatensure!(record.owner.is_none(), Error::<T>::NotAllowed);
will pass, because we setowner: None
, somint_into
sets an owner withorigin_location
as AccountId, so it exactly does what we need.pallet_xcm::reserve_transfer_assets
executesTransferAsset
XCM instruction which should end up with callingpallet_broker::do_transfer
, which just does some owner change.so far so good, unless I am missing anything.
Maybe, I would suggest to add here: #3553 a xcm-emulator tests or xcm unit-tests for the coretime-rococo/westend to ensure that
pallet_xcm::reserve_transfer_assets
really works, because you need to probably handle someFungible
fees besidesNonFungible(regionId)
, because we need to handle/setBuyExecution
on the destination, but that is not a problem, I could help, just tell me.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, I get it now. Yes, this is a good solution. I was assuming the region would be created with an owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged #3553 into this branch to test if it works, and it did, I managed to run the benchmark and generate weights :)
@bkontur Should we first merge #3553, or have both of these changes in this single PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Szegoo very cool, I see we don't even need
create_region_for_benchmark
and Pallet::issue` works, much better :)I would go just with one PR