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

UI is broken after upgrading to polkadot v0.9.11 #6349

Closed
GopherJ opened this issue Oct 20, 2021 · 13 comments
Closed

UI is broken after upgrading to polkadot v0.9.11 #6349

GopherJ opened this issue Oct 20, 2021 · 13 comments

Comments

@GopherJ
Copy link
Contributor

GopherJ commented Oct 20, 2021

image

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

cannot choose account it seems, and the gray text looks strange

@jacogr
Copy link
Member

jacogr commented Oct 20, 2021

The input there is a [u8; 32] as specified by the metadata in v14. There is no hint in the metadata that indicates that this is a publicKey. Nothing broken, it is 100% as expected and indicated by the metadata - the API doesn't assign types anymore, rather the raw types and structures are supplied by the metadata.

This is the actual type specification in the metadata, id there is, as displayed -

{
  "id": 110,
  "type": {
    "path": [
      "xcm",
      "v1",
      "junction",
      "Junction"
    ],
    "params": [],
    "def": {
      "variant": {
        "variants": [
          {
            "name": "Parachain",
            "fields": [
              {
                "name": null,
                "type": 111,
                "typeName": "u32",
                "docs": []
              }
            ],
            "index": 0,
            "docs": []
          },
          {
            "name": "AccountId32",
            "fields": [
              {
                "name": "network",
                "type": 112,
                "typeName": "NetworkId",
                "docs": []
              },
              {
                "name": "id",
                "type": 1,
                "typeName": "[u8; 32]",
                "docs": []
              }
            ],
            "index": 1,
            "docs": []
          },
          ...

That is generated from the Rust code below and presented in the metadata -

pub enum Junction {
   /// An indexed parachain belonging to and operated by the context.
   ///
   /// Generally used when the context is a Polkadot Relay-chain.
   Parachain(#[codec(compact)] u32),
   /// A 32-byte identifier for an account of a specific network that is respected as a sovereign endpoint within
   /// the context.
   ///
   /// Generally used when the context is a Substrate-based chain.
   AccountId32 { network: NetworkId, id: [u8; 32] },
   ...

TL;DR This may not be what you as a user expects to see (especially if used to the manually-supplied types in the past that applied types such as AccountId32 to these fields based on intent in the codebase), but is fully correct based on the type information in metadata v14.

EDIT: Tip on any [u8; <length>] or Bytes/Vec<u8> fields - pasting an address in there will force it to submit the publicKey for that address.

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

yes it's correct but just hard to use, also we don't have downward transfer UI I believe

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

image

having this now @jacogr

@jacogr
Copy link
Member

jacogr commented Oct 20, 2021

Westend? It needs an upgrade - the weights are broken on it.

TL;DR it is runtime related, as the message suggests. Nothing the API can do. Would refer this to the relevant runtime repos.

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

@jacogr what shall I do? I'm not yet very clear on this. The westend is also v0.9.11

@jacogr
Copy link
Member

jacogr commented Oct 20, 2021

Westend has broken weights for xcm. If you try and do a teleport, you will see the same.

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

@jacogr I'm lost, I tried to construct it from code and I did the following:

        const feeAssetItem = 0;
        return {
          client: relayApi,
          tx: relayApi.tx.xcmPallet.reserveTransferAssets,
          params: [
            relayApi.createType('XcmVersionedMultiLocation', {
              V1: relayApi.createType('MultiLocationV1', {
                parents: 0,
                interior: relayApi.createType('JunctionsV1', {
                  X1: relayApi.createType('JunctionV1', {
                    Parachain: relayApi.createType('Compact<u32>', parachainId)
                  })
                })
              })
            }),
            relayApi.createType('XcmVersionedMultiLocation', {
              V1: relayApi.createType('MultiLocationV1', {
                parents: 0,
                interior: relayApi.createType('JunctionsV1', {
                  X1: relayApi.createType('JunctionV1', {
                    AccountId32: {
                      network: relayApi.createType('NetworkId', 'Any'),
                      id: account.address
                    }
                  })
                })
              })
            }),
            relayApi.createType('XcmVersionedMultiAssets', {
              V1: [
                relayApi.createType(' XcmV1MultiAsset', {
                  id: relayApi.createType('XcmAssetId', {
                    Concrete: relayApi.createType('MultiLocationV1', {
                      parents: 0,
                      interior: relayApi.createType('JunctionsV1', 'Here')
                    })
                  }),
                  fun: relayApi.createType('FungibilityV1', {
                    Fungible: mulDecs(value, decimals).toString()
                  })
                })
              ]
            }),
            feeAssetItem
          ]
        };
      }

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

I'd like to construct v2 message because I heard that it's audited, but sadly XcmVersionedMultiLocation only has v0 v1, and I still get UnweightableMessage error

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

our westend is located at: https://github.com/parallel-finance/polkadot/tree/parallel-westend-v0.9.11, do you mind having a look on what's happening? The only important change is: parallel-finance/polkadot@065b5ba

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

I'm trying with kusama-local now

@GopherJ
Copy link
Contributor Author

GopherJ commented Oct 20, 2021

ok I got different error now, I got idea to fix it at least, thanks

image

@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants