Skip to content

Address review comments: remove unused deps, fix imbalance handling, update comments#554

Merged
ebma merged 3 commits intoallow-native-token-teleport-to-assethubfrom
copilot/sub-pr-553
Feb 27, 2026
Merged

Address review comments: remove unused deps, fix imbalance handling, update comments#554
ebma merged 3 commits intoallow-native-token-teleport-to-assethubfrom
copilot/sub-pr-553

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

Addresses unresolved review comments from PR #553:

Changes

  • Removed unused staging-xcm-executor dependency from pallets/xcm-teleport/Cargo.toml and all feature lists (std, runtime-benchmarks) — not referenced in code

  • Fixed critical security issue in teleport_native_to_asset_hub: Previously burned tokens immediately before XCM validation/delivery, causing permanent fund loss on routing failures. Now:

    • Keeps imbalance alive through validation and delivery
    • Only burns after successful delivery via drop(imbalance)
    • Refunds to sender via T::Currency::resolve_creating() on validation or delivery errors
  • Updated comment in runtime/pendulum/src/xcm_config.rs:338 from "Teleporting is disabled" to accurately reflect restriction via TrustedTeleporters

  • Removed unused import use sp_std::vec; from pallet

Limitation

The refund mechanism only covers local routing failures. If the XCM message is successfully delivered but fails during execution on AssetHub, tokens remain burned (remote execution failures are not detectable at send time).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 27, 2026 09:38
…lance properly

Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable teleport of native token to Assethub Address review comments: remove unused deps, fix imbalance handling, update comments Feb 27, 2026
@ebma ebma marked this pull request as ready for review February 27, 2026 09:50
@ebma ebma merged commit 7bac432 into allow-native-token-teleport-to-assethub Feb 27, 2026
@ebma ebma deleted the copilot/sub-pr-553 branch February 27, 2026 09:51
ebma added a commit that referenced this pull request Mar 27, 2026
* Adjust xcm_config.rs for Pendulum and allow teleport of PEN to assethub

* Implement xcm-teleport pallet

* Add xcm-teleport pallet to pendulum runtime

* Adjust xcm-teleport pallet to deposit leftover DOT back into sovereign account

* Adjust config in pendulum runtime

* Implement teleport check-in and check-out logic in custom transactor

* Implement teleport destination validation in custom transactor

* Rename variables

* Address review comments: remove unused deps, fix imbalance handling, update comments (#554)

* Initial plan

* Address review comments: remove unused deps, fix comment, handle imbalance properly

Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>

* Clarify comment about refund limitations

Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>

* Revert UnitWeightCost change

* Add minimum teleport amount to prevent griefing attacks

* Add logic to convert between PEN and DOT price using onchain prices

* Fix `vec!` missing

* Deposit leftover DOT to beneficiary

* Reduce MaxDotFeeAmount to 0.5

* Adjust stale code

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ebma <6690623+ebma@users.noreply.github.com>
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