Skip to content
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

Adapts XCM remote account derivation to match Polkadot Standard #484

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

imstar15
Copy link
Member

@imstar15 imstar15 commented Dec 8, 2023

Polkadot changes:
paritytech/polkadot#6662
paritytech/polkadot#7329

Refer to Astar's PR:
AstarNetwork/Astar#978

Run shibuya xcm-demo

npm run shibuya
? Select an action to perform Execute immediately
2023-12-08 16:41:22        API/INIT: RPC methods not decorated: automationPrice_queryFeeDetails
2023-12-08 16:41:22        API/INIT: turing/296: Not decorating unknown runtime apis: AutomationPriceApi/1
2023-12-08 16:41:22        API/INIT: shibuya/108: Not decorating runtime apis without matching versions: EthereumRuntimeRPCApi/5 (4 known)
2023-12-08 16:41:22        API/INIT: shibuya/108: Not decorating unknown runtime apis: 0xe0837fce09f4829a/1
Wallet address on turing-local:6AwtFW6sYcQ8RcuAJeXdDKuFtUVXj4xW57ghjYQ5xyciT1yd, shibuya: ajYMsCKsEAhEvHpeA4XqsfiA9v1CdzZPrCfS6pEfeGHW9j8
SBY ID on turing-local:  4

1. One-time proxy setup on shibuya ...

a) Add a proxy for Alice If there is none setup on shibuya

proxies:  []
Add a proxy of turing-local (paraId:2114 and proxyType: Any on shibuya ...
 Proxy address: ZDJA2VoNLGf7TfwUB4bG4kt1jfZSMAkK2s5XTAuYUwFbDpV

status.type Ready
status.type InBlock
status.type Finalized

Topping up the proxy account on shibuya with SBY ...

status.type Ready
status.type InBlock
status.type Finalized

b) Proxy’s balance on shibuya is 10 SBY.

2. One-time proxy setup on turing-local ...

a) Add a proxy for Alice If there is none setup on turing-local (paraId:2000)

Add a proxy of shibuya (paraId:2000) and proxyType: Any on Turing ...
 Proxy address: 69CFJ88FC28TrEoDPpKpVNeYHdMF77EgZQ72JtsnES3chezL

status.type Ready
status.type InBlock
status.type Finalized

Topping up the proxy account on turing-local via reserve transfer ...
Transfer from shibuya, extrinsic: 0x37010300000000130000e8890423c78a030102000921010086b163f3eeb29f4ce34a47d1713c834f90eb405bb57793e603456f8b5718b1c800

b) Proxy’s balance on turing-local is 0 SBY.

3. Execute an XCM from shibuya to schedule a task on [object Object] ...

a). Create a payload to store in Turing’s task ...

b) Execute the above an XCM from shibuya to schedule a task on turing-local ...
status.type Ready
Send extrinsic from shibuya to schedule task. extrinsic: 0x33000301010009210314000400010100411f0003dc6b69b11300010100411f0003dc6b69b101075d7e78aa014a3801000601035dc2d7444a38010049023c030004000000000000000003010100411f03010100411f03010100411f97b33c19460f0d000000000000000000d0120000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01000a073048656c6c6f20776f726c6421ee59452a8949037b7efcf88a491000d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d140d01020401010100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
status.type Ready
        automationTime:TaskScheduled:: (phase={"applyExtrinsic":0})
                        AccountId32: 69CFJ88FC28TrEoDPpKpVNeYHdMF77EgZQ72JtsnES3chezL
                        Bytes: 0x31322d302d38
                        Option<AccountId32>: 6AwtFW6sYcQ8RcuAJeXdDKuFtUVXj4xW57ghjYQ5xyciT1yd
status.type InBlock
status.type InBlock
status.type Finalized
Found the event and retrieved TaskId, 12-0-8

4. Keep Listening events on shibuya until 2023-12-08 16:44:16(1702025056) to verify that the task(taskId: 12-0-8) will be successfully executed ...
status.type Finalized
        proxy:ProxyExecuted:: (phase={"applyExtrinsic":1})
                        Result<Null, SpRuntimeDispatchError>: Ok

Task has been executed! Waiting for 20 seconds before reading proxy balance.

After execution, Proxy’s balance is 9.9963 SBY. The delta of proxy balance, or the XCM fee cost is 0.0036 SBY.
Reached the end of main() ...

Task was executed

image

XCM was executed

image

Copy link
Member

@chrisli30 chrisli30 left a comment

Choose a reason for hiding this comment

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

Okay, so we don’t need to update anything for automationTime.scheduleXcmpTaskThroughProxy? We just need to add this HashedDescription data structure to use getDerivativeAccountV3 in xcm-demo?

@imstar15
Copy link
Member Author

Okay, so we don’t need to update anything for automationTime.scheduleXcmpTaskThroughProxy? We just need to add this HashedDescription data structure to use getDerivativeAccountV3 in xcm-demo?

Yes.
We just need to add this HashedDescription data structure to use getDerivativeAccountV3 in xcm-demo.

@imstar15 imstar15 merged commit 6f5442a into master Dec 11, 2023
3 checks passed
@imstar15 imstar15 deleted the stable-derivation-account branch December 11, 2023 01:20
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