-
Notifications
You must be signed in to change notification settings - Fork 101
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 XcmPaymentApi and DryRunApi to all runtimes #380
Add XcmPaymentApi and DryRunApi to all runtimes #380
Conversation
Why is it showing all of these commits? Can you try:
so you rebase your commits on latest master, then this PR will show up clean? |
d4617c1
to
7d867b5
Compare
@acatangiu I pulled main and merged, but it didn't work. So I just branched off of main and cherry-picked the relevant commits. It's all good now :) |
Just missing the changelog |
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.
Please add a couple integration tests for them too (ideally at least one per chain) so we have basic coverage that they're working.
@acatangiu I added a test for XCM fee estimation but for some reason the last hop of the message does not get executed. The InitiateReserveWithdraw in PenpalA happens, the DepositReserveAsset in AssetHubPolkadot happens, but then the ReserveAssetDeposited in PenpalB doesn't happen. Checked the logs and I don't see any error. I'll keep investigating. |
Make sure to "progress" the chains in the emulator - the chains only "make progress" (process messages, etc) when their externalities are instantiated. E.g. make sure for each chain to have some
|
I added tests for AssetHub Polkadot and Kusama. For BridgeHub I'm thinking the test should estimate fees over the bridge and for the rest of the chains I just want to estimate teleports from AssetHub to them. |
integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/xcm_fee_estimation.rs
Outdated
Show resolved
Hide resolved
integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/xcm_fee_estimation.rs
Outdated
Show resolved
Hide resolved
integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/xcm_fee_estimation.rs
Outdated
Show resolved
Hide resolved
integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/xcm_fee_estimation.rs
Outdated
Show resolved
Hide resolved
integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/xcm_fee_estimation.rs
Outdated
Show resolved
Hide resolved
You could add the estimation here and here. Then use these macros for all system chains and get full relay<>system-chains coverage. (You should add it in separate PR to SDK too: https://github.com/paritytech/polkadot-sdk/blob/291210aa0fafa97d9b924fe82d68c023bdb0a340/cumulus/parachains/integration-tests/emulated/common/src/macros.rs#L42) |
Integrated the delivery fees into both |
I saw |
Just missing adding some delivery fee estimation in an asset transfer over the bridge and this is good to go 🚀 |
Hmm, the bridge fee estimation has some qwirks. You think we can merge this as is and I'll open another PR with an example of bridge estimation? @acatangiu |
|
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.
// We need to mint funds into the checking account of `$receiver_relay`
// for it to accept a teleport from `$sender_para`.
// Else we'd get a `NotWithdrawable` error since it tries to reduce the check account balance, which
// would be 0.
<$receiver_relay>::execute_with(|| {
let check_account = <$receiver_relay as [<$receiver_relay Pallet>]>::XcmPallet::check_account();
assert_ok!(<$receiver_relay as [<$receiver_relay Pallet>]>::Balances::mint_into(
&check_account,
$amount,
));
});
In test_parachain_is_trusted_teleporter_for_relay
, I am confused that why relay's check account balance would be reduced when relay is receiver
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.
The checking account on Relay tracks how many DOTs have been teleported out. So when they are teleported back in, this number decreases (is reduced).
…ot-runtimes into xcm-runtime-apis
/merge |
Enabled Available commands
For more information see the documentation |
7723274
into
polkadot-fellows:main
Adds the paritytech/polkadot-sdk#3607 and paritytech/polkadot-sdk#3872 to all runtimes.
These APIs work together to allow dry running and estimating execution and delivery fees for XCMs.
This PR doesn't allow querying the price in assets different than the relay token for asset hubs. Can be done in a following PR.
Also tracking #388 and #389 for future improvemens.
Old PR was #359, this one targets main already updated to Polkadot SDK 1.13.
Dear reviewer
Although there are a lot of changes, the main one is the addition of the two aforementioned APIs to all relays and system parachains. The rest of the files are tests, which all have the same format.