-
Notifications
You must be signed in to change notification settings - Fork 81
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
Feat: allow borrow automation #1733
Conversation
@onnovisser and @annamehr this PR will allow to make on/off-ramping mostly automatic from the UI side. Which XCM to actually generate in the end I will post here and we can test it then in the UI. Unfortunately, I think we need to test the UI in the production network. But lets see. |
Another reason to upgrade to Polkadot v1.1.0 ASAP because that's the earliest version which supports remote account derivation AFAICS. |
Yes, but we already got that in with out own custom deriation. So there is no need for that to enable that feature, but for sure polkadot upgrade is well needed now. |
@wischli I would merge this one now that you have confirmed that it is working. The fees and all around that are AH related. |
@@ -93,7 +93,7 @@ impl<T: Runtime> Env<T> for RuntimeEnv<T> { | |||
call: impl Into<T::RuntimeCallExt>, | |||
) -> Result<Balance, DispatchError> { | |||
let call: T::RuntimeCallExt = call.into(); | |||
let info = call.get_dispatch_info(); | |||
let info = self.parachain_state(|| call.get_dispatch_info()); |
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.
NIT. Maybe can be moved directly inside line 126
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.
Not sure what you mean?
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 info
is used only in line 126
under an already parachain_state()
. So maybe call.get_dispatch_info()
can be moved there. But a super NIT thing.
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 was wondering whether we want to add RtApi calls to generate the derived accounts depending on the remote location. If at all, probably something for a subsequent PR. Right now, AH is the only expected remote location such that Apps could hardcode the derivation.
Already possible with the conversion_of api |
Description
Currently, we are on/off-ramping tokens from/to
AssetHub
frequently. Unfortunately, Circle does not recognize token transfers made through XCM. I.e. tokens are lost, because Circle does not know which account send them. My best guess would be, that the internal XCM transfer logic, using only traits does not trigger a single event that Circle can rely on.But with the new remote account derivation logic that was introduces to
AssetHub
, we can fix this by doing aTransact(pallet_assets::transfer(..))
from the users remote account.The proposed solution in our case here will look like:
batch_all(xtokens::transfer(..), palletXcm::send(..))
.The first extrinsic will send a transfer tokens XCM, that will deposit the tokens in the remote account of the user, the second extrinsic will call
Transact(pallet_assets::transfer(.., dest: Circle))
with the remote account of the user as the origin.batch_all(palletXcm::send(..))
.Transact(palletXcm::transfer(.., dest: Centrifuge))
with the remote account of the user as the origin. Sending the already existing tokens from the users account onAssetHub
via XCM toCentrifuge
*Changes and Descriptions
pallet_xcm::send(..)
by anyOrigin::signed(..)
- NOTE: No harm here, as we are not executing that on our chain. Messages is send straigt to destinationLocalOriginToLocation
fix - uses correctNetworkId
nowTasks
AccountConverter
- The thing is too important and we should have some hardcoded derivations to know that it is not changing might flieghtPolkadot
andCentrifuge
Checklist: