polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.74k stars 1.54k forks source link

Specific core mask is displayed incorrectly on PJS apps #10343

Open seadanda opened 6 months ago

seadanda commented 6 months ago

It was pointed out that this is just an incorrect representation of the core mask b01010101010101010101010101010101010101010101010101010101010101010101010101010101, which equates to UUUUUUUUUU in Unicode. When a region is interlaced 50% we end up with this core mask. This will happen quite often and should be displayed in a way that is consistent with any other core mask.

It appears that apps tries to decode it as UTF-8 before (correctly) decoding it as hex or an 80 bit binary string. It should not try to decode this field as UTF-8.

Szegoo commented 6 months ago

This issue is related to the PJS API repository, as it arises during the attempt to format regionId using toHuman()

seadanda commented 6 months ago

Maybe a code owner could move this issue to that repo

TarikGul commented 6 months ago

This is in the queue to check further on Thursday! Thanks for the patience.

TarikGul commented 6 months ago

So I looked into this (not to deep as its been a long day). But the console is logging:

params: initValue: No default value for type PalletBrokerCoreMask from {"info":10,"name":"mask","type":"PalletBrokerCoreMask"}, using defaults

params: findComponent: No pre-defined component for type PalletBrokerCoreMask from Plain: {"info":10,"name":"mask","type":"PalletBrokerCoreMask"}

Which is a good start. I'll continue looking into this in the morning.

TarikGul commented 6 months ago

Ahh nvm the above warnings i posted have to do with the params.... Not connected to the above issue.

TarikGul commented 6 months ago

Sorry for the little delay. This is a bit deeper than I thought, but it goes all the way to the common repo. Basically the storage key for mask is valid ascii which is interpreted in the api as that here.

Looking into a more specific solution now.