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

HRMP not working for genesis mode after opening channels #634

Closed
NachoPal opened this issue Jan 16, 2024 · 14 comments · Fixed by #635
Closed

HRMP not working for genesis mode after opening channels #634

NachoPal opened this issue Jan 16, 2024 · 14 comments · Fixed by #635

Comments

@NachoPal
Copy link

I tried to send HRMP messages after opening the channels in the Relay Chain, however it seems not to work.

I've been digging and hrmpIngressChannelIndexKey and hrmpEgressChannelIndexKey are returned empty even though they have a value after opening the channels.

In addition, in case that's solved, I think it will still fail because I couldn't find anywhere Parachain's RelevantMessagingState is updated as part of SetValidationData: https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/pallets/parachain-system/src/lib.rs#L627

@ermalkaleci
Copy link
Collaborator

Please post more details, like genesis and transaction. I will help me a lot

@ermalkaleci
Copy link
Collaborator

btw hrmp doesn't go through relaychain. each parachain intercepts its messages

@ermalkaleci
Copy link
Collaborator

now that I am thinking. This will require faking the ingress/egress channel to make it work for genesis

@ermalkaleci ermalkaleci linked a pull request Jan 16, 2024 that will close this issue
@ermalkaleci
Copy link
Collaborator

@NachoPal can you try this PR?

@NachoPal
Copy link
Author

NachoPal commented Jan 17, 2024

@NachoPal can you try this PR?

Replied in the PR.

Please post more details, like genesis and transaction. I will help me a lot

I am using same genesis as here: #621 (comment) and the second parachain is Karura.

And this is the extrinsic from AssetHubKusama to Karura (I had to manually open the HRMP channels first)

0x1f0803010100411f0300010100d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d030400000204320503d202964900070088526a740000000000

failing when sending in AssetHubKusama with:

polkadotXcm.Attempted {"outcome":{"Incomplete":[{"refTime":"683,414,000","proofSize":"6,196"},"Transport"]}}

because ingressChannel and egressChannel are empty for RelevantMessagingState (they should be updated during the SetValidationData()).

I had also to modify Kusama's config.yml in the following way to make it work without adding the Parachains in Relay Chain's genesis.

import-storage:
  Paras:
    ParaLifecycles:
      [
        [
          [
            1000
          ],
          Parachain
        ],
        [
          [
            2000
          ],
          Parachain
        ]
      ]

@NachoPal
Copy link
Author

NachoPal commented Feb 26, 2024

@ermalkaleci I am still facing the same issue after you PR: #635

This is the issue:

failing when sending in AssetHubKusama with:
polkadotXcm.Attempted {"outcome":{"Incomplete":[{"refTime":"683,414,000","proofSize":"6,196"},"Transport"]}}
because ingressChannel and egressChannel are empty for RelevantMessagingState (they should be updated during the SetValidationData()).

How did you test HRMP messages are working? Can you share your setup?

@ermalkaleci
Copy link
Collaborator

chopsticks will forward any message and inject para id into validation data, but if you're starting both chains from genesis none will have para id registered. I did start acala mainnet and assethub genesis and did a xcm from acala to assethub to register para id, or override storage to make it work.

@NachoPal
Copy link
Author

if you're starting both chains from genesis none will have para id registered

This is exactly what I am trying to achieve. Do you mean it is not possible right now? or what is the workaround? When I override the storage in the following way:

import-storage:
  ParachainSystem:
    RelevantMessagingState:
      dmqMqcHead: '0x0000000000000000000000000000000000000000000000000000000000000000'
      relayDispatchQueueRemainingCapacity:
        remainingCount: 8
        remainingSize: 1048576
      ingressChannels: [
        [
          2000,
          {
            maxCapacity: 1000,
            maxTotalSize: 102400,
            maxMessageSize: 102400,
            msgCount: 0,
            totalSize: 0,
            mqcHead: null
          }
        ]
      ]
      egressChannels: [
        [
          2000,
          {
            maxCapacity: 1000,
            maxTotalSize: 102400,
            maxMessageSize: 102400,
            msgCount: 0,
            totalSize: 0,
            mqcHead: null
          }
        ]
      ]

and try to send a XCM message to parachain 2000, RelevantMessagingState is reset to:

{
  dmqMqcHead: "0xc41bc6b08f6edee35de2bb684a5dd197c60e58296a5c22ca3e67d74cf072499f",
  relayDispatchQueueRemainingCapacity: {
    remainingCount: 8,
    remainingSize: "1,048,576",
  },
  ingressChannels: [],
  egressChannels: []
}

@ermalkaleci
Copy link
Collaborator

use current acala.yml config and update asset-hub endpoint with genesis. start xcm and send a msg from acala to asset-hub (a transfer). acala will build the msg and chopsticks will inject it to asset-hub validation data. then you can do xcm from asset-hub to acala

@NachoPal
Copy link
Author

use current acala.yml config and update asset-hub endpoint with genesis

I am using a totally different runtime from genesis as second Parachain, not Acala. I am trying to deploy a network, where all chains (Relay and Parachains) are deployed from genesis.

Can you confirm that what I am trying to do is not yet supported by Chopsticks, and if so, is it going to be implemented?

@ermalkaleci
Copy link
Collaborator

I don't know if there's anything else to implement. Chopsticks will listen to xcm and inject them to corresponding chain. Your problem seems to be none of the chains have any opened channel so runtime itself is not generating xcm for other chains to intercept. I don't know if there's an easy way to deal with this. What chains are you using and xcm message? I will see if there's a workaround

@NachoPal
Copy link
Author

NachoPal commented Mar 9, 2024

I don't know if there's anything else to implement. Chopsticks will listen to xcm and inject them to corresponding chain. Your problem seems to be none of the chains have any opened channel so runtime itself is not generating xcm for other chains to intercept. I don't know if there's an easy way to deal with this. What chains are you using and xcm message? I will see if there's a workaround

I opened #688 to fix it

@ermalkaleci
Copy link
Collaborator

I don't know if there's anything else to implement. Chopsticks will listen to xcm and inject them to corresponding chain. Your problem seems to be none of the chains have any opened channel so runtime itself is not generating xcm for other chains to intercept. I don't know if there's an easy way to deal with this. What chains are you using and xcm message? I will see if there's a workaround

I think I can make any parachain connect to each other

@ermalkaleci
Copy link
Collaborator

@NachoPal can we close this now?

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 a pull request may close this issue.

2 participants