Skip to content

Ensure minting funds after fallible checks and skip transfer checks on XDM when disabled #3514

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

Merged
merged 1 commit into from
May 4, 2025

Conversation

vedhavyas
Copy link
Contributor

@vedhavyas vedhavyas commented May 3, 2025

PR ensures

  • Funds are minted during XDM transfer after all the fallible checks are done
  • Ensure the transfer checks are disabled when Domain balance tracking is disabled
  • Ensures pre_checks such as chain not in the allowlist marks the incoming XDM as failed so that src_chain can claimed the rejected transfers

Closes: #3512
Closes: #3511

Code contributor checklist:

@vedhavyas vedhavyas enabled auto-merge May 3, 2025 12:59
NingLin-P
NingLin-P previously approved these changes May 3, 2025
@@ -236,7 +232,13 @@ impl<T: Config> Pallet<T> {
return Err(Error::<T>::InvalidChannelState.into());
}

endpoint_handler.message(dst_chain_id, (channel_id, nonce), req)
let pre_check_response = if !ChainAllowlist::<T>::get().contains(&dst_chain_id) {
Err(Error::<T>::ChainNotAllowed.into())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the test detects reject_transfer/update_transfer_rejected can be missed due to the ChainNotAllowed error, the same can also happen to other errors above e.g. WeightTagNotMatch, MissingChannel, InvalidChannelState, and even the NoMessageHandler error from the caller of this function. These should also be handled.

Copy link
Contributor Author

@vedhavyas vedhavyas May 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is true and reason its not handled here get the get tests pass and accidentally wont remove chain from allowlist.

Rest of the cases will happen when there are malicious domains which is not the case at the moment for taurus
We should make a proper refactor of this soon but its not a blocker for immediate runtime upgrade

Edit: Feel free to create an issue so that either one of us can handle it soon

@vedhavyas vedhavyas added this pull request to the merge queue May 4, 2025
Merged via the queue into main with commit 954a9ae May 4, 2025
10 checks passed
@vedhavyas vedhavyas deleted the xdm_fixes branch May 4, 2025 10:06
@vedhavyas vedhavyas added the audit-P1 High audit priority label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-P1 High audit priority
Projects
None yet
2 participants