-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix: bug on oracle fetching #1750
Conversation
assert_eq!( | ||
orml_asset_registry::Metadata::<T>::get(LocalUSDC.id()), | ||
None | ||
); | ||
assert_eq!( | ||
orml_asset_registry::Metadata::<T>::get(DomainUSDC.id()), | ||
None | ||
); |
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.
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.
Could this be due to the migration being performed before initializing the tests? Our migration populates the state with those currencies IIRC
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.
Oh man. That could be. Haha. But then it is not working as intended. As the local representation is missing on asset 100_001. I will try to use different ids.
Thanks @lemunozm!
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.
But here we are using id 100_0001
instead of 100_001
LpEthUsdc. I suppose the local asset id of 1 is the issue then. Compiling right now with my cherry-pick for disabling migrations in std: 0e53752
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.
Yup, works now! Eagle eye @lemunozm 🎯
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.
LGTM. I think the currencies testing API now is more versatile.
Maybe we could extend the integration-tests with some pallet-token-mux
call to ensure the whole use case is working well
transferability: CrossChainTransferability::Xcm(XcmMetadata { | ||
fee_per_second: Some(1_000), | ||
}), |
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.
Just wondering why Usd6
has this property but Usd12
and Usd18
do not. Could we use the same for all of them?
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 just copy pasted everything. Not sure, why it was there.
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.
Seems like we want to have default transferability here instead?
10u128.pow(self.decimals()) | ||
} | ||
|
||
fn symbol(&self) -> &'static str; |
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.
Most of the time, we do not care about the symbol for testing. Could we use a default method here with some random/empty string? Maybe "Unnamed" or so.
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.
Agreed!
I agree that this would be useful. But I do not have time for that. I am testing everything in demo at the moment. Thats also where I found this issue. I think the best would be to merge #1720 and then write integration test verifying the whole flow... |
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.
Just want to change one thing that I think it's important to modify/clarify.
Everything else looks great!
runtime/altair/src/migrations.rs
Outdated
#[cfg(feature = "std")] | ||
pub type UpgradeAltair1034 = (); | ||
|
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.
Maybe there exists a way to tune RuntimeEnv
to avoid this issue from the tests? I do not like adding this addition to the runtime too much with the aim of avoiding migrations in testing. Future readers of this will not know why this is so, and we can be subject to unexpected behavior in the future. I would add a comment at least explain why 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.
Another option is tweaking the block creation in RuntimeEnv
somehow to skip the migration. Not sure if this is something easy to do
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.
Since this is my forced change which should not have been pushed to this branch in the first place, I will just revert it. However, it improves integration test time because it blocks migrations for each node we spawn.
What unexpected behaviour are you fearing here @lemunozm? I think it is unexpected that migrations run for integration tests which is fixed this way. It's not the nicest solution but it does the job quickly without imposing any risk.
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.
Fixed in 4f41f24
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.
However, it improves integration test time because it blocks migrations for each node we spawn.
Good point!
What unexpected behaviour are you fearing here @lemunozm?
Could some uses of the node underlying it exist that compile the runtime as std
and where do we expect some kind of migration, maybe some migration testing or so? Probably not now but it scared 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.
Fixed in 4f41f24
Love the solution! Maybe this can even be ported to fudge to avoid migrations there too (not mandatory for this 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.
The Usd6
still has XCM transferability enabled. Apart from that LGTM!
// NOTE: Setting the current on-chain runtime version to the latest one, to | ||
// prevent running migrations | ||
parachain_ext.execute_with(|| { | ||
frame_system::LastRuntimeUpgrade::<T>::put(LastRuntimeUpgradeInfo::from( | ||
<T as frame_system::Config>::Version::get(), | ||
)) | ||
}); |
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.
Awesome change, thanks for that!
transferability: CrossChainTransferability::Xcm(XcmMetadata { | ||
fee_per_second: Some(1_000), | ||
}), |
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.
Seems like we want to have default transferability here instead?
That is comming from main, so I am not keen on changing that here. @lemunozm your commit apparently. |
TBH, I do not remember. Maybe a copy-paste from another place. I would put there what you think is cleaner/defaulted/simpler (probably what @wischli said) |
So we know now the reason 😆, we needed it for the proxy cross-change tests. I think this is a change added by @cdamian (who could explain the whys better) in the PR I opened about proxies, that's why git blame tell about me. Maybe we can create a currency in our own proxy tests for cross-chain things with the required metadata, using the new way of doing it. WDYT? |
@lemunozm fixed. Can you approve if you are happy? |
Sorry for my late review! Really cool the new |
Description
The current oracle does check local representation of wrongly.
Changes and Descriptions
OracleRatioProvider
Checklist: