Skip to content

fix: add fallback price for global rate limiter#1427

Open
dmoka wants to merge 2 commits intomasterfrom
fix/fallback-price-in-global-limit
Open

fix: add fallback price for global rate limiter#1427
dmoka wants to merge 2 commits intomasterfrom
fix/fallback-price-in-global-limit

Conversation

@dmoka
Copy link
Copy Markdown
Contributor

@dmoka dmoka commented Apr 21, 2026

external-asset withdraw/XCM returned FailedToConvertAsset whenever the oracle route was missing.

Adding onchain route is a quick fix, but better to add conversion using the fallback price if no oracle price can be retrieved

@dmoka dmoka marked this pull request as ready for review April 21, 2026 10:19
@github-actions
Copy link
Copy Markdown

Crate versions that have not been updated:

  • runtime-integration-tests: v1.79.0
  • hydradx-runtime: v411.0.0

Runtime version has not been increased.

@F3Joule F3Joule self-requested a review April 21, 2026 11:34
}

let (converted, _) = ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert((
ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert((
Copy link
Copy Markdown
Contributor

@F3Joule F3Joule Apr 21, 2026

Choose a reason for hiding this comment

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

convert_to_hdx is generic over ReferenceCurrencyId, but the fallback assumes ref currency = HDX (since currency_price always returns price relative to the native asset). Current callers all pass NativeAssetId so this is fine, but consider a debug_assert! or comment to guard against future misuse.

ConvertBalance::<TenMinutesOraclePrice, XykPaymentAssetSupport, DotAssetId>::convert((

Copy link
Copy Markdown
Contributor

@F3Joule F3Joule left a comment

Choose a reason for hiding this comment

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

lgtm

@github-actions
Copy link
Copy Markdown

Quick benchmark at commit 4534722 has been executed successfully.
View results

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